public void visitBinaryResource(@NonNull ResourceContext context) { if (binaryDetectors == null) { return; } for (Detector check : binaryDetectors) { check.beforeCheckFile(context); check.checkBinaryResource(context); check.afterCheckFile(context); } } }
private void checkPropertyFile(Project project, Project main, List<Detector> detectors, String relativePath) { File file = new File(project.getDir(), relativePath); if (file.exists()) { Context context = new Context(this, project, main, file); fireEvent(EventType.SCANNING_FILE, context); for (Detector detector : detectors) { detector.beforeCheckFile(context); detector.run(context); detector.afterCheckFile(context); } } }
check.beforeCheckFile(context);
private void checkProGuard(Project project, Project main) { List<Detector> detectors = scopeDetectors.get(Scope.PROGUARD_FILE); if (detectors != null) { List<File> files = project.getProguardFiles(); for (File file : files) { Context context = new Context(this, project, main, file); fireEvent(EventType.SCANNING_FILE, context); for (Detector detector : detectors) { detector.beforeCheckFile(context); detector.run(context); detector.afterCheckFile(context); } } } }
private void checkBuildScripts(Project project, Project main) { List<Detector> detectors = scopeDetectors.get(Scope.GRADLE_FILE); if (detectors != null) { List<File> files = project.getSubset(); if (files == null) { files = project.getGradleBuildScripts(); } for (File file : files) { Context context = new Context(this, project, main, file); fireEvent(EventType.SCANNING_FILE, context); for (Detector detector : detectors) { detector.beforeCheckFile(context); detector.visitBuildScript(context, Maps.newHashMap()); detector.afterCheckFile(context); } } } }
Context context = new Context(driver, project, main, file); for (Detector detector : applicable) { detector.beforeCheckFile(context); detector.run(context); detector.afterCheckFile(context);
check.beforeCheckFile(context);
for (Detector detector : detectors) { if (detector.appliesTo(context, file)) { detector.beforeCheckFile(context); detector.run(context); detector.afterCheckFile(context);
detector.beforeCheckFile(context);
v.getDetector().beforeCheckFile(context);
for (Detector check : dirChecks) { if (check.appliesTo(type)) { check.beforeCheckFile(context); check.checkFolder(context, folderName); check.afterCheckFile(context);
for (VisitingDetector v : allDetectors) { v.setContext(context); v.getDetector().beforeCheckFile(context);