Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

SpotBugs violations #293

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 3 additions & 23 deletions src/main/java/hudson/plugins/jacoco/JacocoPublisher.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package hudson.plugins.jacoco;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.*;
import hudson.model.Result;
import hudson.model.AbstractBuild;
Expand Down Expand Up @@ -49,20 +48,20 @@
/**
* Rule to be enforced. Can be null.
* <p>
* TODO: define a configuration mechanism.

Check warning on line 51 in src/main/java/hudson/plugins/jacoco/JacocoPublisher.java

View check run for this annotation

ci.jenkins.io / Open Tasks Scanner

TODO

NORMAL: define a configuration mechanism.
*/
public Rule rule;
// public Rule rule;
@Deprecated
public transient String includes;
@Deprecated
public transient int moduleNum;
/**
* {@link hudson.model.HealthReport} thresholds to apply.
*/
public JacocoHealthReportThresholds healthReports;
private JacocoHealthReportThresholds healthReports;

// Delta coverage thresholds to apply
public JacocoHealthReportDeltaThresholds deltaHealthReport;
JacocoHealthReportDeltaThresholds deltaHealthReport;


/**
Expand Down Expand Up @@ -799,27 +798,8 @@
return BuildStepMonitor.NONE;
}

@Override
public BuildStepDescriptor<Publisher> getDescriptor() {
return (BuildStepDescriptor<Publisher>)super.getDescriptor();
}

/**
* @deprecated
* use injection via {@link Jenkins#getInjector()}
*/
public static /*final*/ BuildStepDescriptor<Publisher> DESCRIPTOR;

private static void setDescriptor(BuildStepDescriptor<Publisher> descriptor) {
DESCRIPTOR = descriptor;
}

@Extension @Symbol("jacoco")
public static class DescriptorImpl extends BuildStepDescriptor<Publisher> {
public DescriptorImpl() {
super(JacocoPublisher.class);
setDescriptor(this);
}

@NonNull
@Override
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/hudson/plugins/jacoco/model/CoverageObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ public abstract class CoverageObject<SELF extends CoverageObject<SELF>> {
/**
* Variables used to store which child has to highest coverage for each coverage type.
*/
public int maxClazz=1;
public int maxMethod=1;
public int maxLine=1;
public int maxComplexity=1;
public int maxInstruction=1;
public int maxBranch=1;
private int maxClazz=1;
private int maxMethod=1;
private int maxLine=1;
private int maxComplexity=1;
private int maxInstruction=1;
private int maxBranch=1;

private volatile boolean failed = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private CoverageReport(JacocoBuildAction action) {
// private String complexityColor;
// private String lineColor;
// private String methodColor;
public JacocoHealthReportThresholds healthReports;
private JacocoHealthReportThresholds healthReports;

/**
* Loads the exec files using JaCoCo API. Creates the reporting objects and the report tree.
Expand Down