private boolean isIssuesMode() { return getComponentByType(GlobalAnalysisMode.class).isIssues(); }
private boolean isTherePreviousAnalysis() { return getComponentByType(ProjectRepositories.class).lastAnalysisDate() != null; }
@Override public void analysisCompleted(ProjectScanContainer container) { LOG.info("Store analysis results in memory for later assertions in medium test"); for (TrackedIssue issue : container.getComponentByType(IssueCache.class).all()) { issues.add(issue); } ReportPublisher reportPublisher = container.getComponentByType(ReportPublisher.class); reader = new ScannerReportReader(reportPublisher.getReportDir().toFile()); project = container.getComponentByType(InputProject.class); storeFs(container); }
private void storeFs(ProjectScanContainer container) { InputComponentStore inputFileCache = container.getComponentByType(InputComponentStore.class); for (InputFile inputPath : inputFileCache.inputFiles()) { inputFilesByKeys.put(((DefaultInputFile) inputPath).getProjectRelativePath(), inputPath); } }
private void addScannerExtensions() { getComponentByType(CoreExtensionsInstaller.class) .install(this, noExtensionFilter(), extension -> getScannerProjectExtensionsFilter().accept(extension)); getComponentByType(ExtensionInstaller.class) .install(this, getScannerProjectExtensionsFilter()); }
@Override protected void doBeforeStart() { addScannerComponents(); addScannerExtensions(); ProjectLock lock = getComponentByType(ProjectLock.class); lock.tryLock(); getComponentByType(WorkDirectoriesInitializer.class).execute(); if (!isIssuesMode()) { addReportPublishSteps(); } else if (isTherePreviousAnalysis()) { addIssueTrackingComponents(); } }
@Override protected void doAfterStart() { GlobalAnalysisMode analysisMode = getComponentByType(GlobalAnalysisMode.class); InputModuleHierarchy tree = getComponentByType(InputModuleHierarchy.class); ScanProperties properties = getComponentByType(ScanProperties.class); properties.validate(); BranchConfiguration branchConfig = getComponentByType(BranchConfiguration.class); if (branchConfig.branchType() == BranchType.PULL_REQUEST) { LOG.info("Pull request {} for merge into {} from {}", branchConfig.pullRequestKey(), pullRequestBaseToDisplayName(branchConfig.targetScmBranch()), branchConfig.branchName()); getComponentByType(ProjectFileIndexer.class).index(); getComponentByType(QProfileVerifier.class).execute(); getComponentByType(ProjectSensorsExecutor.class).execute(); getComponentByType(ScmPublisher.class).publish(); getComponentByType(IssueTransition.class).execute(); getComponentByType(JSONReport.class).execute(); LOG.info("ANALYSIS SUCCESSFUL"); } else { getComponentByType(CpdExecutor.class).execute(); getComponentByType(ReportPublisher.class).execute(); getComponentByType(PostJobsExecutor.class).execute(); getComponentByType(AnalysisObservers.class).notifyEndOfScanTask();
private boolean isIssuesMode() { return getComponentByType(GlobalAnalysisMode.class).isIssues(); }
private boolean isTherePreviousAnalysis() { return getComponentByType(ProjectRepositories.class).lastAnalysisDate() != null; }
@Override public void analysisCompleted(ProjectScanContainer container) { LOG.info("Store analysis results in memory for later assertions in medium test"); for (TrackedIssue issue : container.getComponentByType(IssueCache.class).all()) { issues.add(issue); } ReportPublisher reportPublisher = container.getComponentByType(ReportPublisher.class); reader = new ScannerReportReader(reportPublisher.getReportDir().toFile()); project = container.getComponentByType(InputProject.class); storeFs(container); }
private void storeFs(ProjectScanContainer container) { InputComponentStore inputFileCache = container.getComponentByType(InputComponentStore.class); for (InputFile inputPath : inputFileCache.inputFiles()) { inputFilesByKeys.put(((DefaultInputFile) inputPath).getProjectRelativePath(), inputPath); } }
private void addScannerExtensions() { getComponentByType(CoreExtensionsInstaller.class) .install(this, noExtensionFilter(), extension -> getScannerProjectExtensionsFilter().accept(extension)); getComponentByType(ExtensionInstaller.class) .install(this, getScannerProjectExtensionsFilter()); }
@Override protected void doBeforeStart() { addScannerComponents(); addScannerExtensions(); ProjectLock lock = getComponentByType(ProjectLock.class); lock.tryLock(); getComponentByType(WorkDirectoriesInitializer.class).execute(); if (!isIssuesMode()) { addReportPublishSteps(); } else if (isTherePreviousAnalysis()) { addIssueTrackingComponents(); } }
@Override protected void doAfterStart() { GlobalAnalysisMode analysisMode = getComponentByType(GlobalAnalysisMode.class); InputModuleHierarchy tree = getComponentByType(InputModuleHierarchy.class); ScanProperties properties = getComponentByType(ScanProperties.class); properties.validate(); BranchConfiguration branchConfig = getComponentByType(BranchConfiguration.class); if (branchConfig.branchType() == BranchType.PULL_REQUEST) { LOG.info("Pull request {} for merge into {} from {}", branchConfig.pullRequestKey(), pullRequestBaseToDisplayName(branchConfig.targetScmBranch()), branchConfig.branchName()); getComponentByType(ProjectFileIndexer.class).index(); getComponentByType(QProfileVerifier.class).execute(); getComponentByType(ProjectSensorsExecutor.class).execute(); getComponentByType(ScmPublisher.class).publish(); getComponentByType(IssueTransition.class).execute(); getComponentByType(JSONReport.class).execute(); LOG.info("ANALYSIS SUCCESSFUL"); } else { getComponentByType(CpdExecutor.class).execute(); getComponentByType(ReportPublisher.class).execute(); getComponentByType(PostJobsExecutor.class).execute(); getComponentByType(AnalysisObservers.class).notifyEndOfScanTask();