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