checkstyle/pmd/findbugs corrections

This commit is contained in:
Jeremy Long
2015-09-20 06:38:47 -04:00
parent 2b3791b83e
commit 14ea21d53d
6 changed files with 16 additions and 7 deletions

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
* Copyright (c) 2015 The OWASP Foundatio. All Rights Reserved. * Copyright (c) 2015 The OWASP Foundation. All Rights Reserved.
*/ */
package org.owasp.dependencycheck.analyzer; package org.owasp.dependencycheck.analyzer;

View File

@@ -62,12 +62,15 @@ public class NodePackageAnalyzer extends AbstractFileTypeAnalyzer {
*/ */
private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION; private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
/**
* The file name to scan.
*/
public static final String PACKAGE_JSON = "package.json"; public static final String PACKAGE_JSON = "package.json";
/** /**
* Filter that detects files named "package.json". * Filter that detects files named "package.json".
*/ */
private static final FileFilter PACKAGE_JSON_FILTER private static final FileFilter PACKAGE_JSON_FILTER = FileFilterBuilder.newInstance()
= FileFilterBuilder.newInstance().addFilenames(PACKAGE_JSON).build(); .addFilenames(PACKAGE_JSON).build();
/** /**
* Returns the FileFilter * Returns the FileFilter
@@ -150,6 +153,13 @@ public class NodePackageAnalyzer extends AbstractFileTypeAnalyzer {
} }
} }
/**
* Adds information to an evidence collection from the node json configuration.
*
* @param json information from node.js
* @param collection a set of evidence about a dependency
* @param key the key to obtain the data from the json information
*/
private void addToEvidence(JsonObject json, EvidenceCollection collection, String key) { private void addToEvidence(JsonObject json, EvidenceCollection collection, String key) {
if (json.containsKey(key)) { if (json.containsKey(key)) {
final JsonValue value = json.get(key); final JsonValue value = json.get(key);

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
* Copyright (c) 2015 The OWASP Foundatio. All Rights Reserved. * Copyright (c) 2015 The OWASP Foundation. All Rights Reserved.
*/ */
package org.owasp.dependencycheck.data.composer; package org.owasp.dependencycheck.data.composer;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* *
* Copyright (c) 2015 The OWASP Foundatio. All Rights Reserved. * Copyright (c) 2015 The OWASP Foundation. All Rights Reserved.
*/ */
package org.owasp.dependencycheck.data.composer; package org.owasp.dependencycheck.data.composer;

View File

@@ -151,7 +151,7 @@ public final class CpeMemoryIndex {
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private Analyzer createIndexingAnalyzer() { private Analyzer createIndexingAnalyzer() {
final Map<String,Analyzer> fieldAnalyzers = new HashMap<String, Analyzer>(); final Map<String, Analyzer> fieldAnalyzers = new HashMap<String, Analyzer>();
fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer()); fieldAnalyzers.put(Fields.DOCUMENT_KEY, new KeywordAnalyzer());
return new PerFieldAnalyzerWrapper(new FieldAnalyzer(LuceneUtils.CURRENT_VERSION), fieldAnalyzers); return new PerFieldAnalyzerWrapper(new FieldAnalyzer(LuceneUtils.CURRENT_VERSION), fieldAnalyzers);
} }

View File

@@ -19,7 +19,6 @@ package org.owasp.dependencycheck.data.lucene;
import java.io.IOException; import java.io.IOException;
import java.util.LinkedList; import java.util.LinkedList;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.lucene.analysis.TokenFilter; import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream; import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;