mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-15 00:03:43 +01:00
disable RubyBundlerAnalyzer if RubyBundleAuditAnalyzer
This commit is contained in:
@@ -203,21 +203,25 @@ public class RubyBundleAuditAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
@Override
|
||||
protected void analyzeFileType(Dependency dependency, Engine engine)
|
||||
throws AnalysisException {
|
||||
// if (needToDisableGemspecAnalyzer) {
|
||||
// boolean failed = true;
|
||||
// final String className = RubyGemspecAnalyzer.class.getName();
|
||||
// for (FileTypeAnalyzer analyzer : engine.getFileTypeAnalyzers()) {
|
||||
// if (analyzer instanceof RubyGemspecAnalyzer) {
|
||||
// ((RubyGemspecAnalyzer) analyzer).setEnabled(false);
|
||||
// LOGGER.info("Disabled " + className + " to avoid noisy duplicate results.");
|
||||
// failed = false;
|
||||
// }
|
||||
// }
|
||||
// if (failed) {
|
||||
// LOGGER.warn("Did not find" + className + '.');
|
||||
// }
|
||||
// needToDisableGemspecAnalyzer = false;
|
||||
// }
|
||||
if (needToDisableGemspecAnalyzer) {
|
||||
boolean failed = true;
|
||||
final String className = RubyGemspecAnalyzer.class.getName();
|
||||
for (FileTypeAnalyzer analyzer : engine.getFileTypeAnalyzers()) {
|
||||
if (analyzer instanceof RubyBundlerAnalyzer) {
|
||||
((RubyBundlerAnalyzer) analyzer).setEnabled(false);
|
||||
LOGGER.info("Disabled " + RubyBundlerAnalyzer.class.getName() + " to avoid noisy duplicate results.");
|
||||
}
|
||||
else if (analyzer instanceof RubyGemspecAnalyzer) {
|
||||
((RubyGemspecAnalyzer) analyzer).setEnabled(false);
|
||||
LOGGER.info("Disabled " + className + " to avoid noisy duplicate results.");
|
||||
failed = false;
|
||||
}
|
||||
}
|
||||
if (failed) {
|
||||
LOGGER.warn("Did not find " + className + '.');
|
||||
}
|
||||
needToDisableGemspecAnalyzer = false;
|
||||
}
|
||||
final File parentFile = dependency.getActualFile().getParentFile();
|
||||
final Process process = launchBundleAudit(parentFile);
|
||||
try {
|
||||
|
||||
@@ -181,9 +181,7 @@ public class RubyBundleAuditAnalyzerTest extends BaseTest {
|
||||
|
||||
final Engine engine = new Engine();
|
||||
engine.scan(BaseTest.getResourceAsFile(this,
|
||||
// "ruby/vulnerable/gems/chef-12.8.4/"));
|
||||
"ruby/vulnerable/gems/rails-4.1.15/"));
|
||||
// "java"));
|
||||
engine.analyzeDependencies();
|
||||
|
||||
List<Dependency> dependencies = engine.getDependencies();
|
||||
|
||||
Reference in New Issue
Block a user