id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
17,700
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java
DependencyBundlingAnalyzer.npmVersionsMatch
public static boolean npmVersionsMatch(String current, String next) { String left = current; String right = next; if (left == null || right == null) { return false; } if (left.equals(right) || "*".equals(left) || "*".equals(right)) { return true; }...
java
public static boolean npmVersionsMatch(String current, String next) { String left = current; String right = next; if (left == null || right == null) { return false; } if (left.equals(right) || "*".equals(left) || "*".equals(right)) { return true; }...
[ "public", "static", "boolean", "npmVersionsMatch", "(", "String", "current", ",", "String", "next", ")", "{", "String", "left", "=", "current", ";", "String", "right", "=", "next", ";", "if", "(", "left", "==", "null", "||", "right", "==", "null", ")", ...
Determine if the dependency version is equal in the given dependencies. This method attempts to evaluate version range checks. @param current a dependency version to compare @param next a dependency version to compare @return true if the version is equal in both dependencies; otherwise false
[ "Determine", "if", "the", "dependency", "version", "is", "equal", "in", "the", "given", "dependencies", ".", "This", "method", "attempts", "to", "evaluate", "version", "range", "checks", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java#L509-L562
17,701
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java
DependencyBundlingAnalyzer.stripLeadingNonNumeric
private static String stripLeadingNonNumeric(String str) { for (int x = 0; x < str.length(); x++) { if (Character.isDigit(str.codePointAt(x))) { return str.substring(x); } } return null; }
java
private static String stripLeadingNonNumeric(String str) { for (int x = 0; x < str.length(); x++) { if (Character.isDigit(str.codePointAt(x))) { return str.substring(x); } } return null; }
[ "private", "static", "String", "stripLeadingNonNumeric", "(", "String", "str", ")", "{", "for", "(", "int", "x", "=", "0", ";", "x", "<", "str", ".", "length", "(", ")", ";", "x", "++", ")", "{", "if", "(", "Character", ".", "isDigit", "(", "str", ...
Strips leading non-numeric values from the start of the string. If no numbers are present this will return null. @param str the string to modify @return the string without leading non-numeric characters
[ "Strips", "leading", "non", "-", "numeric", "values", "from", "the", "start", "of", "the", "string", ".", "If", "no", "numbers", "are", "present", "this", "will", "return", "null", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java#L571-L578
17,702
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java
Vulnerability.getReferences
public List<Reference> getReferences(boolean sorted) { final List<Reference> sortedRefs = new ArrayList<>(this.references); if (sorted) { Collections.sort(sortedRefs); } return sortedRefs; }
java
public List<Reference> getReferences(boolean sorted) { final List<Reference> sortedRefs = new ArrayList<>(this.references); if (sorted) { Collections.sort(sortedRefs); } return sortedRefs; }
[ "public", "List", "<", "Reference", ">", "getReferences", "(", "boolean", "sorted", ")", "{", "final", "List", "<", "Reference", ">", "sortedRefs", "=", "new", "ArrayList", "<>", "(", "this", ".", "references", ")", ";", "if", "(", "sorted", ")", "{", ...
Returns the list of references. This is primarily used within the generated reports. @param sorted whether the returned list should be sorted @return the list of references
[ "Returns", "the", "list", "of", "references", ".", "This", "is", "primarily", "used", "within", "the", "generated", "reports", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java#L182-L188
17,703
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java
Vulnerability.addReference
public void addReference(String referenceSource, String referenceName, String referenceUrl) { final Reference ref = new Reference(); ref.setSource(referenceSource); ref.setName(referenceName); ref.setUrl(referenceUrl); this.references.add(ref); }
java
public void addReference(String referenceSource, String referenceName, String referenceUrl) { final Reference ref = new Reference(); ref.setSource(referenceSource); ref.setName(referenceName); ref.setUrl(referenceUrl); this.references.add(ref); }
[ "public", "void", "addReference", "(", "String", "referenceSource", ",", "String", "referenceName", ",", "String", "referenceUrl", ")", "{", "final", "Reference", "ref", "=", "new", "Reference", "(", ")", ";", "ref", ".", "setSource", "(", "referenceSource", "...
Adds a reference. @param referenceSource the source of the reference @param referenceName the referenceName of the reference @param referenceUrl the url of the reference
[ "Adds", "a", "reference", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java#L215-L221
17,704
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java
Vulnerability.getVulnerableSoftware
public List<VulnerableSoftware> getVulnerableSoftware(boolean sorted) { final List<VulnerableSoftware> sortedVulnerableSoftware = new ArrayList<>(this.vulnerableSoftware); if (sorted) { Collections.sort(sortedVulnerableSoftware); } return sortedVulnerableSoftware; }
java
public List<VulnerableSoftware> getVulnerableSoftware(boolean sorted) { final List<VulnerableSoftware> sortedVulnerableSoftware = new ArrayList<>(this.vulnerableSoftware); if (sorted) { Collections.sort(sortedVulnerableSoftware); } return sortedVulnerableSoftware; }
[ "public", "List", "<", "VulnerableSoftware", ">", "getVulnerableSoftware", "(", "boolean", "sorted", ")", "{", "final", "List", "<", "VulnerableSoftware", ">", "sortedVulnerableSoftware", "=", "new", "ArrayList", "<>", "(", "this", ".", "vulnerableSoftware", ")", ...
Returns a sorted list of vulnerable software. This is primarily used for display within reports. @param sorted whether or not the list should be sorted @return the list of vulnerable software
[ "Returns", "a", "sorted", "list", "of", "vulnerable", "software", ".", "This", "is", "primarily", "used", "for", "display", "within", "reports", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java#L239-L245
17,705
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java
Vulnerability.compareTo
@Override public int compareTo(Vulnerability v) { return new CompareToBuilder() .append(this.name, v.name) .toComparison(); }
java
@Override public int compareTo(Vulnerability v) { return new CompareToBuilder() .append(this.name, v.name) .toComparison(); }
[ "@", "Override", "public", "int", "compareTo", "(", "Vulnerability", "v", ")", "{", "return", "new", "CompareToBuilder", "(", ")", ".", "append", "(", "this", ".", "name", ",", "v", ".", "name", ")", ".", "toComparison", "(", ")", ";", "}" ]
Compares two vulnerabilities. @param v a vulnerability to be compared @return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified vulnerability
[ "Compares", "two", "vulnerabilities", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Vulnerability.java#L407-L412
17,706
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.artifactsMatch
private static boolean artifactsMatch(org.apache.maven.model.Dependency d, Artifact a) { return isEqualOrNull(a.getArtifactId(), d.getArtifactId()) && isEqualOrNull(a.getGroupId(), d.getGroupId()) && isEqualOrNull(a.getVersion(), d.getVersion()); }
java
private static boolean artifactsMatch(org.apache.maven.model.Dependency d, Artifact a) { return isEqualOrNull(a.getArtifactId(), d.getArtifactId()) && isEqualOrNull(a.getGroupId(), d.getGroupId()) && isEqualOrNull(a.getVersion(), d.getVersion()); }
[ "private", "static", "boolean", "artifactsMatch", "(", "org", ".", "apache", ".", "maven", ".", "model", ".", "Dependency", "d", ",", "Artifact", "a", ")", "{", "return", "isEqualOrNull", "(", "a", ".", "getArtifactId", "(", ")", ",", "d", ".", "getArtif...
Determines if the groupId, artifactId, and version of the Maven dependency and artifact match. @param d the Maven dependency @param a the Maven artifact @return true if the groupId, artifactId, and version match
[ "Determines", "if", "the", "groupId", "artifactId", "and", "version", "of", "the", "Maven", "dependency", "and", "artifact", "match", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L683-L687
17,707
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.isEqualOrNull
private static boolean isEqualOrNull(String left, String right) { return (left != null && left.equals(right)) || (left == null && right == null); }
java
private static boolean isEqualOrNull(String left, String right) { return (left != null && left.equals(right)) || (left == null && right == null); }
[ "private", "static", "boolean", "isEqualOrNull", "(", "String", "left", ",", "String", "right", ")", "{", "return", "(", "left", "!=", "null", "&&", "left", ".", "equals", "(", "right", ")", ")", "||", "(", "left", "==", "null", "&&", "right", "==", ...
Compares two strings for equality; if both strings are null they are considered equal. @param left the first string to compare @param right the second string to compare @return true if the strings are equal or if they are both null; otherwise false.
[ "Compares", "two", "strings", "for", "equality", ";", "if", "both", "strings", "are", "null", "they", "are", "considered", "equal", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L698-L700
17,708
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.execute
@Override public void execute() throws MojoExecutionException, MojoFailureException { generatingSite = false; final boolean shouldSkip = Boolean.parseBoolean(System.getProperty("dependency-check.skip", Boolean.toString(skip))); if (shouldSkip) { getLog().info("Skipping " + getNam...
java
@Override public void execute() throws MojoExecutionException, MojoFailureException { generatingSite = false; final boolean shouldSkip = Boolean.parseBoolean(System.getProperty("dependency-check.skip", Boolean.toString(skip))); if (shouldSkip) { getLog().info("Skipping " + getNam...
[ "@", "Override", "public", "void", "execute", "(", ")", "throws", "MojoExecutionException", ",", "MojoFailureException", "{", "generatingSite", "=", "false", ";", "final", "boolean", "shouldSkip", "=", "Boolean", ".", "parseBoolean", "(", "System", ".", "getProper...
Executes dependency-check. @throws MojoExecutionException thrown if there is an exception executing the mojo @throws MojoFailureException thrown if dependency-check failed the build
[ "Executes", "dependency", "-", "check", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L709-L719
17,709
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.getCorrectOutputDirectory
protected File getCorrectOutputDirectory(MavenProject current) { final Object obj = current.getContextValue("dependency-check-output-dir"); if (obj != null && obj instanceof File) { return (File) obj; }//else we guess File target = new File(current.getBuild().getDirectory());...
java
protected File getCorrectOutputDirectory(MavenProject current) { final Object obj = current.getContextValue("dependency-check-output-dir"); if (obj != null && obj instanceof File) { return (File) obj; }//else we guess File target = new File(current.getBuild().getDirectory());...
[ "protected", "File", "getCorrectOutputDirectory", "(", "MavenProject", "current", ")", "{", "final", "Object", "obj", "=", "current", ".", "getContextValue", "(", "\"dependency-check-output-dir\"", ")", ";", "if", "(", "obj", "!=", "null", "&&", "obj", "instanceof...
Returns the correct output directory depending on if a site is being executed or not. @param current the Maven project to get the output directory from @return the directory to write the report(s)
[ "Returns", "the", "correct", "output", "directory", "depending", "on", "if", "a", "site", "is", "being", "executed", "or", "not", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L808-L818
17,710
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.toDependencyNode
private DependencyNode toDependencyNode(ProjectBuildingRequest buildingRequest, DependencyNode parent, org.apache.maven.model.Dependency dependency) throws ArtifactResolverException { final DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate(); coordinate.setGroupId(depend...
java
private DependencyNode toDependencyNode(ProjectBuildingRequest buildingRequest, DependencyNode parent, org.apache.maven.model.Dependency dependency) throws ArtifactResolverException { final DefaultArtifactCoordinate coordinate = new DefaultArtifactCoordinate(); coordinate.setGroupId(depend...
[ "private", "DependencyNode", "toDependencyNode", "(", "ProjectBuildingRequest", "buildingRequest", ",", "DependencyNode", "parent", ",", "org", ".", "apache", ".", "maven", ".", "model", ".", "Dependency", "dependency", ")", "throws", "ArtifactResolverException", "{", ...
Converts the dependency to a dependency node object. @param buildingRequest the Maven project building request @param parent the parent node @param dependency the dependency to convert @return the resulting dependency node @throws ArtifactResolverException thrown if the artifact could not be retrieved
[ "Converts", "the", "dependency", "to", "a", "dependency", "node", "object", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L882-L903
17,711
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.collectDependencyManagementDependencies
private ExceptionCollection collectDependencyManagementDependencies(ProjectBuildingRequest buildingRequest, MavenProject project, List<DependencyNode> nodes, boolean aggregate) { if (skipDependencyManagement || project.getDependencyManagement() == null) { return null; } ...
java
private ExceptionCollection collectDependencyManagementDependencies(ProjectBuildingRequest buildingRequest, MavenProject project, List<DependencyNode> nodes, boolean aggregate) { if (skipDependencyManagement || project.getDependencyManagement() == null) { return null; } ...
[ "private", "ExceptionCollection", "collectDependencyManagementDependencies", "(", "ProjectBuildingRequest", "buildingRequest", ",", "MavenProject", "project", ",", "List", "<", "DependencyNode", ">", "nodes", ",", "boolean", "aggregate", ")", "{", "if", "(", "skipDependen...
Collect dependencies from the dependency management section. @param buildingRequest the Maven project building request @param project the project being analyzed @param nodes the list of dependency nodes @param aggregate whether or not this is an aggregate analysis @return a collection of exceptions if any occurred; ot...
[ "Collect", "dependencies", "from", "the", "dependency", "management", "section", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L915-L934
17,712
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.runCheck
protected void runCheck() throws MojoExecutionException, MojoFailureException { try (Engine engine = initializeEngine()) { ExceptionCollection exCol = scanDependencies(engine); try { engine.analyzeDependencies(); } catch (ExceptionCollection ex) { ...
java
protected void runCheck() throws MojoExecutionException, MojoFailureException { try (Engine engine = initializeEngine()) { ExceptionCollection exCol = scanDependencies(engine); try { engine.analyzeDependencies(); } catch (ExceptionCollection ex) { ...
[ "protected", "void", "runCheck", "(", ")", "throws", "MojoExecutionException", ",", "MojoFailureException", "{", "try", "(", "Engine", "engine", "=", "initializeEngine", "(", ")", ")", "{", "ExceptionCollection", "exCol", "=", "scanDependencies", "(", "engine", ")...
Executes the dependency-check scan and generates the necessary report. @throws MojoExecutionException thrown if there is an exception running the scan @throws MojoFailureException thrown if dependency-check is configured to fail the build
[ "Executes", "the", "dependency", "-", "check", "scan", "and", "generates", "the", "necessary", "report", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L1313-L1362
17,713
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.handleAnalysisExceptions
private ExceptionCollection handleAnalysisExceptions(ExceptionCollection currentEx, ExceptionCollection newEx) throws MojoExecutionException { ExceptionCollection returnEx = currentEx; if (returnEx == null) { returnEx = newEx; } else { returnEx.getExceptions().addAll(newE...
java
private ExceptionCollection handleAnalysisExceptions(ExceptionCollection currentEx, ExceptionCollection newEx) throws MojoExecutionException { ExceptionCollection returnEx = currentEx; if (returnEx == null) { returnEx = newEx; } else { returnEx.getExceptions().addAll(newE...
[ "private", "ExceptionCollection", "handleAnalysisExceptions", "(", "ExceptionCollection", "currentEx", ",", "ExceptionCollection", "newEx", ")", "throws", "MojoExecutionException", "{", "ExceptionCollection", "returnEx", "=", "currentEx", ";", "if", "(", "returnEx", "==", ...
Combines the two exception collections and if either are fatal, throw an MojoExecutionException @param currentEx the primary exception collection @param newEx the new exception collection to add @return the combined exception collection @throws MojoExecutionException thrown if dependency-check is configured to fail on...
[ "Combines", "the", "two", "exception", "collections", "and", "if", "either", "are", "fatal", "throw", "an", "MojoExecutionException" ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L1374-L1400
17,714
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.getOutputName
@Override public String getOutputName() { if ("HTML".equalsIgnoreCase(this.format) || "ALL".equalsIgnoreCase(this.format)) { return "dependency-check-report"; } else if ("XML".equalsIgnoreCase(this.format)) { return "dependency-check-report.xml"; } else if ("JUNIT".eq...
java
@Override public String getOutputName() { if ("HTML".equalsIgnoreCase(this.format) || "ALL".equalsIgnoreCase(this.format)) { return "dependency-check-report"; } else if ("XML".equalsIgnoreCase(this.format)) { return "dependency-check-report.xml"; } else if ("JUNIT".eq...
[ "@", "Override", "public", "String", "getOutputName", "(", ")", "{", "if", "(", "\"HTML\"", ".", "equalsIgnoreCase", "(", "this", ".", "format", ")", "||", "\"ALL\"", ".", "equalsIgnoreCase", "(", "this", ".", "format", ")", ")", "{", "return", "\"dependen...
Returns the output name. @return the output name
[ "Returns", "the", "output", "name", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L1456-L1472
17,715
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.decryptServerPassword
private String decryptServerPassword(Server server) throws SecDispatcherException { //CSOFF: LineLength //The following fix was copied from: // https://github.com/bsorrentino/maven-confluence-plugin/blob/master/maven-confluence-reporting-plugin/src/main/java/org/bsc/maven/confluence/plugin/Abs...
java
private String decryptServerPassword(Server server) throws SecDispatcherException { //CSOFF: LineLength //The following fix was copied from: // https://github.com/bsorrentino/maven-confluence-plugin/blob/master/maven-confluence-reporting-plugin/src/main/java/org/bsc/maven/confluence/plugin/Abs...
[ "private", "String", "decryptServerPassword", "(", "Server", "server", ")", "throws", "SecDispatcherException", "{", "//CSOFF: LineLength", "//The following fix was copied from:", "// https://github.com/bsorrentino/maven-confluence-plugin/blob/master/maven-confluence-reporting-plugin/src/m...
Obtains the configured password for the given server. @param server the configured server from the settings.xml @return the decrypted password from the Maven configuration @throws SecDispatcherException thrown if there is an error decrypting the password
[ "Obtains", "the", "configured", "password", "for", "the", "given", "server", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L1688-L1703
17,716
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.determineSuppressions
private String[] determineSuppressions() { String[] suppressions = suppressionFiles; if (suppressionFile != null) { if (suppressions == null) { suppressions = new String[]{suppressionFile}; } else { suppressions = Arrays.copyOf(suppressions, suppre...
java
private String[] determineSuppressions() { String[] suppressions = suppressionFiles; if (suppressionFile != null) { if (suppressions == null) { suppressions = new String[]{suppressionFile}; } else { suppressions = Arrays.copyOf(suppressions, suppre...
[ "private", "String", "[", "]", "determineSuppressions", "(", ")", "{", "String", "[", "]", "suppressions", "=", "suppressionFiles", ";", "if", "(", "suppressionFile", "!=", "null", ")", "{", "if", "(", "suppressions", "==", "null", ")", "{", "suppressions", ...
Combines the configured suppressionFile and suppressionFiles into a single array. @return an array of suppression file paths
[ "Combines", "the", "configured", "suppressionFile", "and", "suppressionFiles", "into", "a", "single", "array", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L1711-L1722
17,717
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java
BaseDependencyCheckMojo.getMavenProxy
private Proxy getMavenProxy() { if (mavenSettings != null) { final List<Proxy> proxies = mavenSettings.getProxies(); if (proxies != null && !proxies.isEmpty()) { if (mavenSettingsProxyId != null) { for (Proxy proxy : proxies) { ...
java
private Proxy getMavenProxy() { if (mavenSettings != null) { final List<Proxy> proxies = mavenSettings.getProxies(); if (proxies != null && !proxies.isEmpty()) { if (mavenSettingsProxyId != null) { for (Proxy proxy : proxies) { ...
[ "private", "Proxy", "getMavenProxy", "(", ")", "{", "if", "(", "mavenSettings", "!=", "null", ")", "{", "final", "List", "<", "Proxy", ">", "proxies", "=", "mavenSettings", ".", "getProxies", "(", ")", ";", "if", "(", "proxies", "!=", "null", "&&", "!"...
Returns the maven proxy. @return the maven proxy
[ "Returns", "the", "maven", "proxy", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/BaseDependencyCheckMojo.java#L1729-L1749
17,718
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java
CveDB.determineEcosystem
private String determineEcosystem(String baseEcosystem, String vendor, String product, String targetSw) { if ("ibm".equals(vendor) && "java".equals(product)) { return "c/c++"; } if ("oracle".equals(vendor) && "vm".equals(product)) { return "c/c++"; } if ("...
java
private String determineEcosystem(String baseEcosystem, String vendor, String product, String targetSw) { if ("ibm".equals(vendor) && "java".equals(product)) { return "c/c++"; } if ("oracle".equals(vendor) && "vm".equals(product)) { return "c/c++"; } if ("...
[ "private", "String", "determineEcosystem", "(", "String", "baseEcosystem", ",", "String", "vendor", ",", "String", "product", ",", "String", "targetSw", ")", "{", "if", "(", "\"ibm\"", ".", "equals", "(", "vendor", ")", "&&", "\"java\"", ".", "equals", "(", ...
Attempts to determine the ecosystem based on the vendor, product and targetSw. @param baseEcosystem the base ecosystem @param vendor the vendor @param product the product @param targetSw the target software @return the ecosystem if one is identified
[ "Attempts", "to", "determine", "the", "ecosystem", "based", "on", "the", "vendor", "product", "and", "targetSw", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java#L222-L233
17,719
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java
CveDB.determineDatabaseProductName
private String determineDatabaseProductName(Connection conn) { try { final String databaseProductName = conn.getMetaData().getDatabaseProductName().toLowerCase(); LOGGER.debug("Database product: {}", databaseProductName); return databaseProductName; } catch (SQLExcept...
java
private String determineDatabaseProductName(Connection conn) { try { final String databaseProductName = conn.getMetaData().getDatabaseProductName().toLowerCase(); LOGGER.debug("Database product: {}", databaseProductName); return databaseProductName; } catch (SQLExcept...
[ "private", "String", "determineDatabaseProductName", "(", "Connection", "conn", ")", "{", "try", "{", "final", "String", "databaseProductName", "=", "conn", ".", "getMetaData", "(", ")", ".", "getDatabaseProductName", "(", ")", ".", "toLowerCase", "(", ")", ";",...
Tries to determine the product name of the database. @param conn the database connection @return the product name of the database if successful, {@code null} else
[ "Tries", "to", "determine", "the", "product", "name", "of", "the", "database", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java#L367-L376
17,720
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java
CveDB.open
private synchronized void open() throws DatabaseException { try { if (!isOpen()) { connection = connectionFactory.getConnection(); final String databaseProductName = determineDatabaseProductName(this.connection); statementBundle = databaseProductName !...
java
private synchronized void open() throws DatabaseException { try { if (!isOpen()) { connection = connectionFactory.getConnection(); final String databaseProductName = determineDatabaseProductName(this.connection); statementBundle = databaseProductName !...
[ "private", "synchronized", "void", "open", "(", ")", "throws", "DatabaseException", "{", "try", "{", "if", "(", "!", "isOpen", "(", ")", ")", "{", "connection", "=", "connectionFactory", ".", "getConnection", "(", ")", ";", "final", "String", "databaseProduc...
Opens the database connection. If the database does not exist, it will create a new one. @throws DatabaseException thrown if there is an error opening the database connection
[ "Opens", "the", "database", "connection", ".", "If", "the", "database", "does", "not", "exist", "it", "will", "create", "a", "new", "one", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java#L385-L400
17,721
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java
CveDB.close
@Override public synchronized void close() { if (isOpen()) { clearCache(); closeStatements(); try { connection.close(); } catch (SQLException ex) { LOGGER.error("There was an error attempting to close the CveDB, see the log for ...
java
@Override public synchronized void close() { if (isOpen()) { clearCache(); closeStatements(); try { connection.close(); } catch (SQLException ex) { LOGGER.error("There was an error attempting to close the CveDB, see the log for ...
[ "@", "Override", "public", "synchronized", "void", "close", "(", ")", "{", "if", "(", "isOpen", "(", ")", ")", "{", "clearCache", "(", ")", ";", "closeStatements", "(", ")", ";", "try", "{", "connection", ".", "close", "(", ")", ";", "}", "catch", ...
Closes the database connection. Close should be called on this object when it is done being used.
[ "Closes", "the", "database", "connection", ".", "Close", "should", "be", "called", "on", "this", "object", "when", "it", "is", "done", "being", "used", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java#L406-L423
17,722
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java
CveDB.prepareStatements
private void prepareStatements() throws DatabaseException { for (PreparedStatementCveDb key : values()) { PreparedStatement preparedStatement = null; try { final String statementString = statementBundle.getString(key.name()); if (key == INSERT_VULNERABILIT...
java
private void prepareStatements() throws DatabaseException { for (PreparedStatementCveDb key : values()) { PreparedStatement preparedStatement = null; try { final String statementString = statementBundle.getString(key.name()); if (key == INSERT_VULNERABILIT...
[ "private", "void", "prepareStatements", "(", ")", "throws", "DatabaseException", "{", "for", "(", "PreparedStatementCveDb", "key", ":", "values", "(", ")", ")", "{", "PreparedStatement", "preparedStatement", "=", "null", ";", "try", "{", "final", "String", "stat...
Prepares all statements to be used. @throws DatabaseException thrown if there is an error preparing the statements
[ "Prepares", "all", "statements", "to", "be", "used", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java#L450-L471
17,723
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java
CveDB.prepareStatement
private PreparedStatement prepareStatement(PreparedStatementCveDb key) throws DatabaseException { PreparedStatement preparedStatement = null; try { final String statementString = statementBundle.getString(key.name()); if (key == INSERT_VULNERABILITY || key == INSERT_CPE) { ...
java
private PreparedStatement prepareStatement(PreparedStatementCveDb key) throws DatabaseException { PreparedStatement preparedStatement = null; try { final String statementString = statementBundle.getString(key.name()); if (key == INSERT_VULNERABILITY || key == INSERT_CPE) { ...
[ "private", "PreparedStatement", "prepareStatement", "(", "PreparedStatementCveDb", "key", ")", "throws", "DatabaseException", "{", "PreparedStatement", "preparedStatement", "=", "null", ";", "try", "{", "final", "String", "statementString", "=", "statementBundle", ".", ...
Creates a prepared statement from the given key. The SQL is stored in a properties file and the key is used to lookup the specific query. @param key the key to select the prepared statement from the properties file @return the prepared statement @throws DatabaseException throw if there is an error generating the prepa...
[ "Creates", "a", "prepared", "statement", "from", "the", "given", "key", ".", "The", "SQL", "is", "stored", "in", "a", "properties", "file", "and", "the", "key", "is", "used", "to", "lookup", "the", "specific", "query", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java#L483-L500
17,724
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java
ArtifactorySearch.connect
private HttpURLConnection connect(URL url) throws IOException { LOGGER.debug("Searching Artifactory url {}", url); // Determine if we need to use a proxy. The rules: // 1) If the proxy is set, AND the setting is set to true, use the proxy // 2) Otherwise, don't use the proxy (either the...
java
private HttpURLConnection connect(URL url) throws IOException { LOGGER.debug("Searching Artifactory url {}", url); // Determine if we need to use a proxy. The rules: // 1) If the proxy is set, AND the setting is set to true, use the proxy // 2) Otherwise, don't use the proxy (either the...
[ "private", "HttpURLConnection", "connect", "(", "URL", "url", ")", "throws", "IOException", "{", "LOGGER", ".", "debug", "(", "\"Searching Artifactory url {}\"", ",", "url", ")", ";", "// Determine if we need to use a proxy. The rules:", "// 1) If the proxy is set, AND the se...
Makes an connection to the given URL. @param url the URL to connect to @return the HTTP URL Connection @throws IOException thrown if there is an error making the connection
[ "Makes", "an", "connection", "to", "the", "given", "URL", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java#L145-L173
17,725
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java
ArtifactorySearch.processResponse
protected List<MavenArtifact> processResponse(Dependency dependency, HttpURLConnection conn) throws IOException { final JsonObject asJsonObject; try (final InputStreamReader streamReader = new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)) { asJsonObject = new JsonParser()...
java
protected List<MavenArtifact> processResponse(Dependency dependency, HttpURLConnection conn) throws IOException { final JsonObject asJsonObject; try (final InputStreamReader streamReader = new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8)) { asJsonObject = new JsonParser()...
[ "protected", "List", "<", "MavenArtifact", ">", "processResponse", "(", "Dependency", "dependency", ",", "HttpURLConnection", "conn", ")", "throws", "IOException", "{", "final", "JsonObject", "asJsonObject", ";", "try", "(", "final", "InputStreamReader", "streamReader...
Process the Artifactory response. @param dependency the dependency @param conn the HTTP URL Connection @return a list of the Maven Artifact information @throws IOException thrown if there is an I/O error
[ "Process", "the", "Artifactory", "response", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java#L196-L234
17,726
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java
ArtifactorySearch.checkHashes
private void checkHashes(Dependency dependency, String sha1, String sha256, String md5) throws FileNotFoundException { final String md5sum = dependency.getMd5sum(); if (!md5.equals(md5sum)) { throw new FileNotFoundException("Artifact found by API is not matching the md5 " ...
java
private void checkHashes(Dependency dependency, String sha1, String sha256, String md5) throws FileNotFoundException { final String md5sum = dependency.getMd5sum(); if (!md5.equals(md5sum)) { throw new FileNotFoundException("Artifact found by API is not matching the md5 " ...
[ "private", "void", "checkHashes", "(", "Dependency", "dependency", ",", "String", "sha1", ",", "String", "sha256", ",", "String", "md5", ")", "throws", "FileNotFoundException", "{", "final", "String", "md5sum", "=", "dependency", ".", "getMd5sum", "(", ")", ";...
Validates the hashes of the dependency. @param dependency the dependency @param sha1 the SHA1 checksum @param sha256 the SHA256 checksum @param md5 the MD5 checksum @throws FileNotFoundException thrown if one of the checksums does not match
[ "Validates", "the", "hashes", "of", "the", "dependency", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java#L246-L262
17,727
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java
ArtifactorySearch.preflightRequest
public boolean preflightRequest() { try { final URL url = buildUrl(Checksum.getSHA1Checksum(UUID.randomUUID().toString())); final HttpURLConnection connection = connect(url); if (connection.getResponseCode() != 200) { LOGGER.warn("Expected 200 result from Arti...
java
public boolean preflightRequest() { try { final URL url = buildUrl(Checksum.getSHA1Checksum(UUID.randomUUID().toString())); final HttpURLConnection connection = connect(url); if (connection.getResponseCode() != 200) { LOGGER.warn("Expected 200 result from Arti...
[ "public", "boolean", "preflightRequest", "(", ")", "{", "try", "{", "final", "URL", "url", "=", "buildUrl", "(", "Checksum", ".", "getSHA1Checksum", "(", "UUID", ".", "randomUUID", "(", ")", ".", "toString", "(", ")", ")", ")", ";", "final", "HttpURLConn...
Performs a pre-flight request to ensure the Artifactory service is reachable. @return <code>true</code> if Artifactory could be reached; otherwise <code>false</code>.
[ "Performs", "a", "pre", "-", "flight", "request", "to", "ensure", "the", "Artifactory", "service", "is", "reachable", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/artifactory/ArtifactorySearch.java#L271-L285
17,728
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/assembly/GrokParser.java
GrokParser.parse
@SuppressFBWarnings(justification = "try with resources will clean up the input stream", value = {"OBL_UNSATISFIED_OBLIGATION"}) public AssemblyData parse(File file) throws GrokParseException { try (FileInputStream fis = new FileInputStream(file)) { return parse(fis); } catch (IOExceptio...
java
@SuppressFBWarnings(justification = "try with resources will clean up the input stream", value = {"OBL_UNSATISFIED_OBLIGATION"}) public AssemblyData parse(File file) throws GrokParseException { try (FileInputStream fis = new FileInputStream(file)) { return parse(fis); } catch (IOExceptio...
[ "@", "SuppressFBWarnings", "(", "justification", "=", "\"try with resources will clean up the input stream\"", ",", "value", "=", "{", "\"OBL_UNSATISFIED_OBLIGATION\"", "}", ")", "public", "AssemblyData", "parse", "(", "File", "file", ")", "throws", "GrokParseException", ...
Parses the given XML file and returns the assembly data. @param file an XML file containing assembly data @return the assembly data @throws GrokParseException thrown if the XML file cannot be parsed
[ "Parses", "the", "given", "XML", "file", "and", "returns", "the", "assembly", "data", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/assembly/GrokParser.java#L66-L74
17,729
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/assembly/GrokParser.java
GrokParser.parse
public AssemblyData parse(InputStream inputStream) throws GrokParseException { try (InputStream schema = FileUtils.getResourceAsStream(GROK_SCHEMA)) { final GrokHandler handler = new GrokHandler(); final SAXParser saxParser = XmlUtils.buildSecureSaxParser(schema); final XMLRe...
java
public AssemblyData parse(InputStream inputStream) throws GrokParseException { try (InputStream schema = FileUtils.getResourceAsStream(GROK_SCHEMA)) { final GrokHandler handler = new GrokHandler(); final SAXParser saxParser = XmlUtils.buildSecureSaxParser(schema); final XMLRe...
[ "public", "AssemblyData", "parse", "(", "InputStream", "inputStream", ")", "throws", "GrokParseException", "{", "try", "(", "InputStream", "schema", "=", "FileUtils", ".", "getResourceAsStream", "(", "GROK_SCHEMA", ")", ")", "{", "final", "GrokHandler", "handler", ...
Parses the given XML stream and returns the contained assembly data. @param inputStream an InputStream containing assembly data @return the assembly data @throws GrokParseException thrown if the XML cannot be parsed
[ "Parses", "the", "given", "XML", "stream", "and", "returns", "the", "contained", "assembly", "data", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/assembly/GrokParser.java#L83-L109
17,730
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/UpdateMojo.java
UpdateMojo.runCheck
@Override protected void runCheck() throws MojoExecutionException, MojoFailureException { try (Engine engine = initializeEngine()) { try { if (!engine.getSettings().getBoolean(Settings.KEYS.AUTO_UPDATE)) { engine.getSettings().setBoolean(Settings.KEYS.AUTO_UPD...
java
@Override protected void runCheck() throws MojoExecutionException, MojoFailureException { try (Engine engine = initializeEngine()) { try { if (!engine.getSettings().getBoolean(Settings.KEYS.AUTO_UPDATE)) { engine.getSettings().setBoolean(Settings.KEYS.AUTO_UPD...
[ "@", "Override", "protected", "void", "runCheck", "(", ")", "throws", "MojoExecutionException", ",", "MojoFailureException", "{", "try", "(", "Engine", "engine", "=", "initializeEngine", "(", ")", ")", "{", "try", "{", "if", "(", "!", "engine", ".", "getSett...
Executes the dependency-check engine on the project's dependencies and generates the report. @throws MojoExecutionException thrown if there is an exception executing the goal @throws MojoFailureException thrown if dependency-check is configured to fail the build
[ "Executes", "the", "dependency", "-", "check", "engine", "on", "the", "project", "s", "dependencies", "and", "generates", "the", "report", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/UpdateMojo.java#L68-L95
17,731
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractNpmAnalyzer.java
AbstractNpmAnalyzer.createDependency
protected Dependency createDependency(Dependency dependency, String name, String version, String scope) { final Dependency nodeModule = new Dependency(new File(dependency.getActualFile() + "?" + name), true); nodeModule.setEcosystem(NPM_DEPENDENCY_ECOSYSTEM); //this is virtual - the sha1 is pure...
java
protected Dependency createDependency(Dependency dependency, String name, String version, String scope) { final Dependency nodeModule = new Dependency(new File(dependency.getActualFile() + "?" + name), true); nodeModule.setEcosystem(NPM_DEPENDENCY_ECOSYSTEM); //this is virtual - the sha1 is pure...
[ "protected", "Dependency", "createDependency", "(", "Dependency", "dependency", ",", "String", "name", ",", "String", "version", ",", "String", "scope", ")", "{", "final", "Dependency", "nodeModule", "=", "new", "Dependency", "(", "new", "File", "(", "dependency...
Construct a dependency object. @param dependency the parent dependency @param name the name of the dependency to create @param version the version of the dependency to create @param scope the scope of the dependency being created @return the generated dependency
[ "Construct", "a", "dependency", "object", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractNpmAnalyzer.java#L127-L160
17,732
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/pom/PomUtils.java
PomUtils.readPom
public static Model readPom(File file) throws AnalysisException { //noinspection CaughtExceptionImmediatelyRethrown try { final PomParser parser = new PomParser(); final Model model = parser.parse(file); if (model == null) { throw new AnalysisException...
java
public static Model readPom(File file) throws AnalysisException { //noinspection CaughtExceptionImmediatelyRethrown try { final PomParser parser = new PomParser(); final Model model = parser.parse(file); if (model == null) { throw new AnalysisException...
[ "public", "static", "Model", "readPom", "(", "File", "file", ")", "throws", "AnalysisException", "{", "//noinspection CaughtExceptionImmediatelyRethrown", "try", "{", "final", "PomParser", "parser", "=", "new", "PomParser", "(", ")", ";", "final", "Model", "model", ...
Reads in the specified POM and converts it to a Model. @param file the pom.xml file @return returns an object representation of the POM @throws AnalysisException is thrown if there is an exception extracting or parsing the POM {@link Model} object
[ "Reads", "in", "the", "specified", "POM", "and", "converts", "it", "to", "a", "Model", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/pom/PomUtils.java#L59-L89
17,733
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/pom/PomUtils.java
PomUtils.readPom
public static Model readPom(String path, JarFile jar) throws AnalysisException { final ZipEntry entry = jar.getEntry(path); Model model = null; if (entry != null) { //should never be null //noinspection CaughtExceptionImmediatelyRethrown try { final PomPar...
java
public static Model readPom(String path, JarFile jar) throws AnalysisException { final ZipEntry entry = jar.getEntry(path); Model model = null; if (entry != null) { //should never be null //noinspection CaughtExceptionImmediatelyRethrown try { final PomPar...
[ "public", "static", "Model", "readPom", "(", "String", "path", ",", "JarFile", "jar", ")", "throws", "AnalysisException", "{", "final", "ZipEntry", "entry", "=", "jar", ".", "getEntry", "(", "path", ")", ";", "Model", "model", "=", "null", ";", "if", "("...
Retrieves the specified POM from a jar file and converts it to a Model. @param path the path to the pom.xml file within the jar file @param jar the jar file to extract the pom from @return returns an object representation of the POM @throws AnalysisException is thrown if there is an exception extracting or parsing the...
[ "Retrieves", "the", "specified", "POM", "from", "a", "jar", "file", "and", "converts", "it", "to", "a", "Model", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/pom/PomUtils.java#L100-L128
17,734
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/pom/PomUtils.java
PomUtils.analyzePOM
public static void analyzePOM(Dependency dependency, File pomFile) throws AnalysisException { final Model pom = PomUtils.readPom(pomFile); JarAnalyzer.setPomEvidence(dependency, pom, null, true); }
java
public static void analyzePOM(Dependency dependency, File pomFile) throws AnalysisException { final Model pom = PomUtils.readPom(pomFile); JarAnalyzer.setPomEvidence(dependency, pom, null, true); }
[ "public", "static", "void", "analyzePOM", "(", "Dependency", "dependency", ",", "File", "pomFile", ")", "throws", "AnalysisException", "{", "final", "Model", "pom", "=", "PomUtils", ".", "readPom", "(", "pomFile", ")", ";", "JarAnalyzer", ".", "setPomEvidence", ...
Reads in the pom file and adds elements as evidence to the given dependency. @param dependency the dependency being analyzed @param pomFile the pom file to read @throws AnalysisException is thrown if there is an exception parsing the pom
[ "Reads", "in", "the", "pom", "file", "and", "adds", "elements", "as", "evidence", "to", "the", "given", "dependency", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/pom/PomUtils.java#L139-L142
17,735
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java
AbstractSuppressionAnalyzer.prepareAnalyzer
@Override public synchronized void prepareAnalyzer(Engine engine) throws InitializationException { if (rules.isEmpty()) { try { loadSuppressionBaseData(); } catch (SuppressionParseException ex) { throw new InitializationException("Error initializing th...
java
@Override public synchronized void prepareAnalyzer(Engine engine) throws InitializationException { if (rules.isEmpty()) { try { loadSuppressionBaseData(); } catch (SuppressionParseException ex) { throw new InitializationException("Error initializing th...
[ "@", "Override", "public", "synchronized", "void", "prepareAnalyzer", "(", "Engine", "engine", ")", "throws", "InitializationException", "{", "if", "(", "rules", ".", "isEmpty", "(", ")", ")", "{", "try", "{", "loadSuppressionBaseData", "(", ")", ";", "}", "...
The prepare method loads the suppression XML file. @param engine a reference the dependency-check engine @throws InitializationException thrown if there is an exception
[ "The", "prepare", "method", "loads", "the", "suppression", "XML", "file", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/AbstractSuppressionAnalyzer.java#L91-L106
17,736
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nvdcve/DriverLoader.java
DriverLoader.cleanup
public static void cleanup(Driver driver) { try { DriverManager.deregisterDriver(driver); } catch (SQLException ex) { LOGGER.debug("An error occurred unloading the database driver", ex); } catch (Throwable unexpected) { LOGGER.debug("An unexpected throwable oc...
java
public static void cleanup(Driver driver) { try { DriverManager.deregisterDriver(driver); } catch (SQLException ex) { LOGGER.debug("An error occurred unloading the database driver", ex); } catch (Throwable unexpected) { LOGGER.debug("An unexpected throwable oc...
[ "public", "static", "void", "cleanup", "(", "Driver", "driver", ")", "{", "try", "{", "DriverManager", ".", "deregisterDriver", "(", "driver", ")", ";", "}", "catch", "(", "SQLException", "ex", ")", "{", "LOGGER", ".", "debug", "(", "\"An error occurred unlo...
De-registers the driver. @param driver the driver to de-register
[ "De", "-", "registers", "the", "driver", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/DriverLoader.java#L55-L63
17,737
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nvdcve/DriverLoader.java
DriverLoader.load
public static Driver load(String className) throws DriverLoadException { final ClassLoader loader = DriverLoader.class.getClassLoader(); return load(className, loader); }
java
public static Driver load(String className) throws DriverLoadException { final ClassLoader loader = DriverLoader.class.getClassLoader(); return load(className, loader); }
[ "public", "static", "Driver", "load", "(", "String", "className", ")", "throws", "DriverLoadException", "{", "final", "ClassLoader", "loader", "=", "DriverLoader", ".", "class", ".", "getClassLoader", "(", ")", ";", "return", "load", "(", "className", ",", "lo...
Loads the specified class using the system class loader and registers the driver with the driver manager. @param className the fully qualified name of the desired class @return the loaded Driver @throws DriverLoadException thrown if the driver cannot be loaded
[ "Loads", "the", "specified", "class", "using", "the", "system", "class", "loader", "and", "registers", "the", "driver", "with", "the", "driver", "manager", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/DriverLoader.java#L79-L82
17,738
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nvdcve/DriverLoader.java
DriverLoader.load
@SuppressWarnings("StringSplitter") public static Driver load(String className, String pathToDriver) throws DriverLoadException { final ClassLoader parent = ClassLoader.getSystemClassLoader(); final List<URL> urls = new ArrayList<>(); final String[] paths = pathToDriver.split(File.pathSepara...
java
@SuppressWarnings("StringSplitter") public static Driver load(String className, String pathToDriver) throws DriverLoadException { final ClassLoader parent = ClassLoader.getSystemClassLoader(); final List<URL> urls = new ArrayList<>(); final String[] paths = pathToDriver.split(File.pathSepara...
[ "@", "SuppressWarnings", "(", "\"StringSplitter\"", ")", "public", "static", "Driver", "load", "(", "String", "className", ",", "String", "pathToDriver", ")", "throws", "DriverLoadException", "{", "final", "ClassLoader", "parent", "=", "ClassLoader", ".", "getSystem...
Loads the specified class by registering the supplied paths to the class loader and then registers the driver with the driver manager. The pathToDriver argument is added to the class loader so that an external driver can be loaded. Note, the pathToDriver can contain a semi-colon separated list of paths so any dependenc...
[ "Loads", "the", "specified", "class", "by", "registering", "the", "supplied", "paths", "to", "the", "class", "loader", "and", "then", "registers", "the", "driver", "with", "the", "driver", "manager", ".", "The", "pathToDriver", "argument", "is", "added", "to",...
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/DriverLoader.java#L99-L137
17,739
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nvdcve/DriverLoader.java
DriverLoader.load
private static Driver load(String className, ClassLoader loader) throws DriverLoadException { try { final Class<?> c = Class.forName(className, true, loader); //final Class c = loader.loadClass(className); final Driver driver = (Driver) c.getDeclaredConstructor().newInstance(...
java
private static Driver load(String className, ClassLoader loader) throws DriverLoadException { try { final Class<?> c = Class.forName(className, true, loader); //final Class c = loader.loadClass(className); final Driver driver = (Driver) c.getDeclaredConstructor().newInstance(...
[ "private", "static", "Driver", "load", "(", "String", "className", ",", "ClassLoader", "loader", ")", "throws", "DriverLoadException", "{", "try", "{", "final", "Class", "<", "?", ">", "c", "=", "Class", ".", "forName", "(", "className", ",", "true", ",", ...
Loads the specified class using the supplied class loader and registers the driver with the driver manager. @param className the fully qualified name of the desired class @param loader the class loader to use when loading the driver @return the loaded Driver @throws DriverLoadException thrown if the driver cannot be l...
[ "Loads", "the", "specified", "class", "using", "the", "supplied", "class", "loader", "and", "registers", "the", "driver", "with", "the", "driver", "manager", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/DriverLoader.java#L148-L165
17,740
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java
ReportGenerator.createContext
private VelocityContext createContext(String applicationName, List<Dependency> dependencies, List<Analyzer> analyzers, DatabaseProperties properties) { final DateTime dt = new DateTime(); final DateTimeFormatter dateFormat = DateTimeFormat.forPattern("MMM d, yyyy 'at' HH:mm:ss z"); f...
java
private VelocityContext createContext(String applicationName, List<Dependency> dependencies, List<Analyzer> analyzers, DatabaseProperties properties) { final DateTime dt = new DateTime(); final DateTimeFormatter dateFormat = DateTimeFormat.forPattern("MMM d, yyyy 'at' HH:mm:ss z"); f...
[ "private", "VelocityContext", "createContext", "(", "String", "applicationName", ",", "List", "<", "Dependency", ">", "dependencies", ",", "List", "<", "Analyzer", ">", "analyzers", ",", "DatabaseProperties", "properties", ")", "{", "final", "DateTime", "dt", "=",...
Constructs the velocity context used to generate the dependency-check reports. @param applicationName the application name being analyzed @param dependencies the list of dependencies @param analyzers the list of analyzers used @param properties the database properties (containing timestamps of the NVD CVE data) @retur...
[ "Constructs", "the", "velocity", "context", "used", "to", "generate", "the", "dependency", "-", "check", "reports", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java#L183-L207
17,741
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java
ReportGenerator.write
public void write(String outputLocation, String format) throws ReportException { Format reportFormat = null; try { reportFormat = Format.valueOf(format.toUpperCase()); } catch (IllegalArgumentException ex) { LOGGER.trace("ignore this exception", ex); } if...
java
public void write(String outputLocation, String format) throws ReportException { Format reportFormat = null; try { reportFormat = Format.valueOf(format.toUpperCase()); } catch (IllegalArgumentException ex) { LOGGER.trace("ignore this exception", ex); } if...
[ "public", "void", "write", "(", "String", "outputLocation", ",", "String", "format", ")", "throws", "ReportException", "{", "Format", "reportFormat", "=", "null", ";", "try", "{", "reportFormat", "=", "Format", ".", "valueOf", "(", "format", ".", "toUpperCase"...
Writes the dependency-check report to the given output location. @param outputLocation the path where the reports should be written @param format the format the report should be written in (XML, HTML, JSON, CSV, ALL) or even the path to a custom velocity template (either fully qualified or the template name on the cla...
[ "Writes", "the", "dependency", "-", "check", "report", "to", "the", "given", "output", "location", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java#L219-L237
17,742
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java
ReportGenerator.getReportFile
protected File getReportFile(String outputLocation, Format format) { File outFile = new File(outputLocation); if (outFile.getParentFile() == null) { outFile = new File(".", outputLocation); } final String pathToCheck = outputLocation.toLowerCase(); if (format == Forma...
java
protected File getReportFile(String outputLocation, Format format) { File outFile = new File(outputLocation); if (outFile.getParentFile() == null) { outFile = new File(".", outputLocation); } final String pathToCheck = outputLocation.toLowerCase(); if (format == Forma...
[ "protected", "File", "getReportFile", "(", "String", "outputLocation", ",", "Format", "format", ")", "{", "File", "outFile", "=", "new", "File", "(", "outputLocation", ")", ";", "if", "(", "outFile", ".", "getParentFile", "(", ")", "==", "null", ")", "{", ...
Determines the report file name based on the give output location and format. If the output location contains a full file name that has the correct extension for the given report type then the output location is returned. However, if the output location is a directory, this method will generate the correct name for the...
[ "Determines", "the", "report", "file", "name", "based", "on", "the", "give", "output", "location", "and", "format", ".", "If", "the", "output", "location", "contains", "a", "full", "file", "name", "that", "has", "the", "correct", "extension", "for", "the", ...
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java#L275-L297
17,743
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java
ReportGenerator.ensureParentDirectoryExists
private void ensureParentDirectoryExists(File file) throws ReportException { if (!file.getParentFile().exists()) { final boolean created = file.getParentFile().mkdirs(); if (!created) { final String msg = String.format("Unable to create directory '%s'.", file.getParentFil...
java
private void ensureParentDirectoryExists(File file) throws ReportException { if (!file.getParentFile().exists()) { final boolean created = file.getParentFile().mkdirs(); if (!created) { final String msg = String.format("Unable to create directory '%s'.", file.getParentFil...
[ "private", "void", "ensureParentDirectoryExists", "(", "File", "file", ")", "throws", "ReportException", "{", "if", "(", "!", "file", ".", "getParentFile", "(", ")", ".", "exists", "(", ")", ")", "{", "final", "boolean", "created", "=", "file", ".", "getPa...
Validates that the given file's parent directory exists. If the directory does not exist an attempt to create the necessary path is made; if that fails a ReportException will be raised. @param file the file or directory directory @throws ReportException thrown if the parent directory does not exist and cannot be creat...
[ "Validates", "that", "the", "given", "file", "s", "parent", "directory", "exists", ".", "If", "the", "directory", "does", "not", "exist", "an", "attempt", "to", "create", "the", "necessary", "path", "is", "made", ";", "if", "that", "fails", "a", "ReportExc...
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java#L384-L392
17,744
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java
ReportGenerator.pretifyJson
private void pretifyJson(String pathToJson) throws ReportException { final String outputPath = pathToJson + ".pretty"; final File in = new File(pathToJson); final File out = new File(outputPath); try (JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(in), Stand...
java
private void pretifyJson(String pathToJson) throws ReportException { final String outputPath = pathToJson + ".pretty"; final File in = new File(pathToJson); final File out = new File(outputPath); try (JsonReader reader = new JsonReader(new InputStreamReader(new FileInputStream(in), Stand...
[ "private", "void", "pretifyJson", "(", "String", "pathToJson", ")", "throws", "ReportException", "{", "final", "String", "outputPath", "=", "pathToJson", "+", "\".pretty\"", ";", "final", "File", "in", "=", "new", "File", "(", "pathToJson", ")", ";", "final", ...
Reformats the given JSON file. @param pathToJson the path to the JSON file to be reformatted @throws ReportException thrown if the given JSON file is malformed
[ "Reformats", "the", "given", "JSON", "file", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java#L400-L418
17,745
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java
ReportGenerator.prettyPrint
private static void prettyPrint(JsonReader reader, JsonWriter writer) throws IOException { writer.setIndent(" "); while (true) { final JsonToken token = reader.peek(); switch (token) { case BEGIN_ARRAY: reader.beginArray(); ...
java
private static void prettyPrint(JsonReader reader, JsonWriter writer) throws IOException { writer.setIndent(" "); while (true) { final JsonToken token = reader.peek(); switch (token) { case BEGIN_ARRAY: reader.beginArray(); ...
[ "private", "static", "void", "prettyPrint", "(", "JsonReader", "reader", ",", "JsonWriter", "writer", ")", "throws", "IOException", "{", "writer", ".", "setIndent", "(", "\" \"", ")", ";", "while", "(", "true", ")", "{", "final", "JsonToken", "token", "=", ...
Streams from a json reader to a json writer and performs pretty printing. This function is copied from https://sites.google.com/site/gson/streaming @param reader json reader @param writer json writer @throws IOException thrown if the json is malformed
[ "Streams", "from", "a", "json", "reader", "to", "a", "json", "writer", "and", "performs", "pretty", "printing", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/reporting/ReportGenerator.java#L429-L477
17,746
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java
RubyBundleAuditAnalyzer.launchBundleAudit
private Process launchBundleAudit(File folder) throws AnalysisException { if (!folder.isDirectory()) { throw new AnalysisException(String.format("%s should have been a directory.", folder.getAbsolutePath())); } final List<String> args = new ArrayList<>(); final String bundleA...
java
private Process launchBundleAudit(File folder) throws AnalysisException { if (!folder.isDirectory()) { throw new AnalysisException(String.format("%s should have been a directory.", folder.getAbsolutePath())); } final List<String> args = new ArrayList<>(); final String bundleA...
[ "private", "Process", "launchBundleAudit", "(", "File", "folder", ")", "throws", "AnalysisException", "{", "if", "(", "!", "folder", ".", "isDirectory", "(", ")", ")", "{", "throw", "new", "AnalysisException", "(", "String", ".", "format", "(", "\"%s should ha...
Launch bundle-audit. @param folder directory that contains bundle audit @return a handle to the process @throws AnalysisException thrown when there is an issue launching bundle audit
[ "Launch", "bundle", "-", "audit", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java#L138-L164
17,747
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java
RubyBundleAuditAnalyzer.prepareFileTypeAnalyzer
@Override public void prepareFileTypeAnalyzer(Engine engine) throws InitializationException { // Now, need to see if bundle-audit actually runs from this location. if (engine != null) { this.cvedb = engine.getDatabase(); } Process process = null; try { ...
java
@Override public void prepareFileTypeAnalyzer(Engine engine) throws InitializationException { // Now, need to see if bundle-audit actually runs from this location. if (engine != null) { this.cvedb = engine.getDatabase(); } Process process = null; try { ...
[ "@", "Override", "public", "void", "prepareFileTypeAnalyzer", "(", "Engine", "engine", ")", "throws", "InitializationException", "{", "// Now, need to see if bundle-audit actually runs from this location.", "if", "(", "engine", "!=", "null", ")", "{", "this", ".", "cvedb"...
Initialize the analyzer. @param engine a reference to the dependency-check engine @throws InitializationException if anything goes wrong
[ "Initialize", "the", "analyzer", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java#L172-L231
17,748
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java
RubyBundleAuditAnalyzer.analyzeDependency
@Override protected void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException { if (needToDisableGemspecAnalyzer) { boolean failed = true; final String className = RubyGemspecAnalyzer.class.getName(); for (FileTypeAnalyzer analyzer ...
java
@Override protected void analyzeDependency(Dependency dependency, Engine engine) throws AnalysisException { if (needToDisableGemspecAnalyzer) { boolean failed = true; final String className = RubyGemspecAnalyzer.class.getName(); for (FileTypeAnalyzer analyzer ...
[ "@", "Override", "protected", "void", "analyzeDependency", "(", "Dependency", "dependency", ",", "Engine", "engine", ")", "throws", "AnalysisException", "{", "if", "(", "needToDisableGemspecAnalyzer", ")", "{", "boolean", "failed", "=", "true", ";", "final", "Stri...
Determines if the analyzer can analyze the given file type. @param dependency the dependency to determine if it can analyze @param engine the dependency-check engine @throws AnalysisException thrown if there is an analysis exception.
[ "Determines", "if", "the", "analyzer", "can", "analyze", "the", "given", "file", "type", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java#L271-L318
17,749
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java
RubyBundleAuditAnalyzer.processBundlerAuditOutput
private void processBundlerAuditOutput(Dependency original, Engine engine, BufferedReader rdr) throws IOException, CpeValidationException { final String parentName = original.getActualFile().getParentFile().getName(); final String fileName = original.getFileName(); final String filePath = origin...
java
private void processBundlerAuditOutput(Dependency original, Engine engine, BufferedReader rdr) throws IOException, CpeValidationException { final String parentName = original.getActualFile().getParentFile().getName(); final String fileName = original.getFileName(); final String filePath = origin...
[ "private", "void", "processBundlerAuditOutput", "(", "Dependency", "original", ",", "Engine", "engine", ",", "BufferedReader", "rdr", ")", "throws", "IOException", ",", "CpeValidationException", "{", "final", "String", "parentName", "=", "original", ".", "getActualFil...
Processes the bundler audit output. @param original the dependency @param engine the dependency-check engine @param rdr the reader of the report @throws IOException thrown if the report cannot be read @throws CpeValidationException if there is an error building the CPE/VulnerableSoftware object
[ "Processes", "the", "bundler", "audit", "output", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java#L330-L370
17,750
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java
RubyBundleAuditAnalyzer.setVulnerabilityName
private void setVulnerabilityName(String parentName, Dependency dependency, Vulnerability vulnerability, String nextLine) { final String advisory = nextLine.substring(ADVISORY.length()); if (null != vulnerability) { vulnerability.setName(advisory); } if (null != dependency) {...
java
private void setVulnerabilityName(String parentName, Dependency dependency, Vulnerability vulnerability, String nextLine) { final String advisory = nextLine.substring(ADVISORY.length()); if (null != vulnerability) { vulnerability.setName(advisory); } if (null != dependency) {...
[ "private", "void", "setVulnerabilityName", "(", "String", "parentName", ",", "Dependency", "dependency", ",", "Vulnerability", "vulnerability", ",", "String", "nextLine", ")", "{", "final", "String", "advisory", "=", "nextLine", ".", "substring", "(", "ADVISORY", ...
Sets the vulnerability name. @param parentName the parent name @param dependency the dependency @param vulnerability the vulnerability @param nextLine the line to parse
[ "Sets", "the", "vulnerability", "name", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java#L380-L389
17,751
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java
RubyBundleAuditAnalyzer.addReferenceToVulnerability
private void addReferenceToVulnerability(String parentName, Vulnerability vulnerability, String nextLine) { final String url = nextLine.substring("URL: ".length()); if (null != vulnerability) { final Reference ref = new Reference(); ref.setName(vulnerability.getName()); ...
java
private void addReferenceToVulnerability(String parentName, Vulnerability vulnerability, String nextLine) { final String url = nextLine.substring("URL: ".length()); if (null != vulnerability) { final Reference ref = new Reference(); ref.setName(vulnerability.getName()); ...
[ "private", "void", "addReferenceToVulnerability", "(", "String", "parentName", ",", "Vulnerability", "vulnerability", ",", "String", "nextLine", ")", "{", "final", "String", "url", "=", "nextLine", ".", "substring", "(", "\"URL: \"", ".", "length", "(", ")", ")"...
Adds a reference to the vulnerability. @param parentName the parent name @param vulnerability the vulnerability @param nextLine the line to parse
[ "Adds", "a", "reference", "to", "the", "vulnerability", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java#L398-L408
17,752
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java
RubyBundleAuditAnalyzer.addCriticalityToVulnerability
private void addCriticalityToVulnerability(String parentName, Vulnerability vulnerability, String nextLine) { if (null != vulnerability) { final String criticality = nextLine.substring(CRITICALITY.length()).trim(); float score = -1.0f; Vulnerability v = null; if (...
java
private void addCriticalityToVulnerability(String parentName, Vulnerability vulnerability, String nextLine) { if (null != vulnerability) { final String criticality = nextLine.substring(CRITICALITY.length()).trim(); float score = -1.0f; Vulnerability v = null; if (...
[ "private", "void", "addCriticalityToVulnerability", "(", "String", "parentName", ",", "Vulnerability", "vulnerability", ",", "String", "nextLine", ")", "{", "if", "(", "null", "!=", "vulnerability", ")", "{", "final", "String", "criticality", "=", "nextLine", ".",...
Adds the criticality to the vulnerability @param parentName the parent name @param vulnerability the vulnerability @param nextLine the line to parse
[ "Adds", "the", "criticality", "to", "the", "vulnerability" ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java#L417-L448
17,753
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java
RubyBundleAuditAnalyzer.createVulnerability
private Vulnerability createVulnerability(String parentName, Dependency dependency, String gem, String nextLine) throws CpeValidationException { Vulnerability vulnerability = null; if (null != dependency) { final String version = nextLine.substring(VERSION.length()); dependency.a...
java
private Vulnerability createVulnerability(String parentName, Dependency dependency, String gem, String nextLine) throws CpeValidationException { Vulnerability vulnerability = null; if (null != dependency) { final String version = nextLine.substring(VERSION.length()); dependency.a...
[ "private", "Vulnerability", "createVulnerability", "(", "String", "parentName", ",", "Dependency", "dependency", ",", "String", "gem", ",", "String", "nextLine", ")", "throws", "CpeValidationException", "{", "Vulnerability", "vulnerability", "=", "null", ";", "if", ...
Creates a vulnerability. @param parentName the parent name @param dependency the dependency @param gem the gem name @param nextLine the line to parse @return the vulnerability @throws CpeValidationException thrown if there is an error building the CPE vulnerability object
[ "Creates", "a", "vulnerability", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java#L461-L495
17,754
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java
RubyBundleAuditAnalyzer.createDependencyForGem
private Dependency createDependencyForGem(Engine engine, String parentName, String fileName, String filePath, String gem) throws IOException { final File gemFile; try { gemFile = File.createTempFile(gem, "_Gemfile.lock", getSettings().getTempDirectory()); } catch (IOException ioe) { ...
java
private Dependency createDependencyForGem(Engine engine, String parentName, String fileName, String filePath, String gem) throws IOException { final File gemFile; try { gemFile = File.createTempFile(gem, "_Gemfile.lock", getSettings().getTempDirectory()); } catch (IOException ioe) { ...
[ "private", "Dependency", "createDependencyForGem", "(", "Engine", "engine", ",", "String", "parentName", ",", "String", "fileName", ",", "String", "filePath", ",", "String", "gem", ")", "throws", "IOException", "{", "final", "File", "gemFile", ";", "try", "{", ...
Creates the dependency based off of the gem. @param engine the engine used for scanning @param parentName the gem parent @param fileName the file name @param filePath the file path @param gem the gem name @return the dependency to add @throws IOException thrown if a temporary gem file could not be written
[ "Creates", "the", "dependency", "based", "off", "of", "the", "gem", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/RubyBundleAuditAnalyzer.java#L508-L527
17,755
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintParser.java
HintParser.parseHints
@SuppressFBWarnings(justification = "try with resources will clean up the input stream", value = {"OBL_UNSATISFIED_OBLIGATION"}) public void parseHints(File file) throws HintParseException { try (InputStream fis = new FileInputStream(file)) { parseHints(fis); } catch (SAXException | IOEx...
java
@SuppressFBWarnings(justification = "try with resources will clean up the input stream", value = {"OBL_UNSATISFIED_OBLIGATION"}) public void parseHints(File file) throws HintParseException { try (InputStream fis = new FileInputStream(file)) { parseHints(fis); } catch (SAXException | IOEx...
[ "@", "SuppressFBWarnings", "(", "justification", "=", "\"try with resources will clean up the input stream\"", ",", "value", "=", "{", "\"OBL_UNSATISFIED_OBLIGATION\"", "}", ")", "public", "void", "parseHints", "(", "File", "file", ")", "throws", "HintParseException", "{"...
Parses the given XML file and returns a list of the hints contained. @param file an XML file containing hints @throws HintParseException thrown if the XML file cannot be parsed
[ "Parses", "the", "given", "XML", "file", "and", "returns", "a", "list", "of", "the", "hints", "contained", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintParser.java#L120-L128
17,756
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintParser.java
HintParser.parseHints
public void parseHints(InputStream inputStream) throws HintParseException, SAXException { try ( InputStream schemaStream13 = FileUtils.getResourceAsStream(HINT_SCHEMA_1_3); InputStream schemaStream12 = FileUtils.getResourceAsStream(HINT_SCHEMA_1_2); InputStream sc...
java
public void parseHints(InputStream inputStream) throws HintParseException, SAXException { try ( InputStream schemaStream13 = FileUtils.getResourceAsStream(HINT_SCHEMA_1_3); InputStream schemaStream12 = FileUtils.getResourceAsStream(HINT_SCHEMA_1_2); InputStream sc...
[ "public", "void", "parseHints", "(", "InputStream", "inputStream", ")", "throws", "HintParseException", ",", "SAXException", "{", "try", "(", "InputStream", "schemaStream13", "=", "FileUtils", ".", "getResourceAsStream", "(", "HINT_SCHEMA_1_3", ")", ";", "InputStream"...
Parses the given XML stream and returns a list of the hint rules contained. @param inputStream an InputStream containing hint rules @throws HintParseException thrown if the XML cannot be parsed @throws SAXException thrown if the XML cannot be parsed
[ "Parses", "the", "given", "XML", "stream", "and", "returns", "a", "list", "of", "the", "hint", "rules", "contained", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintParser.java#L138-L168
17,757
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/VulnerableSoftwareBuilder.java
VulnerableSoftwareBuilder.reset
@Override protected void reset() { super.reset(); versionEndExcluding = null; versionEndIncluding = null; versionStartExcluding = null; versionStartIncluding = null; vulnerable = true; }
java
@Override protected void reset() { super.reset(); versionEndExcluding = null; versionEndIncluding = null; versionStartExcluding = null; versionStartIncluding = null; vulnerable = true; }
[ "@", "Override", "protected", "void", "reset", "(", ")", "{", "super", ".", "reset", "(", ")", ";", "versionEndExcluding", "=", "null", ";", "versionEndIncluding", "=", "null", ";", "versionStartExcluding", "=", "null", ";", "versionStartIncluding", "=", "null...
Resets the Vulnerable Software Builder to a clean state.
[ "Resets", "the", "Vulnerable", "Software", "Builder", "to", "a", "clean", "state", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/VulnerableSoftwareBuilder.java#L80-L88
17,758
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/VulnerableSoftwareBuilder.java
VulnerableSoftwareBuilder.cpe
public VulnerableSoftwareBuilder cpe(Cpe cpe) { this.part(cpe.getPart()).wfVendor(cpe.getWellFormedVendor()).wfProduct(cpe.getWellFormedProduct()) .wfVersion(cpe.getWellFormedVersion()).wfUpdate(cpe.getWellFormedUpdate()) .wfEdition(cpe.getWellFormedEdition()).wfLanguage(cpe.getW...
java
public VulnerableSoftwareBuilder cpe(Cpe cpe) { this.part(cpe.getPart()).wfVendor(cpe.getWellFormedVendor()).wfProduct(cpe.getWellFormedProduct()) .wfVersion(cpe.getWellFormedVersion()).wfUpdate(cpe.getWellFormedUpdate()) .wfEdition(cpe.getWellFormedEdition()).wfLanguage(cpe.getW...
[ "public", "VulnerableSoftwareBuilder", "cpe", "(", "Cpe", "cpe", ")", "{", "this", ".", "part", "(", "cpe", ".", "getPart", "(", ")", ")", ".", "wfVendor", "(", "cpe", ".", "getWellFormedVendor", "(", ")", ")", ".", "wfProduct", "(", "cpe", ".", "getWe...
Adds a base CPE object to build a vulnerable software object from. @param cpe the base CPE @return a reference to the builder
[ "Adds", "a", "base", "CPE", "object", "to", "build", "a", "vulnerable", "software", "object", "from", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/VulnerableSoftwareBuilder.java#L96-L103
17,759
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/AnalyzerService.java
AnalyzerService.getAnalyzers
public List<Analyzer> getAnalyzers(List<AnalysisPhase> phases) { final List<Analyzer> analyzers = new ArrayList<>(); final Iterator<Analyzer> iterator = service.iterator(); boolean experimentalEnabled = false; boolean retiredEnabled = false; try { experimentalEnabled ...
java
public List<Analyzer> getAnalyzers(List<AnalysisPhase> phases) { final List<Analyzer> analyzers = new ArrayList<>(); final Iterator<Analyzer> iterator = service.iterator(); boolean experimentalEnabled = false; boolean retiredEnabled = false; try { experimentalEnabled ...
[ "public", "List", "<", "Analyzer", ">", "getAnalyzers", "(", "List", "<", "AnalysisPhase", ">", "phases", ")", "{", "final", "List", "<", "Analyzer", ">", "analyzers", "=", "new", "ArrayList", "<>", "(", ")", ";", "final", "Iterator", "<", "Analyzer", ">...
Returns a list of all instances of the Analyzer interface that are bound to one of the given phases. @param phases the phases to obtain analyzers for @return a list of Analyzers
[ "Returns", "a", "list", "of", "all", "instances", "of", "the", "Analyzer", "interface", "that", "are", "bound", "to", "one", "of", "the", "given", "phases", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/AnalyzerService.java#L93-L119
17,760
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nodeaudit/NpmAuditParser.java
NpmAuditParser.parse
public List<Advisory> parse(JSONObject jsonResponse) { LOGGER.debug("Parsing JSON node"); final List<Advisory> advisories = new ArrayList<>(); final JSONObject jsonAdvisories = jsonResponse.getJSONObject("advisories"); final Iterator<?> keys = jsonAdvisories.keys(); while (keys.h...
java
public List<Advisory> parse(JSONObject jsonResponse) { LOGGER.debug("Parsing JSON node"); final List<Advisory> advisories = new ArrayList<>(); final JSONObject jsonAdvisories = jsonResponse.getJSONObject("advisories"); final Iterator<?> keys = jsonAdvisories.keys(); while (keys.h...
[ "public", "List", "<", "Advisory", ">", "parse", "(", "JSONObject", "jsonResponse", ")", "{", "LOGGER", ".", "debug", "(", "\"Parsing JSON node\"", ")", ";", "final", "List", "<", "Advisory", ">", "advisories", "=", "new", "ArrayList", "<>", "(", ")", ";",...
Parses the JSON response from the NPM Audit API. @param jsonResponse the JSON node to parse @return an AdvisoryResults object
[ "Parses", "the", "JSON", "response", "from", "the", "NPM", "Audit", "API", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nodeaudit/NpmAuditParser.java#L47-L58
17,761
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nodeaudit/NpmAuditParser.java
NpmAuditParser.parseAdvisory
private Advisory parseAdvisory(JSONObject object) { final Advisory advisory = new Advisory(); advisory.setId(object.getInt("id")); advisory.setOverview(object.optString("overview", null)); advisory.setReferences(object.optString("references", null)); advisory.setCreated(object.op...
java
private Advisory parseAdvisory(JSONObject object) { final Advisory advisory = new Advisory(); advisory.setId(object.getInt("id")); advisory.setOverview(object.optString("overview", null)); advisory.setReferences(object.optString("references", null)); advisory.setCreated(object.op...
[ "private", "Advisory", "parseAdvisory", "(", "JSONObject", "object", ")", "{", "final", "Advisory", "advisory", "=", "new", "Advisory", "(", ")", ";", "advisory", ".", "setId", "(", "object", ".", "getInt", "(", "\"id\"", ")", ")", ";", "advisory", ".", ...
Parses the advisory from Node Audit. @param object the JSON object containing the advisory @return the Advisory object
[ "Parses", "the", "advisory", "from", "Node", "Audit", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nodeaudit/NpmAuditParser.java#L66-L106
17,762
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/utils/DependencyVersion.java
DependencyVersion.matchesAtLeastThreeLevels
public boolean matchesAtLeastThreeLevels(DependencyVersion version) { if (version == null) { return false; } if (Math.abs(this.versionParts.size() - version.versionParts.size()) >= 3) { return false; } final int max = (this.versionParts.size() < version.v...
java
public boolean matchesAtLeastThreeLevels(DependencyVersion version) { if (version == null) { return false; } if (Math.abs(this.versionParts.size() - version.versionParts.size()) >= 3) { return false; } final int max = (this.versionParts.size() < version.v...
[ "public", "boolean", "matchesAtLeastThreeLevels", "(", "DependencyVersion", "version", ")", "{", "if", "(", "version", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "Math", ".", "abs", "(", "this", ".", "versionParts", ".", "size", "(", ...
Determines if the three most major major version parts are identical. For instances, if version 1.2.3.4 was compared to 1.2.3 this function would return true. @param version the version number to compare @return true if the first three major parts of the version are identical
[ "Determines", "if", "the", "three", "most", "major", "major", "version", "parts", "are", "identical", ".", "For", "instances", "if", "version", "1", ".", "2", ".", "3", ".", "4", "was", "compared", "to", "1", ".", "2", ".", "3", "this", "function", "...
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/DependencyVersion.java#L203-L230
17,763
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/suppression/SuppressionParser.java
SuppressionParser.parseSuppressionRules
@SuppressFBWarnings(justification = "try with resource will clenaup the resources", value = {"OBL_UNSATISFIED_OBLIGATION"}) public List<SuppressionRule> parseSuppressionRules(File file) throws SuppressionParseException { try (FileInputStream fis = new FileInputStream(file)) { return parseSuppres...
java
@SuppressFBWarnings(justification = "try with resource will clenaup the resources", value = {"OBL_UNSATISFIED_OBLIGATION"}) public List<SuppressionRule> parseSuppressionRules(File file) throws SuppressionParseException { try (FileInputStream fis = new FileInputStream(file)) { return parseSuppres...
[ "@", "SuppressFBWarnings", "(", "justification", "=", "\"try with resource will clenaup the resources\"", ",", "value", "=", "{", "\"OBL_UNSATISFIED_OBLIGATION\"", "}", ")", "public", "List", "<", "SuppressionRule", ">", "parseSuppressionRules", "(", "File", "file", ")", ...
Parses the given XML file and returns a list of the suppression rules contained. @param file an XML file containing suppression rules @return a list of suppression rules @throws SuppressionParseException thrown if the XML file cannot be parsed
[ "Parses", "the", "given", "XML", "file", "and", "returns", "a", "list", "of", "the", "suppression", "rules", "contained", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/suppression/SuppressionParser.java#L76-L84
17,764
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/suppression/SuppressionParser.java
SuppressionParser.parseSuppressionRules
public List<SuppressionRule> parseSuppressionRules(InputStream inputStream) throws SuppressionParseException, SAXException { try ( InputStream schemaStream12 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_2); InputStream schemaStream11 = FileUtils.getResourceAsStream(SUPPRE...
java
public List<SuppressionRule> parseSuppressionRules(InputStream inputStream) throws SuppressionParseException, SAXException { try ( InputStream schemaStream12 = FileUtils.getResourceAsStream(SUPPRESSION_SCHEMA_1_2); InputStream schemaStream11 = FileUtils.getResourceAsStream(SUPPRE...
[ "public", "List", "<", "SuppressionRule", ">", "parseSuppressionRules", "(", "InputStream", "inputStream", ")", "throws", "SuppressionParseException", ",", "SAXException", "{", "try", "(", "InputStream", "schemaStream12", "=", "FileUtils", ".", "getResourceAsStream", "(...
Parses the given XML stream and returns a list of the suppression rules contained. @param inputStream an InputStream containing suppression rules @return a list of suppression rules @throws SuppressionParseException thrown if the XML cannot be parsed @throws SAXException thrown if the XML cannot be parsed
[ "Parses", "the", "given", "XML", "stream", "and", "returns", "a", "list", "of", "the", "suppression", "rules", "contained", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/suppression/SuppressionParser.java#L95-L124
17,765
jeremylong/DependencyCheck
utils/src/main/java/org/owasp/dependencycheck/utils/HttpResourceConnection.java
HttpResourceConnection.fetch
public InputStream fetch(URL url) throws DownloadFailedException { if ("file".equalsIgnoreCase(url.getProtocol())) { final File file; try { file = new File(url.toURI()); } catch (URISyntaxException ex) { final String msg = format("Download fail...
java
public InputStream fetch(URL url) throws DownloadFailedException { if ("file".equalsIgnoreCase(url.getProtocol())) { final File file; try { file = new File(url.toURI()); } catch (URISyntaxException ex) { final String msg = format("Download fail...
[ "public", "InputStream", "fetch", "(", "URL", "url", ")", "throws", "DownloadFailedException", "{", "if", "(", "\"file\"", ".", "equalsIgnoreCase", "(", "url", ".", "getProtocol", "(", ")", ")", ")", "{", "final", "File", "file", ";", "try", "{", "file", ...
Retrieves the resource identified by the given URL and returns the InputStream. @param url the URL of the resource to download @return the stream to read the retrieved content from @throws org.owasp.dependencycheck.utils.DownloadFailedException is thrown if there is an error downloading the resource
[ "Retrieves", "the", "resource", "identified", "by", "the", "given", "URL", "and", "returns", "the", "InputStream", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/HttpResourceConnection.java#L108-L156
17,766
jeremylong/DependencyCheck
utils/src/main/java/org/owasp/dependencycheck/utils/HttpResourceConnection.java
HttpResourceConnection.obtainConnection
private HttpURLConnection obtainConnection(URL url) throws DownloadFailedException { HttpURLConnection conn = null; try { LOGGER.debug("Attempting retrieval of {}", url.toString()); conn = connFactory.createHttpURLConnection(url, this.usesProxy); conn.setRequestProper...
java
private HttpURLConnection obtainConnection(URL url) throws DownloadFailedException { HttpURLConnection conn = null; try { LOGGER.debug("Attempting retrieval of {}", url.toString()); conn = connFactory.createHttpURLConnection(url, this.usesProxy); conn.setRequestProper...
[ "private", "HttpURLConnection", "obtainConnection", "(", "URL", "url", ")", "throws", "DownloadFailedException", "{", "HttpURLConnection", "conn", "=", "null", ";", "try", "{", "LOGGER", ".", "debug", "(", "\"Attempting retrieval of {}\"", ",", "url", ".", "toString...
Obtains the HTTP URL Connection. @param url the URL @return the HTTP URL Connection @throws DownloadFailedException thrown if there is an error creating the HTTP URL Connection
[ "Obtains", "the", "HTTP", "URL", "Connection", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/HttpResourceConnection.java#L166-L221
17,767
jeremylong/DependencyCheck
utils/src/main/java/org/owasp/dependencycheck/utils/HttpResourceConnection.java
HttpResourceConnection.isQuickQuery
private boolean isQuickQuery() { boolean quickQuery; try { quickQuery = settings.getBoolean(Settings.KEYS.DOWNLOADER_QUICK_QUERY_TIMESTAMP, true); } catch (InvalidSettingException e) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Invalid settings : {}", e...
java
private boolean isQuickQuery() { boolean quickQuery; try { quickQuery = settings.getBoolean(Settings.KEYS.DOWNLOADER_QUICK_QUERY_TIMESTAMP, true); } catch (InvalidSettingException e) { if (LOGGER.isTraceEnabled()) { LOGGER.trace("Invalid settings : {}", e...
[ "private", "boolean", "isQuickQuery", "(", ")", "{", "boolean", "quickQuery", ";", "try", "{", "quickQuery", "=", "settings", ".", "getBoolean", "(", "Settings", ".", "KEYS", ".", "DOWNLOADER_QUICK_QUERY_TIMESTAMP", ",", "true", ")", ";", "}", "catch", "(", ...
Determines if the HTTP method GET or HEAD should be used to check the timestamp on external resources. @return true if configured to use HEAD requests
[ "Determines", "if", "the", "HTTP", "method", "GET", "or", "HEAD", "should", "be", "used", "to", "check", "the", "timestamp", "on", "external", "resources", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/HttpResourceConnection.java#L346-L358
17,768
jeremylong/DependencyCheck
utils/src/main/java/org/owasp/dependencycheck/utils/HttpResourceConnection.java
HttpResourceConnection.checkForCommonExceptionTypes
public void checkForCommonExceptionTypes(IOException ex) throws DownloadFailedException { Throwable cause = ex; while (cause != null) { if (cause instanceof java.net.UnknownHostException) { final String msg = format("Unable to resolve domain '%s'", cause.getMessage()); ...
java
public void checkForCommonExceptionTypes(IOException ex) throws DownloadFailedException { Throwable cause = ex; while (cause != null) { if (cause instanceof java.net.UnknownHostException) { final String msg = format("Unable to resolve domain '%s'", cause.getMessage()); ...
[ "public", "void", "checkForCommonExceptionTypes", "(", "IOException", "ex", ")", "throws", "DownloadFailedException", "{", "Throwable", "cause", "=", "ex", ";", "while", "(", "cause", "!=", "null", ")", "{", "if", "(", "cause", "instanceof", "java", ".", "net"...
Analyzes the IOException, logs the appropriate information for debugging purposes, and then throws a DownloadFailedException that wraps the IO Exception for common IO Exceptions. This is to provide additional details to assist in resolution of the exception. @param ex the original exception @throws org.owasp.dependenc...
[ "Analyzes", "the", "IOException", "logs", "the", "appropriate", "information", "for", "debugging", "purposes", "and", "then", "throws", "a", "DownloadFailedException", "that", "wraps", "the", "IO", "Exception", "for", "common", "IO", "Exceptions", ".", "This", "is...
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/utils/src/main/java/org/owasp/dependencycheck/utils/HttpResourceConnection.java#L370-L391
17,769
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/utils/H2DBCleanupHook.java
H2DBCleanupHook.remove
@Override public void remove() { try { Runtime.getRuntime().removeShutdownHook(this); } catch (IllegalStateException ex) { LOGGER.trace("ignore as we are likely shutting down", ex); } }
java
@Override public void remove() { try { Runtime.getRuntime().removeShutdownHook(this); } catch (IllegalStateException ex) { LOGGER.trace("ignore as we are likely shutting down", ex); } }
[ "@", "Override", "public", "void", "remove", "(", ")", "{", "try", "{", "Runtime", ".", "getRuntime", "(", ")", ".", "removeShutdownHook", "(", "this", ")", ";", "}", "catch", "(", "IllegalStateException", "ex", ")", "{", "LOGGER", ".", "trace", "(", "...
Removes the shutdown hook.
[ "Removes", "the", "shutdown", "hook", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/H2DBCleanupHook.java#L55-L62
17,770
jeremylong/DependencyCheck
maven/src/main/java/org/owasp/dependencycheck/maven/CheckMojo.java
CheckMojo.canGenerateReport
@Override public boolean canGenerateReport() { populateSettings(); boolean isCapable = false; for (Artifact a : getProject().getArtifacts()) { if (!getArtifactScopeExcluded().passes(a.getScope())) { isCapable = true; break; } } ...
java
@Override public boolean canGenerateReport() { populateSettings(); boolean isCapable = false; for (Artifact a : getProject().getArtifacts()) { if (!getArtifactScopeExcluded().passes(a.getScope())) { isCapable = true; break; } } ...
[ "@", "Override", "public", "boolean", "canGenerateReport", "(", ")", "{", "populateSettings", "(", ")", ";", "boolean", "isCapable", "=", "false", ";", "for", "(", "Artifact", "a", ":", "getProject", "(", ")", ".", "getArtifacts", "(", ")", ")", "{", "if...
Returns whether or not a the report can be generated. @return <code>true</code> if the report can be generated; otherwise <code>false</code>
[ "Returns", "whether", "or", "not", "a", "the", "report", "can", "be", "generated", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/maven/src/main/java/org/owasp/dependencycheck/maven/CheckMojo.java#L58-L69
17,771
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/pom/PomProjectInputStream.java
PomProjectInputStream.skipToProject
private void skipToProject() throws IOException { final byte[] buffer = new byte[BUFFER_SIZE]; super.mark(BUFFER_SIZE); int count = super.read(buffer, 0, BUFFER_SIZE); while (count > 0) { final int pos = findSequence(PROJECT, buffer); if (pos >= 0) { ...
java
private void skipToProject() throws IOException { final byte[] buffer = new byte[BUFFER_SIZE]; super.mark(BUFFER_SIZE); int count = super.read(buffer, 0, BUFFER_SIZE); while (count > 0) { final int pos = findSequence(PROJECT, buffer); if (pos >= 0) { ...
[ "private", "void", "skipToProject", "(", ")", "throws", "IOException", "{", "final", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "BUFFER_SIZE", "]", ";", "super", ".", "mark", "(", "BUFFER_SIZE", ")", ";", "int", "count", "=", "super", ".", "r...
Skips bytes from the input stream until it finds the &lt;project&gt; element. @throws IOException thrown if an I/O error occurs
[ "Skips", "bytes", "from", "the", "input", "stream", "until", "it", "finds", "the", "&lt", ";", "project&gt", ";", "element", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/pom/PomProjectInputStream.java#L63-L81
17,772
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/pom/PomProjectInputStream.java
PomProjectInputStream.findSequence
protected static int findSequence(byte[] sequence, byte[] buffer) { int pos = -1; for (int i = 0; i < buffer.length - sequence.length + 1; i++) { if (buffer[i] == sequence[0] && testRemaining(sequence, buffer, i)) { pos = i; break; } } ...
java
protected static int findSequence(byte[] sequence, byte[] buffer) { int pos = -1; for (int i = 0; i < buffer.length - sequence.length + 1; i++) { if (buffer[i] == sequence[0] && testRemaining(sequence, buffer, i)) { pos = i; break; } } ...
[ "protected", "static", "int", "findSequence", "(", "byte", "[", "]", "sequence", ",", "byte", "[", "]", "buffer", ")", "{", "int", "pos", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "buffer", ".", "length", "-", "sequence...
Finds the start of the given sequence in the buffer. If not found, -1 is returned. @param sequence the sequence to locate @param buffer the buffer to search @return the starting position of the sequence in the buffer if found; otherwise -1
[ "Finds", "the", "start", "of", "the", "given", "sequence", "in", "the", "buffer", ".", "If", "not", "found", "-", "1", "is", "returned", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/pom/PomProjectInputStream.java#L114-L123
17,773
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java
HintRule.addGivenProduct
public void addGivenProduct(String source, String name, String value, boolean regex, Confidence confidence) { givenProduct.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
java
public void addGivenProduct(String source, String name, String value, boolean regex, Confidence confidence) { givenProduct.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
[ "public", "void", "addGivenProduct", "(", "String", "source", ",", "String", "name", ",", "String", "value", ",", "boolean", "regex", ",", "Confidence", "confidence", ")", "{", "givenProduct", ".", "add", "(", "new", "EvidenceMatcher", "(", "source", ",", "n...
Adds a given product to the list of evidence to matched. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param regex whether value is a regex @param confidence the confidence of the evidence
[ "Adds", "a", "given", "product", "to", "the", "list", "of", "evidence", "to", "matched", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L106-L108
17,774
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java
HintRule.addGivenVendor
public void addGivenVendor(String source, String name, String value, boolean regex, Confidence confidence) { givenVendor.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
java
public void addGivenVendor(String source, String name, String value, boolean regex, Confidence confidence) { givenVendor.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
[ "public", "void", "addGivenVendor", "(", "String", "source", ",", "String", "name", ",", "String", "value", ",", "boolean", "regex", ",", "Confidence", "confidence", ")", "{", "givenVendor", ".", "add", "(", "new", "EvidenceMatcher", "(", "source", ",", "nam...
Adds a given vendors to the list of evidence to matched. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param regex whether value is a regex @param confidence the confidence of the evidence
[ "Adds", "a", "given", "vendors", "to", "the", "list", "of", "evidence", "to", "matched", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L128-L130
17,775
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java
HintRule.addAddProduct
public void addAddProduct(String source, String name, String value, Confidence confidence) { addProduct.add(new Evidence(source, name, value, confidence)); }
java
public void addAddProduct(String source, String name, String value, Confidence confidence) { addProduct.add(new Evidence(source, name, value, confidence)); }
[ "public", "void", "addAddProduct", "(", "String", "source", ",", "String", "name", ",", "String", "value", ",", "Confidence", "confidence", ")", "{", "addProduct", ".", "add", "(", "new", "Evidence", "(", "source", ",", "name", ",", "value", ",", "confiden...
Adds a given product to the list of evidence to add when matched. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param confidence the confidence of the evidence
[ "Adds", "a", "given", "product", "to", "the", "list", "of", "evidence", "to", "add", "when", "matched", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L149-L151
17,776
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java
HintRule.addAddVersion
public void addAddVersion(String source, String name, String value, Confidence confidence) { addVersion.add(new Evidence(source, name, value, confidence)); }
java
public void addAddVersion(String source, String name, String value, Confidence confidence) { addVersion.add(new Evidence(source, name, value, confidence)); }
[ "public", "void", "addAddVersion", "(", "String", "source", ",", "String", "name", ",", "String", "value", ",", "Confidence", "confidence", ")", "{", "addVersion", ".", "add", "(", "new", "Evidence", "(", "source", ",", "name", ",", "value", ",", "confiden...
Adds a given version to the list of evidence to add when matched. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param confidence the confidence of the evidence
[ "Adds", "a", "given", "version", "to", "the", "list", "of", "evidence", "to", "add", "when", "matched", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L170-L172
17,777
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java
HintRule.addAddVendor
public void addAddVendor(String source, String name, String value, Confidence confidence) { addVendor.add(new Evidence(source, name, value, confidence)); }
java
public void addAddVendor(String source, String name, String value, Confidence confidence) { addVendor.add(new Evidence(source, name, value, confidence)); }
[ "public", "void", "addAddVendor", "(", "String", "source", ",", "String", "name", ",", "String", "value", ",", "Confidence", "confidence", ")", "{", "addVendor", ".", "add", "(", "new", "Evidence", "(", "source", ",", "name", ",", "value", ",", "confidence...
Adds a given vendor to the list of evidence to add when matched. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param confidence the confidence of the evidence
[ "Adds", "a", "given", "vendor", "to", "the", "list", "of", "evidence", "to", "add", "when", "matched", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L191-L193
17,778
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java
HintRule.addRemoveVendor
public void addRemoveVendor(String source, String name, String value, boolean regex, Confidence confidence) { removeVendor.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
java
public void addRemoveVendor(String source, String name, String value, boolean regex, Confidence confidence) { removeVendor.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
[ "public", "void", "addRemoveVendor", "(", "String", "source", ",", "String", "name", ",", "String", "value", ",", "boolean", "regex", ",", "Confidence", "confidence", ")", "{", "removeVendor", ".", "add", "(", "new", "EvidenceMatcher", "(", "source", ",", "n...
Adds a given vendor to the list of evidence to remove when matched. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param regex whether value is a regex @param confidence the confidence of the evidence
[ "Adds", "a", "given", "vendor", "to", "the", "list", "of", "evidence", "to", "remove", "when", "matched", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L213-L215
17,779
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java
HintRule.addRemoveProduct
public void addRemoveProduct(String source, String name, String value, boolean regex, Confidence confidence) { removeProduct.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
java
public void addRemoveProduct(String source, String name, String value, boolean regex, Confidence confidence) { removeProduct.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
[ "public", "void", "addRemoveProduct", "(", "String", "source", ",", "String", "name", ",", "String", "value", ",", "boolean", "regex", ",", "Confidence", "confidence", ")", "{", "removeProduct", ".", "add", "(", "new", "EvidenceMatcher", "(", "source", ",", ...
Adds a given product to the list of evidence to remove when matched. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param regex whether value is a regex @param confidence the confidence of the evidence
[ "Adds", "a", "given", "product", "to", "the", "list", "of", "evidence", "to", "remove", "when", "matched", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L233-L235
17,780
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java
HintRule.addRemoveVersion
public void addRemoveVersion(String source, String name, String value, boolean regex, Confidence confidence) { removeVersion.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
java
public void addRemoveVersion(String source, String name, String value, boolean regex, Confidence confidence) { removeVersion.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
[ "public", "void", "addRemoveVersion", "(", "String", "source", ",", "String", "name", ",", "String", "value", ",", "boolean", "regex", ",", "Confidence", "confidence", ")", "{", "removeVersion", ".", "add", "(", "new", "EvidenceMatcher", "(", "source", ",", ...
Adds a given version to the list of evidence to remove when matched. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param regex whether value is a regex @param confidence the confidence of the evidence
[ "Adds", "a", "given", "version", "to", "the", "list", "of", "evidence", "to", "remove", "when", "matched", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L253-L255
17,781
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java
HintRule.addGivenVersion
public void addGivenVersion(String source, String name, String value, boolean regex, Confidence confidence) { givenVersion.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
java
public void addGivenVersion(String source, String name, String value, boolean regex, Confidence confidence) { givenVersion.add(new EvidenceMatcher(source, name, value, regex, confidence)); }
[ "public", "void", "addGivenVersion", "(", "String", "source", ",", "String", "name", ",", "String", "value", ",", "boolean", "regex", ",", "Confidence", "confidence", ")", "{", "givenVersion", ".", "add", "(", "new", "EvidenceMatcher", "(", "source", ",", "n...
Adds a given version to the list of evidence to match. @param source the source of the evidence @param name the name of the evidence @param value the value of the evidence @param regex whether value is a regex @param confidence the confidence of the evidence
[ "Adds", "a", "given", "version", "to", "the", "list", "of", "evidence", "to", "match", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/xml/hints/HintRule.java#L273-L275
17,782
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java
ExtractionUtil.extractFiles
public static void extractFiles(File archive, File extractTo, Engine engine) throws ExtractionException { if (archive == null || extractTo == null) { return; } final String destPath; try { destPath = extractTo.getCanonicalPath(); } catch (IOException ex) {...
java
public static void extractFiles(File archive, File extractTo, Engine engine) throws ExtractionException { if (archive == null || extractTo == null) { return; } final String destPath; try { destPath = extractTo.getCanonicalPath(); } catch (IOException ex) {...
[ "public", "static", "void", "extractFiles", "(", "File", "archive", ",", "File", "extractTo", ",", "Engine", "engine", ")", "throws", "ExtractionException", "{", "if", "(", "archive", "==", "null", "||", "extractTo", "==", "null", ")", "{", "return", ";", ...
Extracts the contents of an archive into the specified directory. The files are only extracted if they are supported by the analyzers loaded into the specified engine. If the engine is specified as null then all files are extracted. @param archive an archive file such as a WAR or EAR @param extractTo a directory to ex...
[ "Extracts", "the", "contents", "of", "an", "archive", "into", "the", "specified", "directory", ".", "The", "files", "are", "only", "extracted", "if", "they", "are", "supported", "by", "the", "analyzers", "loaded", "into", "the", "specified", "engine", ".", "...
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java#L86-L141
17,783
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java
ExtractionUtil.extractArchive
private static void extractArchive(ArchiveInputStream input, File destination, FilenameFilter filter) throws ArchiveExtractionException { ArchiveEntry entry; try { final String destPath = destination.getCanonicalPath(); while ((entry = input.getNextEntry(...
java
private static void extractArchive(ArchiveInputStream input, File destination, FilenameFilter filter) throws ArchiveExtractionException { ArchiveEntry entry; try { final String destPath = destination.getCanonicalPath(); while ((entry = input.getNextEntry(...
[ "private", "static", "void", "extractArchive", "(", "ArchiveInputStream", "input", ",", "File", "destination", ",", "FilenameFilter", "filter", ")", "throws", "ArchiveExtractionException", "{", "ArchiveEntry", "entry", ";", "try", "{", "final", "String", "destPath", ...
Extracts files from an archive. @param input the archive to extract files from @param destination the location to write the files too @param filter determines which files get extracted @throws ArchiveExtractionException thrown if there is an exception extracting files from the archive
[ "Extracts", "files", "from", "an", "archive", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java#L235-L266
17,784
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java
ExtractionUtil.createParentFile
private static void createParentFile(final File file) throws ExtractionException { final File parent = file.getParentFile(); if (!parent.isDirectory() && !parent.mkdirs()) { final String msg = String.format( "Unable to build directory '%s'.", parent.ge...
java
private static void createParentFile(final File file) throws ExtractionException { final File parent = file.getParentFile(); if (!parent.isDirectory() && !parent.mkdirs()) { final String msg = String.format( "Unable to build directory '%s'.", parent.ge...
[ "private", "static", "void", "createParentFile", "(", "final", "File", "file", ")", "throws", "ExtractionException", "{", "final", "File", "parent", "=", "file", ".", "getParentFile", "(", ")", ";", "if", "(", "!", "parent", ".", "isDirectory", "(", ")", "...
Ensures the parent path is correctly created on disk so that the file can be extracted to the correct location. @param file the file path @throws ExtractionException thrown if the parent paths could not be created
[ "Ensures", "the", "parent", "path", "is", "correctly", "created", "on", "disk", "so", "that", "the", "file", "can", "be", "extracted", "to", "the", "correct", "location", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java#L317-L325
17,785
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java
ExtractionUtil.extractGzip
public static void extractGzip(File file) throws FileNotFoundException, IOException { final String originalPath = file.getPath(); final File gzip = new File(originalPath + ".gz"); if (gzip.isFile() && !gzip.delete()) { LOGGER.debug("Failed to delete initial temporary file when extrac...
java
public static void extractGzip(File file) throws FileNotFoundException, IOException { final String originalPath = file.getPath(); final File gzip = new File(originalPath + ".gz"); if (gzip.isFile() && !gzip.delete()) { LOGGER.debug("Failed to delete initial temporary file when extrac...
[ "public", "static", "void", "extractGzip", "(", "File", "file", ")", "throws", "FileNotFoundException", ",", "IOException", "{", "final", "String", "originalPath", "=", "file", ".", "getPath", "(", ")", ";", "final", "File", "gzip", "=", "new", "File", "(", ...
Extracts the file contained in a gzip archive. The extracted file is placed in the exact same path as the file specified. @param file the archive file @throws FileNotFoundException thrown if the file does not exist @throws IOException thrown if there is an error extracting the file.
[ "Extracts", "the", "file", "contained", "in", "a", "gzip", "archive", ".", "The", "extracted", "file", "is", "placed", "in", "the", "exact", "same", "path", "as", "the", "file", "specified", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java#L335-L356
17,786
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java
ExtractionUtil.extractZip
public static void extractZip(File file) throws FileNotFoundException, IOException { final String originalPath = file.getPath(); final File zip = new File(originalPath + ".zip"); if (zip.isFile() && !zip.delete()) { LOGGER.debug("Failed to delete initial temporary file when extractin...
java
public static void extractZip(File file) throws FileNotFoundException, IOException { final String originalPath = file.getPath(); final File zip = new File(originalPath + ".zip"); if (zip.isFile() && !zip.delete()) { LOGGER.debug("Failed to delete initial temporary file when extractin...
[ "public", "static", "void", "extractZip", "(", "File", "file", ")", "throws", "FileNotFoundException", ",", "IOException", "{", "final", "String", "originalPath", "=", "file", ".", "getPath", "(", ")", ";", "final", "File", "zip", "=", "new", "File", "(", ...
Extracts the file contained in a Zip archive. The extracted file is placed in the exact same path as the file specified. @param file the archive file @throws FileNotFoundException thrown if the file does not exist @throws IOException thrown if there is an error extracting the file.
[ "Extracts", "the", "file", "contained", "in", "a", "Zip", "archive", ".", "The", "extracted", "file", "is", "placed", "in", "the", "exact", "same", "path", "as", "the", "file", "specified", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/utils/ExtractionUtil.java#L366-L388
17,787
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nuget/XPathMSBuildProjectParser.java
XPathMSBuildProjectParser.parse
@Override public List<NugetPackageReference> parse(InputStream stream) throws MSBuildProjectParseException { try { final DocumentBuilder db = XmlUtils.buildSecureDocumentBuilder(); final Document d = db.parse(stream); final XPath xpath = XPathFactory.newInstance().newXPa...
java
@Override public List<NugetPackageReference> parse(InputStream stream) throws MSBuildProjectParseException { try { final DocumentBuilder db = XmlUtils.buildSecureDocumentBuilder(); final Document d = db.parse(stream); final XPath xpath = XPathFactory.newInstance().newXPa...
[ "@", "Override", "public", "List", "<", "NugetPackageReference", ">", "parse", "(", "InputStream", "stream", ")", "throws", "MSBuildProjectParseException", "{", "try", "{", "final", "DocumentBuilder", "db", "=", "XmlUtils", ".", "buildSecureDocumentBuilder", "(", ")...
Parses the given stream for MSBuild PackageReference elements. @param stream the input stream to parse @return a collection of discovered NuGet package references @throws MSBuildProjectParseException if an exception occurs
[ "Parses", "the", "given", "stream", "for", "MSBuild", "PackageReference", "elements", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nuget/XPathMSBuildProjectParser.java#L52-L88
17,788
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/OpenSSLAnalyzer.java
OpenSSLAnalyzer.getOpenSSLVersion
protected static String getOpenSSLVersion(long openSSLVersionConstant) { final long major = openSSLVersionConstant >>> MAJOR_OFFSET; final long minor = (openSSLVersionConstant & MINOR_MASK) >>> MINOR_OFFSET; final long fix = (openSSLVersionConstant & FIX_MASK) >>> FIX_OFFSET; final long ...
java
protected static String getOpenSSLVersion(long openSSLVersionConstant) { final long major = openSSLVersionConstant >>> MAJOR_OFFSET; final long minor = (openSSLVersionConstant & MINOR_MASK) >>> MINOR_OFFSET; final long fix = (openSSLVersionConstant & FIX_MASK) >>> FIX_OFFSET; final long ...
[ "protected", "static", "String", "getOpenSSLVersion", "(", "long", "openSSLVersionConstant", ")", "{", "final", "long", "major", "=", "openSSLVersionConstant", ">>>", "MAJOR_OFFSET", ";", "final", "long", "minor", "=", "(", "openSSLVersionConstant", "&", "MINOR_MASK",...
Returns the open SSL version as a string. @param openSSLVersionConstant The open SSL version @return the version of openssl
[ "Returns", "the", "open", "SSL", "version", "as", "a", "string", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/OpenSSLAnalyzer.java#L119-L128
17,789
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/OpenSSLAnalyzer.java
OpenSSLAnalyzer.getFileContents
private String getFileContents(final File actualFile) throws AnalysisException { try { return FileUtils.readFileToString(actualFile, Charset.defaultCharset()).trim(); } catch (IOException e) { throw new AnalysisException( "Problem occurred while re...
java
private String getFileContents(final File actualFile) throws AnalysisException { try { return FileUtils.readFileToString(actualFile, Charset.defaultCharset()).trim(); } catch (IOException e) { throw new AnalysisException( "Problem occurred while re...
[ "private", "String", "getFileContents", "(", "final", "File", "actualFile", ")", "throws", "AnalysisException", "{", "try", "{", "return", "FileUtils", ".", "readFileToString", "(", "actualFile", ",", "Charset", ".", "defaultCharset", "(", ")", ")", ".", "trim",...
Retrieves the contents of a given file. @param actualFile the file to read @return the contents of the file @throws AnalysisException thrown if there is an IO Exception
[ "Retrieves", "the", "contents", "of", "a", "given", "file", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/OpenSSLAnalyzer.java#L231-L239
17,790
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nexus/NexusSearch.java
NexusSearch.preflightRequest
public boolean preflightRequest() { final HttpURLConnection conn; try { final URL url = new URL(rootURL, "status"); final URLConnectionFactory factory = new URLConnectionFactory(settings); conn = factory.createHttpURLConnection(url, useProxy); conn.addRequ...
java
public boolean preflightRequest() { final HttpURLConnection conn; try { final URL url = new URL(rootURL, "status"); final URLConnectionFactory factory = new URLConnectionFactory(settings); conn = factory.createHttpURLConnection(url, useProxy); conn.addRequ...
[ "public", "boolean", "preflightRequest", "(", ")", "{", "final", "HttpURLConnection", "conn", ";", "try", "{", "final", "URL", "url", "=", "new", "URL", "(", "rootURL", ",", "\"status\"", ")", ";", "final", "URLConnectionFactory", "factory", "=", "new", "URL...
Do a preflight request to see if the repository is actually working. @return whether the repository is listening and returns the /status URL correctly
[ "Do", "a", "preflight", "request", "to", "see", "if", "the", "repository", "is", "actually", "working", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nexus/NexusSearch.java#L177-L204
17,791
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/data/nexus/NexusSearch.java
NexusSearch.buildHttpAuthHeaderValue
private String buildHttpAuthHeaderValue() { final String user = settings.getString(Settings.KEYS.ANALYZER_NEXUS_USER, ""); final String pass = settings.getString(Settings.KEYS.ANALYZER_NEXUS_PASSWORD, ""); String result = ""; if (user.isEmpty() || pass.isEmpty()) { LOGGER.deb...
java
private String buildHttpAuthHeaderValue() { final String user = settings.getString(Settings.KEYS.ANALYZER_NEXUS_USER, ""); final String pass = settings.getString(Settings.KEYS.ANALYZER_NEXUS_PASSWORD, ""); String result = ""; if (user.isEmpty() || pass.isEmpty()) { LOGGER.deb...
[ "private", "String", "buildHttpAuthHeaderValue", "(", ")", "{", "final", "String", "user", "=", "settings", ".", "getString", "(", "Settings", ".", "KEYS", ".", "ANALYZER_NEXUS_USER", ",", "\"\"", ")", ";", "final", "String", "pass", "=", "settings", ".", "g...
Constructs the base64 encoded basic authentication header value. @return the base64 encoded basic authentication header value
[ "Constructs", "the", "base64", "encoded", "basic", "authentication", "header", "value", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nexus/NexusSearch.java#L211-L223
17,792
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/OssIndexAnalyzer.java
OssIndexAnalyzer.parsePackageUrl
@Nullable private PackageUrl parsePackageUrl(final String value) { try { return PackageUrl.parse(value); } catch (PackageUrl.InvalidException e) { log.warn("Invalid Package-URL: {}", value, e); return null; } }
java
@Nullable private PackageUrl parsePackageUrl(final String value) { try { return PackageUrl.parse(value); } catch (PackageUrl.InvalidException e) { log.warn("Invalid Package-URL: {}", value, e); return null; } }
[ "@", "Nullable", "private", "PackageUrl", "parsePackageUrl", "(", "final", "String", "value", ")", "{", "try", "{", "return", "PackageUrl", ".", "parse", "(", "value", ")", ";", "}", "catch", "(", "PackageUrl", ".", "InvalidException", "e", ")", "{", "log"...
Helper to complain if unable to parse Package-URL.
[ "Helper", "to", "complain", "if", "unable", "to", "parse", "Package", "-", "URL", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/OssIndexAnalyzer.java#L138-L146
17,793
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/OssIndexAnalyzer.java
OssIndexAnalyzer.requestReports
private Map<PackageUrl, ComponentReport> requestReports(final Dependency[] dependencies) throws Exception { log.debug("Requesting component-reports for {} dependencies", dependencies.length); // create requests for each dependency which has a PURL identifier List<PackageUrl> packages = new Arra...
java
private Map<PackageUrl, ComponentReport> requestReports(final Dependency[] dependencies) throws Exception { log.debug("Requesting component-reports for {} dependencies", dependencies.length); // create requests for each dependency which has a PURL identifier List<PackageUrl> packages = new Arra...
[ "private", "Map", "<", "PackageUrl", ",", "ComponentReport", ">", "requestReports", "(", "final", "Dependency", "[", "]", "dependencies", ")", "throws", "Exception", "{", "log", ".", "debug", "(", "\"Requesting component-reports for {} dependencies\"", ",", "dependenc...
Batch request component-reports for all dependencies.
[ "Batch", "request", "component", "-", "reports", "for", "all", "dependencies", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/OssIndexAnalyzer.java#L151-L174
17,794
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/OssIndexAnalyzer.java
OssIndexAnalyzer.enrich
private void enrich(final Dependency dependency) { log.debug("Enrich dependency: {}", dependency); for (Identifier id : dependency.getSoftwareIdentifiers()) { if (id instanceof PurlIdentifier) { log.debug(" Package: {} -> {}", id, id.getConfidence()); Packa...
java
private void enrich(final Dependency dependency) { log.debug("Enrich dependency: {}", dependency); for (Identifier id : dependency.getSoftwareIdentifiers()) { if (id instanceof PurlIdentifier) { log.debug(" Package: {} -> {}", id, id.getConfidence()); Packa...
[ "private", "void", "enrich", "(", "final", "Dependency", "dependency", ")", "{", "log", ".", "debug", "(", "\"Enrich dependency: {}\"", ",", "dependency", ")", ";", "for", "(", "Identifier", "id", ":", "dependency", ".", "getSoftwareIdentifiers", "(", ")", ")"...
Attempt to enrich given dependency with vulnerability details from OSS Index component-report.
[ "Attempt", "to", "enrich", "given", "dependency", "with", "vulnerability", "details", "from", "OSS", "Index", "component", "-", "report", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/OssIndexAnalyzer.java#L180-L214
17,795
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java
Dependency.calculateChecksums
private void calculateChecksums(File file) { try { this.md5sum = Checksum.getMD5Checksum(file); this.sha1sum = Checksum.getSHA1Checksum(file); this.sha256sum = Checksum.getSHA256Checksum(file); } catch (NoSuchAlgorithmException | IOException ex) { LOGGER.d...
java
private void calculateChecksums(File file) { try { this.md5sum = Checksum.getMD5Checksum(file); this.sha1sum = Checksum.getSHA1Checksum(file); this.sha256sum = Checksum.getSHA256Checksum(file); } catch (NoSuchAlgorithmException | IOException ex) { LOGGER.d...
[ "private", "void", "calculateChecksums", "(", "File", "file", ")", "{", "try", "{", "this", ".", "md5sum", "=", "Checksum", ".", "getMD5Checksum", "(", "file", ")", ";", "this", ".", "sha1sum", "=", "Checksum", ".", "getSHA1Checksum", "(", "file", ")", "...
Calculates the checksums for the given file. @param file the file used to calculate the checksums
[ "Calculates", "the", "checksums", "for", "the", "given", "file", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java#L210-L218
17,796
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java
Dependency.setActualFilePath
public void setActualFilePath(String actualFilePath) { this.actualFilePath = actualFilePath; this.sha1sum = null; this.sha256sum = null; this.md5sum = null; final File file = getActualFile(); if (file.isFile()) { calculateChecksums(this.getActualFile()); ...
java
public void setActualFilePath(String actualFilePath) { this.actualFilePath = actualFilePath; this.sha1sum = null; this.sha256sum = null; this.md5sum = null; final File file = getActualFile(); if (file.isFile()) { calculateChecksums(this.getActualFile()); ...
[ "public", "void", "setActualFilePath", "(", "String", "actualFilePath", ")", "{", "this", ".", "actualFilePath", "=", "actualFilePath", ";", "this", ".", "sha1sum", "=", "null", ";", "this", ".", "sha256sum", "=", "null", ";", "this", ".", "md5sum", "=", "...
Sets the actual file path of the dependency on disk. @param actualFilePath the file path of the dependency
[ "Sets", "the", "actual", "file", "path", "of", "the", "dependency", "on", "disk", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java#L281-L290
17,797
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java
Dependency.getDisplayFileName
public String getDisplayFileName() { if (displayName != null) { return displayName; } if (!isVirtual) { return fileName; } if (name == null) { return fileName; } if (version == null) { return name; } ...
java
public String getDisplayFileName() { if (displayName != null) { return displayName; } if (!isVirtual) { return fileName; } if (name == null) { return fileName; } if (version == null) { return name; } ...
[ "public", "String", "getDisplayFileName", "(", ")", "{", "if", "(", "displayName", "!=", "null", ")", "{", "return", "displayName", ";", "}", "if", "(", "!", "isVirtual", ")", "{", "return", "fileName", ";", "}", "if", "(", "name", "==", "null", ")", ...
Returns the file name to display in reports; if no display file name has been set it will default to constructing a name based on the name and version fields, otherwise it will return the actual file name. @return the file name to display
[ "Returns", "the", "file", "name", "to", "display", "in", "reports", ";", "if", "no", "display", "file", "name", "has", "been", "set", "it", "will", "default", "to", "constructing", "a", "name", "based", "on", "the", "name", "and", "version", "fields", "o...
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java#L308-L322
17,798
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java
Dependency.addSoftwareIdentifier
public synchronized void addSoftwareIdentifier(Identifier identifier) { //todo the following assertion should be removed after initial testing and implementation assert !(identifier instanceof CpeIdentifier) : "vulnerability identifier cannot be added to software identifiers"; final Optional<Id...
java
public synchronized void addSoftwareIdentifier(Identifier identifier) { //todo the following assertion should be removed after initial testing and implementation assert !(identifier instanceof CpeIdentifier) : "vulnerability identifier cannot be added to software identifiers"; final Optional<Id...
[ "public", "synchronized", "void", "addSoftwareIdentifier", "(", "Identifier", "identifier", ")", "{", "//todo the following assertion should be removed after initial testing and implementation", "assert", "!", "(", "identifier", "instanceof", "CpeIdentifier", ")", ":", "\"vulnera...
Adds an entry to the list of detected Identifiers for the dependency file. @param identifier a reference to the identifier to add
[ "Adds", "an", "entry", "to", "the", "list", "of", "detected", "Identifiers", "for", "the", "dependency", "file", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java#L462-L485
17,799
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java
Dependency.addAsEvidence
public void addAsEvidence(String source, MavenArtifact mavenArtifact, Confidence confidence) { if (mavenArtifact.getGroupId() != null && !mavenArtifact.getGroupId().isEmpty()) { this.addEvidence(EvidenceType.VENDOR, source, "groupid", mavenArtifact.getGroupId(), confidence); } if (ma...
java
public void addAsEvidence(String source, MavenArtifact mavenArtifact, Confidence confidence) { if (mavenArtifact.getGroupId() != null && !mavenArtifact.getGroupId().isEmpty()) { this.addEvidence(EvidenceType.VENDOR, source, "groupid", mavenArtifact.getGroupId(), confidence); } if (ma...
[ "public", "void", "addAsEvidence", "(", "String", "source", ",", "MavenArtifact", "mavenArtifact", ",", "Confidence", "confidence", ")", "{", "if", "(", "mavenArtifact", ".", "getGroupId", "(", ")", "!=", "null", "&&", "!", "mavenArtifact", ".", "getGroupId", ...
Adds the Maven artifact as evidence. @param source The source of the evidence @param mavenArtifact The Maven artifact @param confidence The confidence level of this evidence
[ "Adds", "the", "Maven", "artifact", "as", "evidence", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/dependency/Dependency.java#L513-L554