8 namespace Fossology\Lib\Report;
19 private $nonFunctionalFilesOnly;
21 public function __construct($nonFunctionalFilesOnly=
true)
23 $this->clearingDao = $GLOBALS[
'container']->get(
'dao.clearing');
24 $this->nonFunctionalFilesOnly = $nonFunctionalFilesOnly;
25 parent::__construct($groupBy =
'text');
34 protected function getStatements($uploadId, $uploadTreeTableName, $groupId=
null)
36 $itemTreeBounds = $this->uploadDao->getParentItemBounds($uploadId,$uploadTreeTableName);
37 return $this->clearingDao->getFilesForDecisionTypeFolderLevel($itemTreeBounds, $groupId,
true,
'nonFunctional');
45 protected function groupStatements($ungrupedStatements, $extended, $agentcall, $isUnifiedReport, $objectAgent)
47 $statements = array();
48 foreach ($ungrupedStatements as $statement) {
49 $fileName = $statement[
'fileName'];
50 $dirName = dirname($statement[
'fileName']);
51 $baseName = basename($statement[
'fileName']);
52 $comment = $statement[
'comment'];
54 $statement[
'spdx_id']);
55 if ($this->nonFunctionalFilesOnly) {
56 if (array_key_exists($fileName, $statements)) {
57 $currentLics = &$statements[$fileName][
"licenses"];
58 if (! in_array($licenseName, $currentLics)) {
59 $currentLics[] = $licenseName;
62 $statements[$fileName] = array(
64 "fileName" => $baseName,
65 "licenses" => array($licenseName)
70 $statements[] = array(
71 "content" => $licenseName,
73 "files" => array($fileName)
77 $objectAgent->heartbeat(1);
79 return array(
"statements" => array_values($statements));
static convertToSpdxId($shortname, $spdxId)
Given a license's shortname and spdx id, give out spdx id to use in reports.
groupStatements($ungrupedStatements, $extended, $agentcall, $isUnifiedReport, $objectAgent)
getStatements($uploadId, $uploadTreeTableName, $groupId=null)
if(! defined('ENT_SUBSTITUTE')) convertToUTF8($content, $toHTML=true)