Skip to content

Commit

Permalink
Merge pull request #1766 from siemens/fix/report/listing-custom-licen…
Browse files Browse the repository at this point in the history
…se-text

fix(report): Don't group results with custom text

Reviewed-by: shaheem.azmal@siemens.com
Tested-by: shaheem.azmal@siemens.com
  • Loading branch information
shaheemazmalmmd committed Aug 6, 2020
2 parents d7c96fa + 5638337 commit f70d436
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/lib/php/Report/ClearedGetterCommon.php
Expand Up @@ -179,6 +179,7 @@ protected function groupStatements($ungrupedStatements, $extended, $agentCall, $
if ($extended) {
$key = array_search($statement['textfinding'], array_column($findings, 'content'));
$findings[$key]["comments"] = convertToUTF8($comments, false);
$findings[$key]["licenseId"] = $licenseId;
}
}
//To keep the schedular alive for large files
Expand All @@ -188,7 +189,7 @@ protected function groupStatements($ungrupedStatements, $extended, $agentCall, $
}
}
arsort($statements);
if ($isUnifiedReport) {
if ($agentCall == "copyright" && $isUnifiedReport) {
arsort($findings);
if (!empty($objectAgent)) {
$actualHeartbeat = (count($statements) + count($findings));
Expand Down
4 changes: 2 additions & 2 deletions src/readmeoss/agent/readmeoss.php
Expand Up @@ -125,11 +125,11 @@ function processUploadId($uploadId)
if (!$this->uploadDao->isAccessible($addUploadId, $groupId)) {
continue;
}
$moreLicenses = $this->licenseClearedGetter->getCleared($addUploadId, $this, $groupId, true, null, false);
$moreLicenses = $this->licenseClearedGetter->getCleared($addUploadId, $this, $groupId, true, "license", false);
$licenseStmts = array_merge($licenseStmts, $moreLicenses['statements']);
$this->heartbeat(count($moreLicenses['statements']));
$this->licenseClearedGetter->setOnlyAcknowledgements(true);
$moreAcknowledgements = $this->licenseClearedGetter->getCleared($addUploadId, $this, $groupId, true, null, false);
$moreAcknowledgements = $this->licenseClearedGetter->getCleared($addUploadId, $this, $groupId, true, "license", false);
$licenseAcknowledgements = array_merge($licenseAcknowledgements, $moreAcknowledgements['statements']);
$this->heartbeat(count($moreAcknowledgements['statements']));
$moreCopyrights = $this->cpClearedGetter->getCleared($addUploadId, $this, $groupId, true, "copyright", false);
Expand Down
6 changes: 3 additions & 3 deletions src/unifiedreport/agent/unifiedreport.php
Expand Up @@ -264,7 +264,7 @@ function processUploadId($uploadId)

$this->heartbeat(0);

$licenses = $this->licenseClearedGetter->getCleared($uploadId, $this, $groupId, true, null, false);
$licenses = $this->licenseClearedGetter->getCleared($uploadId, $this, $groupId, true, "license", false);
$this->heartbeat(empty($licenses) ? 0 : count($licenses["statements"]));

$licensesMain = $this->licenseMainGetter->getCleared($uploadId, $this, $groupId, true, null, false);
Expand All @@ -277,7 +277,7 @@ function processUploadId($uploadId)
$this->heartbeat(empty($bulkLicenses) ? 0 : count($bulkLicenses["statements"]));

$this->licenseClearedGetter->setOnlyAcknowledgements(true);
$licenseAcknowledgements = $this->licenseClearedGetter->getCleared($uploadId, $this, $groupId, true, null, false);
$licenseAcknowledgements = $this->licenseClearedGetter->getCleared($uploadId, $this, $groupId, true, "license", false);
$this->heartbeat(empty($licenseAcknowledgements) ? 0 : count($licenseAcknowledgements["statements"]));

$this->licenseClearedGetter->setOnlyComments(true);
Expand All @@ -297,7 +297,7 @@ function processUploadId($uploadId)
$this->heartbeat(empty($licensesDNUComment) ? 0 : count($licensesDNUComment["statements"]));

$copyrights = $this->cpClearedGetter->getCleared($uploadId, $this, $groupId, true, "copyright", true);
$this->heartbeat(empty($copyrights["statements"]) ? 0 : count($copyrights["statements"]));
$this->heartbeat(empty($copyrights["scannerFindings"]) ? 0 : count($copyrights["scannerFindings"]) + count($copyrights["userFindings"]));

$ecc = $this->eccClearedGetter->getCleared($uploadId, $this, $groupId, true, "ecc", false);
$this->heartbeat(empty($ecc) ? 0 : count($ecc["statements"]));
Expand Down

0 comments on commit f70d436

Please sign in to comment.