3 * Copyright (C) 2009-2024 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,
56 SqUpgradeDetectionEventsStep.class,
58 // load project related stuffs
59 LoadFileHashesAndStatusStep.class,
60 LoadQualityGateStep.class,
61 LoadPeriodsStep.class,
62 FileMoveDetectionStep.class,
63 PullRequestFileMoveDetectionStep.class,
65 // load duplications related stuff
66 LoadDuplicationsFromReportStep.class,
67 LoadCrossProjectDuplicationsRepositoryStep.class,
70 SizeMeasuresStep.class,
71 NewCoverageMeasuresStep.class,
72 CoverageMeasuresStep.class,
73 CommentMeasuresStep.class,
74 DuplicationMeasuresStep.class,
75 NewSizeMeasuresStep.class,
76 LanguageDistributionMeasuresStep.class,
77 UnitTestMeasuresStep.class,
78 ComplexityMeasuresStep.class,
80 LoadMeasureComputersStep.class,
81 RegisterQualityProfileStatusStep.class,
82 ExecuteVisitorsStep.class,
84 PostMeasuresComputationChecksStep.class,
86 // Must be executed after visitors execution
87 PullRequestFixedIssuesMeasureStep.class,
89 QualityGateMeasuresStep.class,
90 // Must be executed after computation of language distribution
91 ComputeQProfileMeasureStep.class,
92 // Must be executed after computation of quality profile measure
93 QualityProfileEventsStep.class,
95 // Must be executed after computation of quality gate measure
96 QualityGateEventsStep.class,
97 IssueDetectionEventsStep.class,
99 HandleUnanalyzedLanguagesStep.class,
102 PersistScannerAnalysisCacheStep.class,
103 PersistComponentsStep.class,
104 PersistAnalysisStep.class,
105 PersistAnalysisPropertiesStep.class,
106 PersistMeasuresStep.class,
107 PersistLiveMeasuresStep.class,
108 PersistDuplicationDataStep.class,
109 PersistAdHocRulesStep.class,
110 PersistIssuesStep.class,
111 CleanIssueChangesStep.class,
112 PersistProjectLinksStep.class,
113 PersistEventsStep.class,
114 PersistFileSourcesStep.class,
115 PersistCrossProjectDuplicationIndexStep.class,
116 EnableAnalysisStep.class,
117 PersistPullRequestFixedIssueStep.class,
119 UpdateQualityProfilesLastUsedDateStep.class,
120 PurgeDatastoresStep.class,
121 LoadChangedIssuesStep.class,
122 IndexAnalysisStep.class,
123 UpdateNeedIssueSyncStep.class,
124 ProjectNclocComputationStep.class,
125 PersistPushEventsStep.class,
127 // notifications are sent at the end, so that webapp displays up-to-date information
128 SendIssueNotificationsStep.class,
130 PublishTaskResultStep.class,
131 TriggerViewRefreshStep.class);
133 public ReportComputationSteps(TaskContainer taskContainer) {
134 super(taskContainer);
138 * List of all {@link ComputationStep},
139 * ordered by execution sequence.
142 public List<Class<? extends ComputationStep>> orderedStepClasses() {