Preffer CPE identifiers

This commit is contained in:
Šesták Vít
2017-10-09 15:01:04 +02:00
parent e43cee7743
commit 1097e77d1c
2 changed files with 6 additions and 6 deletions

View File

@@ -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)){
<span class="badge">file: @dep.fileNames.toSeq.sorted.mkString(", ")@if(addButtons){<span class="btn-xs library-identification-badge-hack">&nbsp;</span>}</span>
}
@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){
<span class="badge">
@identifier(id, addLink)
@for(cpe <- id.toCpeIdentifierOption; suppressionXmlId <- suppressionXmlIdOption; if addButtons){
@@ -23,6 +23,6 @@
@if(addButtons && suppressionXmlIdOption.isDefined){<span class="btn-xs library-identification-badge-hack">&nbsp;</span>}
</span>
}
@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){
<span class="badge"><del>@identifier(id, addLink)</del></span>
}

View File

@@ -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)){
<li><span class="identifier identifier-file" data-type="file" data-confidence="highest">@dep.fileNames.toSeq.sorted.mkString(", ")@if(addButtons){<span class="btn-xs library-identification-badge-hack">&nbsp;</span>}</span></li>
}
@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){
<li>
@identifier(id, addLink)
@for(cpe <- id.toCpeIdentifierOption; suppressionXmlId <- suppressionXmlIdOption; if addButtons){
@@ -27,7 +27,7 @@
@if(addButtons && suppressionXmlIdOption.isDefined){<span class="btn-xs library-identification-badge-hack">&nbsp;</span>}
</li>
}
@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){
<li><del>@identifier(id, addLink)</del></li>
}
</ul>