Skip to content

Commit

Permalink
feat(static-html): Also show advisor issues in the project tables
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau authored and sschuberth committed May 16, 2024
1 parent ae16d01 commit 45bb867
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1186,15 +1186,40 @@ <h3>Packages</h3>
</td>
<td>
<table class="report-table package-issue-table">
<tr class="error">
<td>
<p>Unknown time [ERROR]: VulnerableCode - Example advisor error.</p>
</td>
</tr>
<tr class="warning">
<td>
<p>2024-04-25T07:44:20.725613974Z [WARNING]: Gradle - Example analyzer warning in included
package.</p>
</td>
</tr>
<tr class="warning">
<td>
<p>Unknown time [WARNING]: VulnerableCode - Example advisor warning.</p>
</td>
</tr>
<tr class="hint">
<td>
<p>Unknown time [HINT]: VulnerableCode - Example advisor hint.</p>
</td>
</tr>
</table>
</td>
<td>
<table class="report-table package-issue-table">
<tr class="resolved">
<td>
<p>Unknown time [ERROR]: VulnerableCode - Example advisor error, resolved.</p>
<p>
Resolved by: CANT_FIX_ISSUE - A comment explaining why the issue can be ignored.</p>
</td>
</tr>
</table>
</td>
<td></td>
</tr>
<tr class="pkg " id="Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0-pkg-7">
<td><a href="#Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0-pkg-7">7</a></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private fun RuleViolation.toTableReportViolation(ortResult: OrtResult): TablesRe
private fun getProjectTable(input: ReporterInput, project: Project): ProjectTable {
val projectIssuesForId = input.ortResult.dependencyNavigator.projectIssues(project)
val scannerIssuesForId = input.ortResult.getScannerIssues()
val advisorIssuesForId = input.ortResult.getAdvisorIssues()
val scopesForId = input.ortResult.getScopesForDependencies(project)
val ids = input.ortResult.dependencyNavigator.projectDependencies(project) + project.id

Expand All @@ -149,6 +150,7 @@ private fun getProjectTable(input: ReporterInput, project: Project): ProjectTabl
addAll(projectIssuesForId[id].orEmpty())
addAll(input.ortResult.analyzer?.result?.issues?.get(id).orEmpty())
addAll(scannerIssuesForId[id].orEmpty())
addAll(advisorIssuesForId[id].orEmpty())
}.map { issue ->
val isRowExcluded = input.ortResult.isExcluded(id) ||
(id != project.id && scopesForId[id].orEmpty().all { it.value.isNotEmpty() })
Expand Down

0 comments on commit 45bb867

Please sign in to comment.