From 1097e77d1c08e19e1c2428422056efc5051ede08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0est=C3=A1k=20V=C3=ADt?= Date: Mon, 9 Oct 2017 15:01:04 +0200 Subject: [PATCH] Preffer CPE identifiers --- app/views/libraryIdentification.scala.html | 6 +++--- app/views/libraryIdentificationList.scala.html | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/libraryIdentification.scala.html b/app/views/libraryIdentification.scala.html index 3a20e09..33e064f 100644 --- a/app/views/libraryIdentification.scala.html +++ b/app/views/libraryIdentification.scala.html @@ -8,13 +8,13 @@ // 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.Tuple4[Confidence.Value, String, String, String] + 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, i.name, i.url)).reverse){ +@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){ @@ -23,6 +23,6 @@ @if(addButtons && suppressionXmlIdOption.isDefined){ } } -@for(id <- dep.suppressedIdentifiers.toSeq.sortBy(i => (i.confidence, i.identifierType, i.name, i.url)).reverse){ +@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/libraryIdentificationList.scala.html b/app/views/libraryIdentificationList.scala.html index c8acad4..b9c9687 100644 --- a/app/views/libraryIdentificationList.scala.html +++ b/app/views/libraryIdentificationList.scala.html @@ -8,7 +8,7 @@ // 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.Tuple4[Confidence.Value, String, String, String] + Ordering.Tuple5[Confidence.Value, Boolean, String, String, String] } @cleanIdentifiers(identifiers: Set[Identifier]) = @{ if(addLink) identifiers @@ -18,7 +18,7 @@ @if(!dep.identifiers.exists(_.confidence >= Confidence.High)){
  • @dep.fileNames.toSeq.sorted.mkString(", ")@if(addButtons){ }
  • } -@for(id <- cleanIdentifiers(dep.identifiers).toSeq.sortBy(i => (i.confidence, i.identifierType, i.name, i.url)).reverse){ +@for(id <- cleanIdentifiers(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){ @@ -27,7 +27,7 @@ @if(addButtons && suppressionXmlIdOption.isDefined){ }
  • } -@for(id <- cleanIdentifiers(dep.suppressedIdentifiers).toSeq.sortBy(i => (i.confidence, i.identifierType, i.name, i.url)).reverse){ +@for(id <- cleanIdentifiers(dep.suppressedIdentifiers).toSeq.sortBy(i => (i.confidence, i.identifierType == "cpe", i.identifierType, i.name, i.url)).reverse){
  • @identifier(id, addLink)
  • } \ No newline at end of file