in src/main/java/org/jetbrains/plugins/spotbugs/actions/AnalyzeModuleFiles.java [66:109]
void analyze(
@NotNull final AnActionEvent e,
@NotNull final Project project,
@NotNull final ToolWindow toolWindow,
@NotNull final FindBugsState state
) {
final Module module = getModule(e);
new FindBugsStarter(project, "Running SpotBugs analysis for module'" + module.getName() + "'...") {
@Override
protected void createCompileScope(@NotNull final CompilerManager compilerManager, @NotNull final Consumer<CompileScope> consumer) {
consumer.consume(compilerManager.createModuleCompileScope(module, true));
}
@Override
protected boolean configure(@NotNull final ProgressIndicator indicator, @NotNull final FindBugsProjects projects, final boolean justCompiled) {
final CompilerModuleExtension extension = CompilerModuleExtension.getInstance(module);
if (extension == null) {
throw new IllegalStateException("No compiler extension for module " + module.getName());
}
final VirtualFile compilerOutputPath = extension.getCompilerOutputPath();
if (compilerOutputPath == null) {
showWarning(ResourcesLoader.getString("analysis.moduleNotCompiled", module.getName()));
return false;
}
VirtualFile compilerOutputPathForTests = null;
if (includeTests) {
compilerOutputPathForTests = extension.getCompilerOutputPathForTests();
}
indicator.setText("Collecting files for analysis...");
final FindBugsProject findBugsProject = projects.get(module, includeTests && compilerOutputPathForTests != null);
final int[] count = new int[1];
RecurseFileCollector.addFiles(project, indicator, findBugsProject, new File(compilerOutputPath.getCanonicalPath()), count);
if (compilerOutputPathForTests != null) {
RecurseFileCollector.addFiles(project, indicator, findBugsProject, new File(compilerOutputPathForTests.getCanonicalPath()), count);
}
return true;
}
}.start();
}