]> source.dussan.org Git - sonarqube.git/blob
975422d8b268b27b777198b6c3ee451820308c37
[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
28 /**
29  * Ordered list of steps classes and instances to be executed for batch processing
30  */
31 public class ReportComputationSteps extends AbstractComputationSteps {
32
33   private static final List<Class<? extends ComputationStep>> STEPS = Arrays.asList(
34     ExtractReportStep.class,
35     PersistScannerContextStep.class,
36     GenerateAnalysisUuid.class,
37
38     // Builds Component tree
39     LoadReportAnalysisMetadataHolderStep.class,
40     VerifyBillingStep.class,
41     BuildComponentTreeStep.class,
42     ValidateProjectStep.class,
43
44     LoadQualityProfilesStep.class,
45     
46     // copy data in the incremental mode
47     IncrementalMeasureTransitionStep.class,
48
49     // load project related stuffs
50     LoadQualityGateStep.class,
51     LoadPeriodsStep.class,
52     FileMoveDetectionStep.class,
53
54     // load duplications related stuff
55     LoadDuplicationsFromReportStep.class,
56     LoadCrossProjectDuplicationsRepositoryStep.class,
57
58     // data computation
59     SizeMeasuresStep.class,
60     NewCoverageMeasuresStep.class,
61     CoverageMeasuresStep.class,
62     CommentMeasuresStep.class,
63     CustomMeasuresCopyStep.class,
64     DuplicationMeasuresStep.class,
65     DuplicationDataMeasuresStep.class,
66     NewSizeMeasuresStep.class,
67     LanguageDistributionMeasuresStep.class,
68     UnitTestMeasuresStep.class,
69     ComplexityMeasuresStep.class,
70
71     LoadMeasureComputersStep.class,
72     ExecuteVisitorsStep.class,
73
74     // Must be executed after computation of all measures
75     ComputeMeasureVariationsStep.class,
76
77     // Must be executed after computation of differential measures
78     QualityGateMeasuresStep.class,
79     // Must be executed after computation of language distribution
80     ComputeQProfileMeasureStep.class,
81     // Must be executed after computation of quality profile measure
82     QualityProfileEventsStep.class,
83
84     // Must be executed after computation of quality gate measure
85     QualityGateEventsStep.class,
86
87     // Persist data
88     PersistComponentsStep.class,
89     PersistAnalysisStep.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 }