]> source.dussan.org Git - sonarqube.git/blob
c7d5ca07703a7ed06bf5e08f12405c483cd872f8
[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     DbMigrationsStep.class,
43     GenerateAnalysisUuid.class,
44
45     // Builds Component tree
46     LoadReportAnalysisMetadataHolderStep.class,
47     ExecuteStatelessInitExtensionsStep.class,
48     VerifyBillingStep.class,
49     BuildComponentTreeStep.class,
50     ValidateProjectStep.class,
51
52     LoadQualityProfilesStep.class,
53
54     // load project related stuffs
55     LoadQualityGateStep.class,
56     LoadPeriodsStep.class,
57     FileMoveDetectionStep.class,
58
59     // load duplications related stuff
60     LoadDuplicationsFromReportStep.class,
61     LoadCrossProjectDuplicationsRepositoryStep.class,
62
63     // data computation
64     SizeMeasuresStep.class,
65     NewCoverageMeasuresStep.class,
66     CoverageMeasuresStep.class,
67     CommentMeasuresStep.class,
68     CustomMeasuresCopyStep.class,
69     DuplicationMeasuresStep.class,
70     NewSizeMeasuresStep.class,
71     LanguageDistributionMeasuresStep.class,
72     UnitTestMeasuresStep.class,
73     ComplexityMeasuresStep.class,
74
75     LoadMeasureComputersStep.class,
76     RegisterQualityProfileStatusStep.class,
77     ExecuteVisitorsStep.class,
78
79     PostMeasuresComputationChecksStep.class,
80
81     QualityGateMeasuresStep.class,
82     // Must be executed after computation of language distribution
83     ComputeQProfileMeasureStep.class,
84     // Must be executed after computation of quality profile measure
85     QualityProfileEventsStep.class,
86
87     // Must be executed after computation of quality gate measure
88     QualityGateEventsStep.class,
89
90     // Persist data
91     PersistComponentsStep.class,
92     PersistAnalysisStep.class,
93     PersistAnalysisPropertiesStep.class,
94     PersistMeasuresStep.class,
95     PersistLiveMeasuresStep.class,
96     PersistDuplicationDataStep.class,
97     PersistAdHocRulesStep.class,
98     PersistIssuesStep.class,
99     PersistProjectLinksStep.class,
100     PersistEventsStep.class,
101     PersistFileSourcesStep.class,
102     PersistCrossProjectDuplicationIndexStep.class,
103     EnableAnalysisStep.class,
104
105     UpdateQualityProfilesLastUsedDateStep.class,
106     PurgeDatastoresStep.class,
107     IndexAnalysisStep.class,
108     UpdateNeedIssueSyncStep.class,
109
110     // notifications are sent at the end, so that webapp displays up-to-date information
111     SendIssueNotificationsStep.class,
112
113     PublishTaskResultStep.class,
114     TriggerViewRefreshStep.class);
115
116   public ReportComputationSteps(TaskContainer taskContainer) {
117     super(taskContainer);
118   }
119
120   /**
121    * List of all {@link ComputationStep},
122    * ordered by execution sequence.
123    */
124   @Override
125   public List<Class<? extends ComputationStep>> orderedStepClasses() {
126     return STEPS;
127   }
128
129 }