3 * Copyright (C) 2009-2020 SonarSource SA
4 * mailto:info AT sonarsource DOT com
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.
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.
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.
20 package org.sonar.ce.task.projectanalysis.step;
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;
34 * Ordered list of steps classes and instances to be executed for batch processing
36 public class ReportComputationSteps extends AbstractComputationSteps {
38 private static final List<Class<? extends ComputationStep>> STEPS = Arrays.asList(
39 ExtractReportStep.class,
40 PersistScannerContextStep.class,
41 PersistAnalysisWarningsStep.class,
42 GenerateAnalysisUuid.class,
44 // Builds Component tree
45 LoadReportAnalysisMetadataHolderStep.class,
46 ExecuteStatelessInitExtensionsStep.class,
47 VerifyBillingStep.class,
48 BuildComponentTreeStep.class,
49 ValidateProjectStep.class,
51 LoadQualityProfilesStep.class,
53 // load project related stuffs
54 LoadQualityGateStep.class,
55 LoadPeriodsStep.class,
56 FileMoveDetectionStep.class,
58 // load duplications related stuff
59 LoadDuplicationsFromReportStep.class,
60 LoadCrossProjectDuplicationsRepositoryStep.class,
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,
74 LoadMeasureComputersStep.class,
75 RegisterQualityProfileStatusStep.class,
76 ExecuteVisitorsStep.class,
78 PostMeasuresComputationChecksStep.class,
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,
86 // Must be executed after computation of quality gate measure
87 QualityGateEventsStep.class,
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,
104 UpdateQualityProfilesLastUsedDateStep.class,
105 PurgeDatastoresStep.class,
106 IndexAnalysisStep.class,
107 UpdateNeedIssueSyncStep.class,
109 // notifications are sent at the end, so that webapp displays up-to-date information
110 SendIssueNotificationsStep.class,
112 PublishTaskResultStep.class,
113 TriggerViewRefreshStep.class);
115 public ReportComputationSteps(TaskContainer taskContainer) {
116 super(taskContainer);
120 * List of all {@link ComputationStep},
121 * ordered by execution sequence.
124 public List<Class<? extends ComputationStep>> orderedStepClasses() {