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