3 * Copyright (C) 2009-2021 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.language.HandleUnanalyzedLanguagesStep;
27 import org.sonar.ce.task.projectanalysis.measure.PostMeasuresComputationChecksStep;
28 import org.sonar.ce.task.projectanalysis.purge.PurgeDatastoresStep;
29 import org.sonar.ce.task.projectanalysis.qualityprofile.RegisterQualityProfileStatusStep;
30 import org.sonar.ce.task.projectanalysis.source.PersistFileSourcesStep;
31 import org.sonar.ce.task.step.ComputationStep;
32 import org.sonar.ce.task.step.ExecuteStatelessInitExtensionsStep;
35 * Ordered list of steps classes and instances to be executed for batch processing
37 public class ReportComputationSteps extends AbstractComputationSteps {
39 private static final List<Class<? extends ComputationStep>> STEPS = Arrays.asList(
40 ExtractReportStep.class,
41 PersistScannerContextStep.class,
42 PersistAnalysisWarningsStep.class,
43 GenerateAnalysisUuid.class,
45 // Builds Component tree
46 LoadReportAnalysisMetadataHolderStep.class,
47 ExecuteStatelessInitExtensionsStep.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,
89 HandleUnanalyzedLanguagesStep.class,
92 PersistComponentsStep.class,
93 PersistAnalysisStep.class,
94 PersistAnalysisPropertiesStep.class,
95 PersistMeasuresStep.class,
96 PersistLiveMeasuresStep.class,
97 PersistDuplicationDataStep.class,
98 PersistAdHocRulesStep.class,
99 PersistIssuesStep.class,
100 PersistProjectLinksStep.class,
101 PersistEventsStep.class,
102 PersistFileSourcesStep.class,
103 PersistCrossProjectDuplicationIndexStep.class,
104 EnableAnalysisStep.class,
106 UpdateQualityProfilesLastUsedDateStep.class,
107 PurgeDatastoresStep.class,
108 IndexAnalysisStep.class,
109 UpdateNeedIssueSyncStep.class,
110 UpdateMainBranchStep.class,
112 // notifications are sent at the end, so that webapp displays up-to-date information
113 SendIssueNotificationsStep.class,
115 PublishTaskResultStep.class,
116 TriggerViewRefreshStep.class);
118 public ReportComputationSteps(TaskContainer taskContainer) {
119 super(taskContainer);
123 * List of all {@link ComputationStep},
124 * ordered by execution sequence.
127 public List<Class<? extends ComputationStep>> orderedStepClasses() {