dependency-check-ant/src/main/java/org/owasp/dependencycheck/taskdefs/Check.java
/**
     * Generates a warning message listing a summary of dependencies and their
     * associated CPE and CVE entries.
     *
     * @param dependencies a list of dependency objects
     */
Generates a warning message listing a summary of dependencies and their
associated CPE and CVE entries.

@param dependencies a list of dependency objects
Generates a warning message listing a summary of dependencies and their associated CPE and CVE entries . @param dependencies a list of dependency objects
private void showSummary(List<Dependency> dependencies) {
        final StringBuilder summary = new StringBuilder();
        for (Dependency d : dependencies) {
            boolean firstEntry = true;
            final StringBuilder ids = new StringBuilder();
            for (Vulnerability v : d.getVulnerabilities()) {
                if (firstEntry) {
                    firstEntry = false;
                } else {
                    ids.append(", ");
                }
                ids.append(v.getName());
            }
            if (ids.length() > 0) {
                summary.append(d.getFileName()).append(" (");
                firstEntry = true;
                for (Identifier id : d.getIdentifiers()) {
                    if (firstEntry) {
                        firstEntry = false;
                    } else {
                        summary.append(", ");
                    }
                    summary.append(id.getValue());
                }
                summary.append(") : ").append(ids).append(NEW_LINE);
            }
        }
        if (summary.length() > 0) {
            final String msg = String.format("%n%n"
                    + "One or more dependencies were identified with known vulnerabilities:%n%n%s"
                    + "%n%nSee the dependency-check report for more details.%n%n", summary.toString());
            log(msg, Project.MSG_WARN);
        }
    }
private void showSummary ( List < Dependency > dependencies ) { final StringBuilder summary = new StringBuilder ( ) ; for ( Dependency d : dependencies ) { boolean firstEntry = true ; final StringBuilder ids = new StringBuilder ( ) ; for ( Vulnerability v : d . getVulnerabilities ( ) ) { if ( firstEntry ) { firstEntry = false ; } else { ids . append ( ", " ) ; } ids . append ( v . getName ( ) ) ; } if ( ids . length ( ) > 0 ) { summary . append ( d . getFileName ( ) ) . append ( " (" ) ; firstEntry = true ; for ( Identifier id : d . getIdentifiers ( ) ) { if ( firstEntry ) { firstEntry = false ; } else { summary . append ( ", " ) ; } summary . append ( id . getValue ( ) ) ; } summary . append ( ") : " ) . append ( ids ) . append ( NEW_LINE ) ; } } if ( summary . length ( ) > 0 ) { final String msg = String . format ( "%n%n" + "One or more dependencies were identified with known vulnerabilities:%n%n%s" + "%n%nSee the dependency-check report for more details.%n%n" , summary . toString ( ) ) ; log ( msg , Project . MSG_WARN ) ; } }
Generates a warning message listing a summary of dependencies and their
 associated CPE and CVE entries.
Generates a warning message listing a summary of dependencies and their associated CPE and CVE entries .