]> source.dussan.org Git - sonarqube.git/blob
725247a3e8b244ebec74803fde4aba7e67a1faa0
[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
36 /**
37  * Ordered list of steps classes and instances to be executed for batch processing
38  */
39 public class ReportComputationSteps extends AbstractComputationSteps {
40
41   private static final List<Class<? extends ComputationStep>> STEPS = Arrays.asList(
42     ExtractReportStep.class,
43     PersistScannerContextStep.class,
44     PersistAnalysisWarningsStep.class,
45     GenerateAnalysisUuid.class,
46
47     // Builds Component tree
48     LoadReportAnalysisMetadataHolderStep.class,
49     ExecuteStatelessInitExtensionsStep.class,
50     BuildComponentTreeStep.class,
51     ValidateProjectStep.class,
52     LoadQualityProfilesStep.class,
53
54     // Pre analysis operations
55     PreMeasuresComputationChecksStep.class,
56     SqUpgradeDetectionEventsStep.class,
57
58     // load project related stuffs
59     LoadFileHashesAndStatusStep.class,
60     LoadQualityGateStep.class,
61     LoadPeriodsStep.class,
62     FileMoveDetectionStep.class,
63     PullRequestFileMoveDetectionStep.class,
64
65     // load duplications related stuff
66     LoadDuplicationsFromReportStep.class,
67     LoadCrossProjectDuplicationsRepositoryStep.class,
68
69     // data computation
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,
79
80     LoadMeasureComputersStep.class,
81     RegisterQualityProfileStatusStep.class,
82     ExecuteVisitorsStep.class,
83
84     PostMeasuresComputationChecksStep.class,
85
86     // Must be executed after visitors execution
87     PullRequestFixedIssuesMeasureStep.class,
88
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,
94
95     // Must be executed after computation of quality gate measure
96     QualityGateEventsStep.class,
97     IssueDetectionEventsStep.class,
98
99     HandleUnanalyzedLanguagesStep.class,
100
101     // Persist data
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,
118
119     UpdateQualityProfilesLastUsedDateStep.class,
120     PurgeDatastoresStep.class,
121     LoadChangedIssuesStep.class,
122     IndexAnalysisStep.class,
123     UpdateNeedIssueSyncStep.class,
124     ProjectNclocComputationStep.class,
125     PersistPushEventsStep.class,
126
127     // notifications are sent at the end, so that webapp displays up-to-date information
128     SendIssueNotificationsStep.class,
129
130     PublishTaskResultStep.class,
131     TriggerViewRefreshStep.class);
132
133   public ReportComputationSteps(TaskContainer taskContainer) {
134     super(taskContainer);
135   }
136
137   /**
138    * List of all {@link ComputationStep},
139    * ordered by execution sequence.
140    */
141   @Override
142   public List<Class<? extends ComputationStep>> orderedStepClasses() {
143     return STEPS;
144   }
145
146 }