mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-05-30 19:30:37 +02:00
Adjusted formatting of library identifiers in vulnerability details
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
@(dep: GroupedDependency, suppressionXmlIdOption: Option[String => String] = None, addLink: Boolean = true, addButtons: Boolean = true)
|
||||
@import com.ysoft.odc.Confidence
|
||||
@implicitOrdering = @{
|
||||
// This implicit should not be theoretically needed, but missing this used to cause somehow non-deterministic scalac behavior:
|
||||
// The first ….sortBy expression used to pass, while the second one used to fail sometimes. Even though both expressions are essentially the same.
|
||||
// When these expressions are swapped, still the first (after swapping) one passes and the second one fails, no matter which one is the first and
|
||||
// which is the second. So, it looks like some compiler bug related to mutable state.
|
||||
// It also seems to be related to some compiler cache. It is somehow possible to compile it by incremental compilation and some code changes, but
|
||||
// clean build deterministically fails at the second expression.
|
||||
// So, making the implicit explicit is a workaround for this issue.
|
||||
Ordering.Tuple5[Confidence.Value, Boolean, String, String, String]
|
||||
}
|
||||
|
||||
@if(!dep.identifiers.exists(_.confidence >= Confidence.High)){
|
||||
<span class="badge">file: @dep.fileNames.toSeq.sorted.mkString(", ")@if(addButtons){<span class="btn-xs library-identification-badge-hack"> </span>}</span>
|
||||
}
|
||||
@for(id <- dep.identifiers.toSeq.sortBy(i => (i.confidence, i.identifierType == "cpe", i.identifierType, i.name, i.url)).reverse){
|
||||
<span class="badge">
|
||||
@identifier(id, addLink)
|
||||
@for(cpe <- id.toCpeIdentifierOption; suppressionXmlId <- suppressionXmlIdOption; if addButtons){
|
||||
<button class="btn btn-default btn-xs" data-toggle="collapse" data-target="#@suppressionXmlId(cpe)">×</button>
|
||||
}
|
||||
@if(addButtons && suppressionXmlIdOption.isDefined){<span class="btn-xs library-identification-badge-hack"> </span>}
|
||||
</span>
|
||||
}
|
||||
@for(id <- dep.suppressedIdentifiers.toSeq.sortBy(i => (i.confidence, i.identifierType == "cpe", i.identifierType, i.name, i.url)).reverse){
|
||||
<span class="badge"><del>@identifier(id, addLink)</del></span>
|
||||
}
|
||||
@@ -31,20 +31,24 @@
|
||||
</ul>
|
||||
}
|
||||
@section("affected-deps", s"Unique affected dependencies (${vulnerableDependencies.size})"){
|
||||
<ul>
|
||||
@for(dep <- vulnerableDependencies){
|
||||
<li class="library-identification">@libraryIdentification(dep)</li>
|
||||
}
|
||||
</ul>
|
||||
<div class="identifiers">
|
||||
<ul>
|
||||
@for(dep <- vulnerableDependencies){
|
||||
<li class="library-identification">@libraryIdentificationList(dep, addButtons = false, addLink = false)</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
@section("affected-projects", s"Affected projects (${affectedProjects.size} projects with ${affectedProjects.flatMap(_._2).size} occurrences)"){
|
||||
@for((project, dependencies) <- affectedProjects.toSeq.sortBy(_._1)){
|
||||
<h3><a href="@routes.Statistics.basic(Some("project:"+project.fullId))">@friendlyProjectName(project)</a> (@dependencies.size)</h3>
|
||||
<ul>
|
||||
@for(dep <- dependencies.toSeq){
|
||||
<li class="library-identification">@libraryIdentification(dep)</li>
|
||||
}
|
||||
</ul>
|
||||
<div class="identifiers">
|
||||
<ul>
|
||||
@for(dep <- dependencies.toSeq){
|
||||
<li class="library-identification">@libraryIdentificationList(dep, addButtons = false, addLink = false)</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user