From 181a4c596c246afa5032aa7c2d29d4f8be7eb942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0est=C3=A1k=20V=C3=ADt?= Date: Mon, 16 Apr 2018 10:34:50 +0200 Subject: [PATCH] Adjusted formatting of library identifiers in vulnerability details --- app/assets/css/main.css | 19 +++++++------ app/views/libraryIdentification.scala.html | 28 ------------------- app/views/statistics/vulnerability.scala.html | 24 +++++++++------- 3 files changed, 25 insertions(+), 46 deletions(-) delete mode 100644 app/views/libraryIdentification.scala.html diff --git a/app/assets/css/main.css b/app/assets/css/main.css index 86af9a5..3c163bb 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -45,11 +45,6 @@ font-size: smaller; } -h3.library-identification{ - border: 1px solid black; - padding: 5px; -} - .library-identification-badge-hack{ display: inline-block; width: 1px; @@ -75,11 +70,19 @@ h3.library-identification{ color: white; font-weight: bold; } -.dependencies-table .identifiers ul, .dependencies-table .identifiers ul li{ +.identifiers ul, .identifiers ul li{ margin-left: 0; padding-left: 0; list-style-type: none; } +div.identifiers li.library-identification{ + border: 2px solid gray; + border-left-width: 0; + border-right-width: 0; + padding: 5px 5px 5px 16px; + display: block; + margin: 0 0 -2px 0; +} .severity{ font-size: smaller; @@ -196,11 +199,11 @@ h3.library-identification{ .dependencies-table .severity .score-vulnerability:hover{ color: rgb(192, 0, 0); } -.dependencies-table .identifiers .tooltip-inner { +.identifiers .tooltip-inner { max-width: 350px; width: 350px; } -.dependencies-table .identifiers .explained{ +.identifiers .explained{ border-bottom: none; } .dependencies-table .vulnerabilities-details > li{ diff --git a/app/views/libraryIdentification.scala.html b/app/views/libraryIdentification.scala.html deleted file mode 100644 index 33e064f..0000000 --- a/app/views/libraryIdentification.scala.html +++ /dev/null @@ -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)){ - file: @dep.fileNames.toSeq.sorted.mkString(", ")@if(addButtons){ } -} -@for(id <- dep.identifiers.toSeq.sortBy(i => (i.confidence, i.identifierType == "cpe", i.identifierType, i.name, i.url)).reverse){ - - @identifier(id, addLink) - @for(cpe <- id.toCpeIdentifierOption; suppressionXmlId <- suppressionXmlIdOption; if addButtons){ - - } - @if(addButtons && suppressionXmlIdOption.isDefined){ } - -} -@for(id <- dep.suppressedIdentifiers.toSeq.sortBy(i => (i.confidence, i.identifierType == "cpe", i.identifierType, i.name, i.url)).reverse){ - @identifier(id, addLink) -} diff --git a/app/views/statistics/vulnerability.scala.html b/app/views/statistics/vulnerability.scala.html index 0af97e0..2ecae03 100644 --- a/app/views/statistics/vulnerability.scala.html +++ b/app/views/statistics/vulnerability.scala.html @@ -31,20 +31,24 @@ } @section("affected-deps", s"Unique affected dependencies (${vulnerableDependencies.size})"){ - +
+ +
} @section("affected-projects", s"Affected projects (${affectedProjects.size} projects with ${affectedProjects.flatMap(_._2).size} occurrences)"){ @for((project, dependencies) <- affectedProjects.toSeq.sortBy(_._1)){

@friendlyProjectName(project) (@dependencies.size)

- +
+ +
} } }