]> source.dussan.org Git - sonarqube.git/blob
f04fe03a2a999989e38cf191c631c22042303a98
[sonarqube.git] /
1 /*
2  * SonarQube
3  * Copyright (C) 2009-2021 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.language.HandleUnanalyzedLanguagesStep;
27 import org.sonar.ce.task.projectanalysis.measure.PostMeasuresComputationChecksStep;
28 import org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep;
29 import org.sonar.ce.task.projectanalysis.qualityprofile.RegisterQualityProfileStatusStep;
30 import org.sonar.ce.task.projectanalysis.source.PersistFileSourcesStep;
31 import org.sonar.ce.task.step.ComputationStep;
32 import org.sonar.ce.task.step.ExecuteStatelessInitExtensionsStep;
33
34 /**
35  * Ordered list of steps classes and instances to be executed for batch processing
36  */
37 public class ReportComputationSteps extends AbstractComputationSteps {
38
39   private static final List<Class<? extends ComputationStep>> STEPS = Arrays.asList(
40     ExtractReportStep.class,
41     PersistScannerContextStep.class,
42     PersistAnalysisWarningsStep.class,
43     GenerateAnalysisUuid.class,
44
45     // Builds Component tree
46     LoadReportAnalysisMetadataHolderStep.class,
47     ExecuteStatelessInitExtensionsStep.class,
48     BuildComponentTreeStep.class,
49     ValidateProjectStep.class,
50
51     LoadQualityProfilesStep.class,
52
53     // load project related stuffs
54     LoadQualityGateStep.class,
55     LoadPeriodsStep.class,
56     FileMoveDetectionStep.class,
57
58     // load duplications related stuff
59     LoadDuplicationsFromReportStep.class,
60     LoadCrossProjectDuplicationsRepositoryStep.class,
61
62     // data computation
63     SizeMeasuresStep.class,
64     NewCoverageMeasuresStep.class,
65     CoverageMeasuresStep.class,
66     CommentMeasuresStep.class,
67     CustomMeasuresCopyStep.class,
68     DuplicationMeasuresStep.class,
69     NewSizeMeasuresStep.class,
70     LanguageDistributionMeasuresStep.class,
71     UnitTestMeasuresStep.class,
72     ComplexityMeasuresStep.class,
73
74     LoadMeasureComputersStep.class,
75     RegisterQualityProfileStatusStep.class,
76     ExecuteVisitorsStep.class,
77
78     PostMeasuresComputationChecksStep.class,
79
80     QualityGateMeasuresStep.class,
81     // Must be executed after computation of language distribution
82     ComputeQProfileMeasureStep.class,
83     // Must be executed after computation of quality profile measure
84     QualityProfileEventsStep.class,
85
86     // Must be executed after computation of quality gate measure
87     QualityGateEventsStep.class,
88
89     HandleUnanalyzedLanguagesStep.class,
90
91     // Persist data
92     PersistComponentsStep.class,
93     PersistAnalysisStep.class,
94     PersistAnalysisPropertiesStep.class,
95     PersistMeasuresStep.class,
96     PersistLiveMeasuresStep.class,
97     PersistDuplicationDataStep.class,
98     PersistAdHocRulesStep.class,
99     PersistIssuesStep.class,
100     PersistProjectLinksStep.class,
101     PersistEventsStep.class,
102     PersistFileSourcesStep.class,
103     PersistCrossProjectDuplicationIndexStep.class,
104     EnableAnalysisStep.class,
105
106     UpdateQualityProfilesLastUsedDateStep.class,
107     PurgeDatastoresStep.class,
108     IndexAnalysisStep.class,
109     UpdateNeedIssueSyncStep.class,
110     UpdateMainBranchStep.class,
111
112     // notifications are sent at the end, so that webapp displays up-to-date information
113     SendIssueNotificationsStep.class,
114
115     PublishTaskResultStep.class,
116     TriggerViewRefreshStep.class);
117
118   public ReportComputationSteps(TaskContainer taskContainer) {
119     super(taskContainer);
120   }
121
122   /**
123    * List of all {@link ComputationStep},
124    * ordered by execution sequence.
125    */
126   @Override
127   public List<Class<? extends ComputationStep>> orderedStepClasses() {
128     return STEPS;
129   }
130
131 }