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 DbMigrationsStep.class,
43 GenerateAnalysisUuid.class,
45 // Builds Component tree
46 LoadReportAnalysisMetadataHolderStep.class,
47 ExecuteStatelessInitExtensionsStep.class,
48 VerifyBillingStep.class,
49 BuildComponentTreeStep.class,
50 ValidateProjectStep.class,
52 LoadQualityProfilesStep.class,
54 // load project related stuffs
55 LoadQualityGateStep.class,
56 LoadPeriodsStep.class,
57 FileMoveDetectionStep.class,
59 // load duplications related stuff
60 LoadDuplicationsFromReportStep.class,
61 LoadCrossProjectDuplicationsRepositoryStep.class,
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,
75 LoadMeasureComputersStep.class,
76 RegisterQualityProfileStatusStep.class,
77 ExecuteVisitorsStep.class,
79 PostMeasuresComputationChecksStep.class,
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,
87 // Must be executed after computation of quality gate measure
88 QualityGateEventsStep.class,
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,
105 UpdateQualityProfilesLastUsedDateStep.class,
106 PurgeDatastoresStep.class,
107 IndexAnalysisStep.class,
108 UpdateNeedIssueSyncStep.class,
110 // notifications are sent at the end, so that webapp displays up-to-date information
111 SendIssueNotificationsStep.class,
113 PublishTaskResultStep.class,
114 TriggerViewRefreshStep.class);
116 public ReportComputationSteps(TaskContainer taskContainer) {
117 super(taskContainer);
121 * List of all {@link ComputationStep},
122 * ordered by execution sequence.
125 public List<Class<? extends ComputationStep>> orderedStepClasses() {