]> source.dussan.org Git - sonarqube.git/blob
6095afe8a71ea672beab600db4437beb90bb36e3
[sonarqube.git] /
1 /*
2  * SonarQube
3  * Copyright (C) 2009-2024 SonarSource SA
4  * mailto:info AT sonarsource DOT com
5  *
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.
10  *
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.
15  *
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.
19  */
20 package org.sonar.ce.task.projectanalysis.step;
21
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;
35 import org.sonar.ce.task.step.ExecuteStatelessOnFinishStep;
36
37 /**
38  * Ordered list of steps classes and instances to be executed for batch processing
39  */
40 public class ReportComputationSteps extends AbstractComputationSteps {
41
42   private static final List<Class<? extends ComputationStep>> STEPS = Arrays.asList(
43     ExtractReportStep.class,
44     PersistScannerContextStep.class,
45     PersistAnalysisWarningsStep.class,
46     GenerateAnalysisUuid.class,
47
48     // Builds Component tree
49     LoadReportAnalysisMetadataHolderStep.class,
50     ExecuteStatelessInitExtensionsStep.class,
51     BuildComponentTreeStep.class,
52     ValidateProjectStep.class,
53     LoadQualityProfilesStep.class,
54
55     // Pre analysis operations
56     PreMeasuresComputationChecksStep.class,
57     SqUpgradeDetectionEventsStep.class,
58
59     // load project related stuffs
60     LoadFileHashesAndStatusStep.class,
61     LoadQualityGateStep.class,
62     LoadPeriodsStep.class,
63     LoadPrioritizedRulesStep.class,
64     FileMoveDetectionStep.class,
65     PullRequestFileMoveDetectionStep.class,
66
67     // load duplications related stuff
68     LoadDuplicationsFromReportStep.class,
69     LoadCrossProjectDuplicationsRepositoryStep.class,
70
71     // data computation
72     SizeMeasuresStep.class,
73     NewCoverageMeasuresStep.class,
74     CoverageMeasuresStep.class,
75     CommentMeasuresStep.class,
76     DuplicationMeasuresStep.class,
77     NewSizeMeasuresStep.class,
78     LanguageDistributionMeasuresStep.class,
79     UnitTestMeasuresStep.class,
80     ComplexityMeasuresStep.class,
81
82     LoadMeasureComputersStep.class,
83     RegisterQualityProfileStatusStep.class,
84     ExecuteVisitorsStep.class,
85
86     PostMeasuresComputationChecksStep.class,
87
88     // Must be executed after visitors execution
89     PullRequestFixedIssuesMeasureStep.class,
90
91     QualityGateMeasuresStep.class,
92     // Must be executed after computation of language distribution
93     ComputeQProfileMeasureStep.class,
94     // Must be executed after computation of quality profile measure
95     QualityProfileEventsStep.class,
96
97     // Must be executed after computation of quality gate measure
98     QualityGateEventsStep.class,
99     IssueDetectionEventsStep.class,
100
101     HandleUnanalyzedLanguagesStep.class,
102
103     // Persist data
104     PersistScannerAnalysisCacheStep.class,
105     PersistComponentsStep.class,
106     PersistAnalysisStep.class,
107     PersistAnalysisPropertiesStep.class,
108     PersistMeasuresStep.class,
109     PersistLiveMeasuresStep.class,
110     PersistDuplicationDataStep.class,
111     PersistAdHocRulesStep.class,
112     PersistIssuesStep.class,
113     CleanIssueChangesStep.class,
114     PersistProjectLinksStep.class,
115     PersistEventsStep.class,
116     PersistFileSourcesStep.class,
117     PersistCrossProjectDuplicationIndexStep.class,
118     EnableAnalysisStep.class,
119     PersistPullRequestFixedIssueStep.class,
120
121     UpdateQualityProfilesLastUsedDateStep.class,
122     PurgeDatastoresStep.class,
123     LoadChangedIssuesStep.class,
124     IndexAnalysisStep.class,
125     UpdateNeedIssueSyncStep.class,
126     ProjectNclocComputationStep.class,
127     PersistPushEventsStep.class,
128
129     // notifications are sent at the end, so that webapp displays up-to-date information
130     SendIssueNotificationsStep.class,
131
132     ExecuteStatelessOnFinishStep.class,
133     PublishTaskResultStep.class,
134     TriggerViewRefreshStep.class);
135
136   public ReportComputationSteps(TaskContainer taskContainer) {
137     super(taskContainer);
138   }
139
140   /**
141    * List of all {@link ComputationStep},
142    * ordered by execution sequence.
143    */
144   @Override
145   public List<Class<? extends ComputationStep>> orderedStepClasses() {
146     return STEPS;
147   }
148
149 }