]> source.dussan.org Git - sonarqube.git/blob
731935a5425edc6f2ac176c97db58655814a70a5
[sonarqube.git] /
1 /*
2  * SonarQube
3  * Copyright (C) 2009-2023 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
57     // load project related stuffs
58     LoadFileHashesAndStatusStep.class,
59     LoadQualityGateStep.class,
60     LoadPeriodsStep.class,
61     FileMoveDetectionStep.class,
62     PullRequestFileMoveDetectionStep.class,
63
64     // load duplications related stuff
65     LoadDuplicationsFromReportStep.class,
66     LoadCrossProjectDuplicationsRepositoryStep.class,
67
68     // data computation
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,
78
79     LoadMeasureComputersStep.class,
80     RegisterQualityProfileStatusStep.class,
81     ExecuteVisitorsStep.class,
82
83     PostMeasuresComputationChecksStep.class,
84
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,
90
91     // Must be executed after computation of quality gate measure
92     QualityGateEventsStep.class,
93     IssueDetectionEventsStep.class,
94
95     HandleUnanalyzedLanguagesStep.class,
96
97     // Persist data
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,
113
114     UpdateQualityProfilesLastUsedDateStep.class,
115     PurgeDatastoresStep.class,
116     IndexAnalysisStep.class,
117     UpdateNeedIssueSyncStep.class,
118     ProjectNclocComputationStep.class,
119     PersistPushEventsStep.class,
120
121     // notifications are sent at the end, so that webapp displays up-to-date information
122     SendIssueNotificationsStep.class,
123
124     PublishTaskResultStep.class,
125     TriggerViewRefreshStep.class);
126
127   public ReportComputationSteps(TaskContainer taskContainer) {
128     super(taskContainer);
129   }
130
131   /**
132    * List of all {@link ComputationStep},
133    * ordered by execution sequence.
134    */
135   @Override
136   public List<Class<? extends ComputationStep>> orderedStepClasses() {
137     return STEPS;
138   }
139
140 }