Skip to content

Commit

Permalink
Remove deprecated code.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jan 10, 2024
1 parent f7a00f8 commit 33ce1b8
Show file tree
Hide file tree
Showing 26 changed files with 39 additions and 482 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/
public class AggregatedTrendAction implements Action, AsyncConfigurableTrendChart {
private static final int MIN_TOOLS = 2;
private static final String EMPTY = "{}";

private final Job<?, ?> owner;

Expand Down Expand Up @@ -76,17 +75,6 @@ private Set<AnalysisHistory> createBuildHistory() {
}
}

/**
* Returns the trend chart model that renders the aggregated build results.
*
* @return the trend chart
* @deprecated replaced {@link #getConfigurableBuildTrendModel(String)}
*/
@Deprecated
public String getBuildTrendModel() {
return getConfigurableBuildTrendModel(EMPTY);
}

/**
* Returns the trend chart model that renders the aggregated build results.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public enum QualityGateEvaluationMode {
*/
public enum JobResultEvaluationMode {
/**
* Only those jobs are considered that did not fail. I.e. jobs with result {@link Result#UNSTABLE} or {@link
* Only those jobs are considered that did not fail. I.e., jobs with result {@link Result#UNSTABLE} or {@link
* Result#SUCCESS}.
*/
NO_JOB_FAILURE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

import io.jenkins.plugins.analysis.core.charts.JenkinsBuild;
import io.jenkins.plugins.analysis.core.util.IssuesStatistics;
import io.jenkins.plugins.analysis.core.util.IssuesStatisticsBuilder;
import io.jenkins.plugins.analysis.core.util.StaticAnalysisRun;
import io.jenkins.plugins.forensics.blame.Blames;
import io.jenkins.plugins.forensics.blame.BlamesXmlStream;
Expand Down Expand Up @@ -60,7 +59,7 @@ public class AnalysisResult implements Serializable, StaticAnalysisRun {

private final String id;

private IssuesStatistics totals;
private final IssuesStatistics totals;

private final Map<String, Integer> sizePerOrigin;
private final List<String> errors;
Expand Down Expand Up @@ -266,22 +265,6 @@ protected AnalysisResult(final Run<?, ?> owner, final String id, final DeltaRepo
* @return this
*/
protected Object readResolve() {
if (totals == null) {
IssuesStatisticsBuilder builder = new IssuesStatisticsBuilder();

builder.setTotalErrorSize(sizePerSeverity.getOrDefault(Severity.ERROR, 0));
builder.setTotalHighSize(sizePerSeverity.getOrDefault(Severity.WARNING_HIGH, 0));
builder.setTotalNormalSize(sizePerSeverity.getOrDefault(Severity.WARNING_NORMAL, 0));
builder.setTotalLowSize(sizePerSeverity.getOrDefault(Severity.WARNING_LOW, 0));

builder.setNewErrorSize(newSizePerSeverity.getOrDefault(Severity.ERROR, 0));
builder.setNewHighSize(newSizePerSeverity.getOrDefault(Severity.WARNING_HIGH, 0));
builder.setNewNormalSize(newSizePerSeverity.getOrDefault(Severity.WARNING_NORMAL, 0));
builder.setNewLowSize(newSizePerSeverity.getOrDefault(Severity.WARNING_LOW, 0));

builder.setFixedSize(fixedSize);
totals = builder.build();
}
if (qualityGateResult == null && qualityGateStatus != null) {
qualityGateResult = new QualityGateResult(qualityGateStatus);
}
Expand Down Expand Up @@ -445,7 +428,7 @@ public boolean hasNoNewWarnings() {
}

/**
* Returns all outstanding issues of the associated static analysis run. I.e. all issues, that are part of the
* Returns all outstanding issues of the associated static analysis run. I.e., all issues that are part of the
* current and previous report.
*
* @return all outstanding issues
Expand All @@ -457,7 +440,7 @@ public Report getOutstandingIssues() {
}

/**
* Returns all new issues of the associated static analysis run. I.e. all issues, that are part of the current
* Returns all new issues of the associated static analysis run. I.e., all issues that are part of the current
* report but have not been shown up in the previous report.
*
* @return all new issues
Expand All @@ -469,7 +452,7 @@ public Report getNewIssues() {
}

/**
* Returns all fixed issues of the associated static analysis run. I.e. all issues, that are part of the previous
* Returns all fixed issues of the associated static analysis run. I.e., all issues that are part of the previous
* report but are not present in the current report anymore.
*
* @return all fixed issues
Expand All @@ -480,6 +463,7 @@ public Report getFixedIssues() {
"fixed");
}

@CheckForNull
private WeakReference<Report> getOutstandingIssuesReference() {
return outstandingIssuesReference;
}
Expand All @@ -488,6 +472,7 @@ private void setOutstandingIssuesReference(final WeakReference<Report> outstandi
this.outstandingIssuesReference = outstandingIssuesReference;
}

@CheckForNull
private WeakReference<Report> getNewIssuesReference() {
return newIssuesReference;
}
Expand All @@ -496,6 +481,7 @@ private void setNewIssuesReference(final WeakReference<Report> newIssuesReferenc
this.newIssuesReference = newIssuesReference;
}

@CheckForNull
private WeakReference<Report> getFixedIssuesReference() {
return fixedIssuesReference;
}
Expand Down Expand Up @@ -623,9 +609,9 @@ public int getTotalErrorsSize() {
}

/**
* Returns the total number of high severity issues in this analysis run.
* Returns the total number of high-severity issues in this analysis run.
*
* @return total number of high severity issues
* @return total number of high-severity issues
*/
public int getTotalHighPrioritySize() {
return getTotalSizeOf(Severity.WARNING_HIGH);
Expand All @@ -641,9 +627,9 @@ public int getTotalNormalPrioritySize() {
}

/**
* Returns the total number of low severity issues in this analysis run.
* Returns the total number of low-severity issues in this analysis run.
*
* @return total number of low severity of issues
* @return total number of low-severity issues
*/
public int getTotalLowPrioritySize() {
return getTotalSizeOf(Severity.WARNING_LOW);
Expand All @@ -669,27 +655,27 @@ public int getNewErrorSize() {
}

/**
* Returns the number of new high severity issues in this analysis run.
* Returns the number of new high-severity issues in this analysis run.
*
* @return number of new high severity issues
* @return number of new high-severity issues
*/
public int getNewHighPrioritySize() {
return getNewSizeOf(Severity.WARNING_HIGH);
}

/**
* Returns the number of new normal severity issues in this analysis run.
* Returns the number of new normal-severity issues in this analysis run.
*
* @return number of new normal severity issues
* @return number of new normal-severity issues
*/
public int getNewNormalPrioritySize() {
return getNewSizeOf(Severity.WARNING_NORMAL);
}

/**
* Returns the number of new low severity issues in this analysis run.
* Returns the number of new low-severity issues in this analysis run.
*
* @return number of new low severity of issues
* @return number of new low-severity issues
*/
public int getNewLowPrioritySize() {
return getNewSizeOf(Severity.WARNING_LOW);
Expand All @@ -704,45 +690,6 @@ public int getDeltaSize() {
return totals.getDeltaSize();
}

/**
* Old serialization item.
*
* @deprecated Replaced by {@link AnalysisResult#totals}.
*/
@Deprecated @SuppressFBWarnings("SS_SHOULD_BE_STATIC")
private final transient int size = 0;
/**
* Old serialization item.
*
* @deprecated Replaced by {@link AnalysisResult#totals}.
*/
@Deprecated @SuppressFBWarnings("SS_SHOULD_BE_STATIC")
private final transient int newSize = 0;
/**
* Old serialization item.
*
* @deprecated Replaced by {@link AnalysisResult#totals}.
*/
@Deprecated
@SuppressWarnings("DeprecatedIsStillUsed")
private transient int fixedSize;
/**
* Old serialization item.
*
* @deprecated Replaced by {@link AnalysisResult#totals}.
*/
@Deprecated
@SuppressWarnings({"DeprecatedIsStillUsed", "MismatchedQueryAndUpdateOfCollection"})
private final Map<Severity, Integer> sizePerSeverity = new HashMap<>();
/**
* Old serialization item.
*
* @deprecated Replaced by {@link AnalysisResult#totals}.
*/
@Deprecated
@SuppressWarnings({"DeprecatedIsStillUsed", "MismatchedQueryAndUpdateOfCollection"})
private final Map<Severity, Integer> newSizePerSeverity = new HashMap<>();

public Build getBuild() {
return new JenkinsBuild(getOwner());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,21 +319,6 @@ public String getTrendModel() {
return JACKSON_FACADE.toJson(new NewVersusFixedPieChart().create(newIssues, outstandingIssues, fixedIssues));
}

/**
* Returns the UI model for an ECharts line chart that shows the issues stacked by severity.
*
* @param isBuildOnXAxis
* determines whether the Jenkins build number should be used on the X-axis or the date
*
* @return the UI model as JSON
* @deprecated replaced by {@link #getBuildTrend(String)}
*/
@Deprecated
@SuppressWarnings("unused")
public String getBuildTrend(final boolean isBuildOnXAxis) {
return createTrendAsJson(new SeverityTrendChart(), DEFAULT_CONFIGURATION);
}

/**
* Returns the UI model for an ECharts line chart that shows the issues stacked by severity.
*
Expand All @@ -348,21 +333,6 @@ public String getBuildTrend(final String configuration) {
return createTrendAsJson(new SeverityTrendChart(), configuration);
}

/**
* Returns the UI model for an ECharts line chart that shows the issues by tool.
*
* @param isBuildOnXAxis
* determines whether the Jenkins build number should be used on the X-axis or the date
*
* @return the UI model as JSON
* @deprecated replaced by {@link #getToolsTrend(String)}
*/
@Deprecated
@SuppressWarnings("unused")
public String getToolsTrend(final boolean isBuildOnXAxis) {
return createTrendAsJson(new ToolsTrendChart(), DEFAULT_CONFIGURATION);
}

/**
* Returns the UI model for an ECharts line chart that shows the issues by tool.
*
Expand All @@ -377,21 +347,6 @@ public String getToolsTrend(final String configuration) {
return createTrendAsJson(new ToolsTrendChart(), configuration);
}

/**
* Returns the UI model for an ECharts line chart that shows the new and fixed issues.
*
* @param isBuildOnXAxis
* determines whether the Jenkins build number should be used on the X-axis or the date
*
* @return the UI model as JSON
* @deprecated replaced by {@link #getNewVersusFixedTrend(String)}
*/
@Deprecated
@SuppressWarnings("unused")
public String getNewVersusFixedTrend(final boolean isBuildOnXAxis) {
return createTrendAsJson(new NewVersusFixedTrendChart(), DEFAULT_CONFIGURATION);
}

/**
* Returns the UI model for an ECharts line chart that shows the new and fixed issues.
*
Expand All @@ -406,21 +361,6 @@ public String getNewVersusFixedTrend(final String configuration) {
return createTrendAsJson(new NewVersusFixedTrendChart(), configuration);
}

/**
* Returns the UI model for an ECharts line chart that shows the issues by tool.
*
* @param isBuildOnXAxis
* determines whether the Jenkins build number should be used on the X-axis or the date
*
* @return the UI model as JSON
* @deprecated replaced by {@link #getHealthTrend(String)}
*/
@Deprecated
@SuppressWarnings("unused")
public String getHealthTrend(final boolean isBuildOnXAxis) {
return createTrendAsJson(new HealthTrendChart(healthDescriptor), DEFAULT_CONFIGURATION);
}

/**
* Returns the UI model for an ECharts line chart that shows the issues by tool.
*
Expand Down Expand Up @@ -466,7 +406,7 @@ public Report getIssues() {
}

/**
* Returns all new issues of the associated static analysis run. I.e. all issues, that are part of the current
* Returns all new issues of the associated static analysis run. I.e., all issues that are part of the current
* report but have not been shown up in the previous report.
*
* @return all new issues
Expand All @@ -477,7 +417,7 @@ public Report getNewIssues() {
}

/**
* Returns all fixed issues of the associated static analysis run. I.e. all issues, that are part of the previous
* Returns all fixed issues of the associated static analysis run. I.e., all issues that are part of the previous
* report but are not present in the current report anymore.
*
* @return all fixed issues
Expand All @@ -488,7 +428,7 @@ public Report getFixedIssues() {
}

/**
* Returns all outstanding issues of the associated static analysis run. I.e. all issues, that are part of the
* Returns all outstanding issues of the associated static analysis run. I.e., all issues that are part of the
* current and previous report.
*
* @return all outstanding issues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ public class JobAction implements Action, AsyncConfigurableTrendChart {
private final int numberOfTools;
private final TrendChartType trendChartType;

/**
* Creates a new instance of {@link JobAction}.
*
* @param owner
* the job that owns this action
* @param labelProvider
* the label provider
*
* @deprecated use {@link #JobAction(Job, StaticAnalysisLabelProvider, int)}
*/
@Deprecated
public JobAction(final Job<?, ?> owner, final StaticAnalysisLabelProvider labelProvider) {
this(owner, labelProvider, 1);
}

/**
* Creates a new instance of {@link JobAction}.
*
Expand Down Expand Up @@ -181,17 +166,6 @@ public Optional<ResultAction> getLatestAction() {
return createBuildHistory().getBaselineAction();
}

/**
* Returns the trend chart model that renders the aggregated build results.
*
* @return the trend chart
* @deprecated replaced {@link #getConfigurableBuildTrendModel(String)}
*/
@Deprecated
public String getBuildTrendModel() {
return getConfigurableBuildTrendModel("{}");
}

/**
* Returns the trend chart model that renders the build results for a specific action.
*
Expand Down
Loading

0 comments on commit 33ce1b8

Please sign in to comment.