3 * Copyright (C) 2009-2023 SonarSource SA
4 * mailto:info AT sonarsource DOT com
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 package org.sonar.ce.task.projectanalysis.step;
22 import java.util.Arrays;
23 import java.util.List;
24 import org.sonar.ce.task.container.TaskContainer;
25 import org.sonar.ce.task.projectanalysis.filemove.FileMoveDetectionStep;
26 import org.sonar.ce.task.projectanalysis.filemove.PullRequestFileMoveDetectionStep;
27 import org.sonar.ce.task.projectanalysis.language.HandleUnanalyzedLanguagesStep;
28 import org.sonar.ce.task.projectanalysis.measure.PostMeasuresComputationChecksStep;
29 import org.sonar.ce.task.projectanalysis.measure.PreMeasuresComputationChecksStep;
30 import org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep;
31 import org.sonar.ce.task.projectanalysis.qualityprofile.RegisterQualityProfileStatusStep;
32 import org.sonar.ce.task.projectanalysis.source.PersistFileSourcesStep;
33 import org.sonar.ce.task.step.ComputationStep;
34 import org.sonar.ce.task.step.ExecuteStatelessInitExtensionsStep;
37 * Ordered list of steps classes and instances to be executed for batch processing
39 public class ReportComputationSteps extends AbstractComputationSteps {
41 private static final List<Class<? extends ComputationStep>> STEPS = Arrays.asList(
42 ExtractReportStep.class,
43 PersistScannerContextStep.class,
44 PersistAnalysisWarningsStep.class,
45 GenerateAnalysisUuid.class,
47 // Builds Component tree
48 LoadReportAnalysisMetadataHolderStep.class,
49 ExecuteStatelessInitExtensionsStep.class,
50 BuildComponentTreeStep.class,
51 ValidateProjectStep.class,
52 LoadQualityProfilesStep.class,
54 // Pre analysis operations
55 PreMeasuresComputationChecksStep.class,
57 // load project related stuffs
58 LoadFileHashesAndStatusStep.class,
59 LoadQualityGateStep.class,
60 LoadPeriodsStep.class,
61 FileMoveDetectionStep.class,
62 PullRequestFileMoveDetectionStep.class,
64 // load duplications related stuff
65 LoadDuplicationsFromReportStep.class,
66 LoadCrossProjectDuplicationsRepositoryStep.class,
69 SizeMeasuresStep.class,
70 NewCoverageMeasuresStep.class,
71 CoverageMeasuresStep.class,
72 CommentMeasuresStep.class,
73 DuplicationMeasuresStep.class,
74 NewSizeMeasuresStep.class,
75 LanguageDistributionMeasuresStep.class,
76 UnitTestMeasuresStep.class,
77 ComplexityMeasuresStep.class,
79 LoadMeasureComputersStep.class,
80 RegisterQualityProfileStatusStep.class,
81 ExecuteVisitorsStep.class,
83 PostMeasuresComputationChecksStep.class,
85 QualityGateMeasuresStep.class,
86 // Must be executed after computation of language distribution
87 ComputeQProfileMeasureStep.class,
88 // Must be executed after computation of quality profile measure
89 QualityProfileEventsStep.class,
91 // Must be executed after computation of quality gate measure
92 QualityGateEventsStep.class,
93 IssueDetectionEventsStep.class,
95 HandleUnanalyzedLanguagesStep.class,
98 PersistScannerAnalysisCacheStep.class,
99 PersistComponentsStep.class,
100 PersistAnalysisStep.class,
101 PersistAnalysisPropertiesStep.class,
102 PersistMeasuresStep.class,
103 PersistLiveMeasuresStep.class,
104 PersistDuplicationDataStep.class,
105 PersistAdHocRulesStep.class,
106 PersistIssuesStep.class,
107 CleanIssueChangesStep.class,
108 PersistProjectLinksStep.class,
109 PersistEventsStep.class,
110 PersistFileSourcesStep.class,
111 PersistCrossProjectDuplicationIndexStep.class,
112 EnableAnalysisStep.class,
114 UpdateQualityProfilesLastUsedDateStep.class,
115 PurgeDatastoresStep.class,
116 IndexAnalysisStep.class,
117 UpdateNeedIssueSyncStep.class,
118 ProjectNclocComputationStep.class,
119 PersistPushEventsStep.class,
121 // notifications are sent at the end, so that webapp displays up-to-date information
122 SendIssueNotificationsStep.class,
124 PublishTaskResultStep.class,
125 TriggerViewRefreshStep.class);
127 public ReportComputationSteps(TaskContainer taskContainer) {
128 super(taskContainer);
132 * List of all {@link ComputationStep},
133 * ordered by execution sequence.
136 public List<Class<? extends ComputationStep>> orderedStepClasses() {