]> source.dussan.org Git - sonarqube.git/blob
9eda77e3c9a0acf69779adb904247f9ae2264083
[sonarqube.git] /
1 /*
2  * SonarQube
3  * Copyright (C) 2009-2020 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.measure.PostMeasuresComputationChecksStep;
27 import org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep;
28 import org.sonar.ce.task.projectanalysis.qualityprofile.RegisterQualityProfileStatusStep;
29 import org.sonar.ce.task.projectanalysis.source.PersistFileSourcesStep;
30 import org.sonar.ce.task.step.ComputationStep;
31 import org.sonar.ce.task.step.ExecuteStatelessInitExtensionsStep;
32
33 /**
34  * Ordered list of steps classes and instances to be executed for batch processing
35  */
36 public class ReportComputationSteps extends AbstractComputationSteps {
37
38   private static final List<Class<? extends ComputationStep>> STEPS = Arrays.asList(
39     ExtractReportStep.class,
40     PersistScannerContextStep.class,
41     PersistAnalysisWarningsStep.class,
42     GenerateAnalysisUuid.class,
43
44     // Builds Component tree
45     LoadReportAnalysisMetadataHolderStep.class,
46     ExecuteStatelessInitExtensionsStep.class,
47     VerifyBillingStep.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     // Persist data
90     PersistComponentsStep.class,
91     PersistAnalysisStep.class,
92     PersistAnalysisPropertiesStep.class,
93     PersistMeasuresStep.class,
94     PersistLiveMeasuresStep.class,
95     PersistDuplicationDataStep.class,
96     PersistAdHocRulesStep.class,
97     PersistIssuesStep.class,
98     PersistProjectLinksStep.class,
99     PersistEventsStep.class,
100     PersistFileSourcesStep.class,
101     PersistCrossProjectDuplicationIndexStep.class,
102     EnableAnalysisStep.class,
103
104     UpdateQualityProfilesLastUsedDateStep.class,
105     PurgeDatastoresStep.class,
106     IndexAnalysisStep.class,
107     UpdateNeedIssueSyncStep.class,
108
109     // notifications are sent at the end, so that webapp displays up-to-date information
110     SendIssueNotificationsStep.class,
111
112     PublishTaskResultStep.class,
113     TriggerViewRefreshStep.class);
114
115   public ReportComputationSteps(TaskContainer taskContainer) {
116     super(taskContainer);
117   }
118
119   /**
120    * List of all {@link ComputationStep},
121    * ordered by execution sequence.
122    */
123   @Override
124   public List<Class<? extends ComputationStep>> orderedStepClasses() {
125     return STEPS;
126   }
127
128 }