private boolean ignoreUnassessed(VulnerableDependency _a) { if(this.ignoreUnassessed.equalsIgnoreCase(IGN_UNASS_OFF)) return false; else if(this.ignoreUnassessed.equalsIgnoreCase(IGN_UNASS_ALL)) return !_a.isAffectedVersionConfirmed(); else return !_a.isAffectedVersionConfirmed() && _a.getDep().getLib().isWellknownDigest(); }
public String getResultAsString() { final StringBuilder builder = new StringBuilder(); // Explanatory text if(exceptionThreshold.equalsIgnoreCase(THRESHOLD_DEP_ON)) builder.append("The application depends on the following vulnerable archives: "); else if(exceptionThreshold.equalsIgnoreCase(THRESHOLD_POT_EXE)) builder.append("The application potentially executes vulnerable code of the following vulnerable archives (or reachability was not checked): "); else if(exceptionThreshold.equalsIgnoreCase(THRESHOLD_ACT_EXE)) builder.append("The application actually executes vulnerable code of the following vulnerable archives (or no tests were run): "); // Will it result in a build exception? int i = 0; for(AggregatedVuln v: this.vulnsAboveThreshold) { for(VulnerableDependency analysis: v.getAnalyses()) { if(analysis.isThrowsException()) { builder.append(System.getProperty("line.separator")).append(" ").append(++i).append(": "); builder.append("[filename=").append(v.filename); builder.append(", scope=").append(analysis.getDep().getScope()); builder.append(", transitive=").append(analysis.getDep().getTransitive()); builder.append(", wellknownSha1=").append(analysis.getDep().getLib().isWellknownDigest()); builder.append(", isAffectedVersionConfirmed=").append(analysis.isAffectedVersionConfirmed()); builder.append(", bug=").append(v.bug.getBugId()).append("]"); } } } return builder.toString(); }