diff --git a/plugin/pom.xml b/plugin/pom.xml
index 8a8653d1b..abc0ea635 100644
--- a/plugin/pom.xml
+++ b/plugin/pom.xml
@@ -35,7 +35,7 @@
false
- 0.66.0
+ 0.67.0
2.11.0
@@ -43,6 +43,7 @@
+
edu.hm.hafner
coverage-model
@@ -87,6 +88,7 @@
jsoup
+
io.jenkins.plugins
ionicons-api
@@ -96,8 +98,6 @@
token-macro
true
-
-
org.jenkins-ci.plugins.workflow
workflow-multibranch
@@ -141,6 +141,7 @@
io.jenkins.plugins
plugin-util-api
+ 7.1320.v684dd26fca_19
io.jenkins.plugins
@@ -149,16 +150,13 @@
io.jenkins.plugins
prism-api
- 1.30.0-719.v61228fb_a_ec4d
-
-
- io.jenkins.plugins
- plugin-util-api
- tests
- test
+ org.jenkins-ci.plugins
+ variant
+
+
org.xmlunit
xmlunit-core
@@ -191,6 +189,33 @@
+
+ org.testcontainers
+ testcontainers
+ ${testcontainers.version}
+ test
+
+
+ org.apache.commons
+ commons-compress
+
+
+
+
+ org.testcontainers
+ junit-jupiter
+ ${testcontainers.version}
+ test
+
+
+
+
+ io.jenkins.plugins
+ plugin-util-api
+ 7.1320.v684dd26fca_19
+ tests
+ test
+
org.jenkins-ci.plugins.workflow
workflow-cps
@@ -252,7 +277,6 @@
timestamper
test
-
org.jenkins-ci.plugins
ssh-credentials
@@ -263,24 +287,6 @@
ssh-slaves
test
-
- org.testcontainers
- testcontainers
- ${testcontainers.version}
- test
-
-
- org.apache.commons
- commons-compress
-
-
-
-
- org.testcontainers
- junit-jupiter
- ${testcontainers.version}
- test
-
io.jenkins
configuration-as-code
diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/FileWithModifiedLines.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/FileWithModifiedLines.java
index d33463e33..838104df2 100644
--- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/FileWithModifiedLines.java
+++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/FileWithModifiedLines.java
@@ -22,12 +22,12 @@ class FileWithModifiedLines {
}
@Exported(inline = true)
- public String getFullyQualifiedFileName() {
+ String getFullyQualifiedFileName() {
return fullyQualifiedFileName;
}
@Exported(inline = true)
- public SortedSet getModifiedLinesBlocks() {
+ SortedSet getModifiedLinesBlocks() {
return modifiedLinesBlocks;
}
diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesBlock.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesBlock.java
index 86f250e64..a7b9539bf 100644
--- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesBlock.java
+++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesBlock.java
@@ -24,17 +24,17 @@ class ModifiedLinesBlock implements Comparable {
}
@Exported
- public int getStartLine() {
+ int getStartLine() {
return startLine;
}
@Exported
- public int getEndLine() {
+ int getEndLine() {
return endLine;
}
@Exported
- public LineCoverageType getType() {
+ LineCoverageType getType() {
return type;
}
diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesCoverageApi.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesCoverageApi.java
index 06087e17e..314f8d785 100644
--- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesCoverageApi.java
+++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/restapi/ModifiedLinesCoverageApi.java
@@ -25,7 +25,7 @@ class ModifiedLinesCoverageApi {
}
@Exported(inline = true, name = "files")
- public List getFilesWithModifiedLines() {
+ List getFilesWithModifiedLines() {
return filesWithModifiedLines;
}
diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/CoverageSourcePrinter.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/CoverageSourcePrinter.java
index 3ecce4785..8c696a05b 100644
--- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/CoverageSourcePrinter.java
+++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/CoverageSourcePrinter.java
@@ -48,7 +48,7 @@ class CoverageSourcePrinter implements Serializable {
modifiedLines = new TreeSet<>(file.getModifiedLines());
}
- public String renderLine(final int line, final String sourceCode) {
+ String renderLine(final int line, final String sourceCode) {
var isPainted = isPainted(line);
return tr()
.withClasses(isPainted ? getColorClass(line) : UNDEFINED, getModifiedClass(line))
@@ -79,7 +79,7 @@ String getModifiedClass(final int line) {
return isModified(line) ? MODIFIED : StringUtils.EMPTY;
}
- public String getColorClass(final int line) {
+ String getColorClass(final int line) {
if (getCovered(line) == 0) {
return NO_COVERAGE;
}
@@ -91,7 +91,7 @@ else if (getMissed(line) == 0) {
}
}
- public String getTooltip(final int line) {
+ String getTooltip(final int line) {
var covered = getCovered(line);
var missed = getMissed(line);
if (covered + missed > 1) {
@@ -111,7 +111,7 @@ else if (covered == 1) {
}
}
- public String getSummaryColumn(final int line) {
+ String getSummaryColumn(final int line) {
var covered = getCovered(line);
var missed = getMissed(line);
if (covered + missed > 1) {
@@ -120,11 +120,11 @@ public String getSummaryColumn(final int line) {
return String.valueOf(covered);
}
- public final String getPath() {
+ final String getPath() {
return path;
}
- public boolean isPainted(final int line) {
+ boolean isPainted(final int line) {
return findIndexOfLine(line) >= 0;
}
@@ -136,11 +136,11 @@ int findIndexOfLine(final int line) {
return Arrays.binarySearch(linesToPaint, line);
}
- public int getCovered(final int line) {
+ int getCovered(final int line) {
return getCounter(line, coveredPerLine);
}
- public int getMissed(final int line) {
+ int getMissed(final int line) {
return getCounter(line, missedPerLine);
}
@@ -152,7 +152,7 @@ int getCounter(final int line, final int... counters) {
return 0;
}
- public String getColumnHeader() {
+ String getColumnHeader() {
return StringUtils.EMPTY;
}
}
diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/MutationSourcePrinter.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/MutationSourcePrinter.java
index ea1b6f846..f6293b71e 100644
--- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/MutationSourcePrinter.java
+++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/source/MutationSourcePrinter.java
@@ -84,11 +84,11 @@ private List asBulletPoints(final List mutations, final
.collect(Collectors.toList());
}
- public int getSurvived(final int line) {
+ int getSurvived(final int line) {
return getCounter(line, survivedPerLine);
}
- public int getKilled(final int line) {
+ int getKilled(final int line) {
return getCounter(line, killedPerLine);
}
diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CodeDeltaCalculator.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CodeDeltaCalculator.java
index 43f59c635..e24d341b7 100644
--- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CodeDeltaCalculator.java
+++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CodeDeltaCalculator.java
@@ -79,7 +79,7 @@ class CodeDeltaCalculator {
*
* @return the {@link Delta code delta} as Optional if existent, else an empty Optional
*/
- public Optional calculateCodeDeltaToReference(final Run, ?> referenceBuild, final FilteredLog log) {
+ Optional calculateCodeDeltaToReference(final Run, ?> referenceBuild, final FilteredLog log) {
return DeltaCalculatorFactory
.findDeltaCalculator(scm, build, workspace, listener, log)
.calculateDelta(build, referenceBuild, log);
@@ -93,7 +93,7 @@ public Optional calculateCodeDeltaToReference(final Run, ?> referenceBu
*
* @return the relevant code changes
*/
- public Set getCoverageRelevantChanges(final Delta delta) {
+ Set getCoverageRelevantChanges(final Delta delta) {
return delta.getFileChangesMap().values().stream()
.filter(fileChange -> fileChange.getFileEditType() == FileEditType.MODIFY
|| fileChange.getFileEditType() == FileEditType.ADD
@@ -116,7 +116,7 @@ public Set getCoverageRelevantChanges(final Delta delta) {
* @throws IllegalStateException
* when creating the mapping failed due to ambiguous paths
*/
- public Map mapScmChangesToReportPaths(
+ Map mapScmChangesToReportPaths(
final Set changes, final Node root, final FilteredLog log) throws IllegalStateException {
Set reportPaths = new HashSet<>(root.getFiles());
Set scmPaths = changes.stream().map(FileChanges::getFileName).collect(Collectors.toSet());
@@ -150,7 +150,7 @@ public Map mapScmChangesToReportPaths(
* @throws IllegalStateException
* if the SCM path mapping is ambiguous
*/
- public Map createOldPathMapping(final Node root, final Node referenceRoot,
+ Map createOldPathMapping(final Node root, final Node referenceRoot,
final Map changes, final FilteredLog log)
throws IllegalStateException {
Set oldReportPaths = new HashSet<>(referenceRoot.getFiles());
diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumn.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumn.java
index fa839370a..2441ef3c1 100644
--- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumn.java
+++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumn.java
@@ -249,8 +249,7 @@ private static CoverageAppearanceConfiguration getConfiguration(final JenkinsFac
/**
* Descriptor of the column.
*/
- @Extension(optional = true)
- @Symbol("coverageTotalsColumn")
+ @Extension @Symbol("coverageTotalsColumn")
public static class CoverageMetricColumnDescriptor extends ListViewColumnDescriptor {
private final JenkinsFacade jenkins;
diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTableModel.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTableModel.java
index b5de91577..1d92b1973 100644
--- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTableModel.java
+++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTableModel.java
@@ -222,48 +222,48 @@ static class CoverageRow {
colorProvider = colors;
}
- public String getFileHash() {
+ String getFileHash() {
return String.valueOf(file.getRelativePath().hashCode());
}
@SuppressWarnings("PMD.BooleanGetMethodName")
- public boolean getModified() {
+ boolean getModified() {
return file.hasModifiedLines();
}
- public DetailedCell> getFileName() {
+ DetailedCell> getFileName() {
return new DetailedCell<>(renderer.renderFileName(file.getName(), file.getRelativePath()), file.getName());
}
- public String getPackageName() {
+ String getPackageName() {
return file.getParentName();
}
- public DetailedCell> getLineCoverage() {
+ DetailedCell> getLineCoverage() {
return createColoredCoverageColumn(getCoverageOfNode(Metric.LINE));
}
- public DetailedCell> getBranchCoverage() {
+ DetailedCell> getBranchCoverage() {
return createColoredCoverageColumn(getCoverageOfNode(Metric.BRANCH));
}
- public DetailedCell> getMethodCoverage() {
+ DetailedCell> getMethodCoverage() {
return createColoredCoverageColumn(getCoverageOfNode(Metric.METHOD));
}
- public DetailedCell> getMcdcPairCoverage() {
+ DetailedCell> getMcdcPairCoverage() {
return createColoredCoverageColumn(getCoverageOfNode(Metric.MCDC_PAIR));
}
- public DetailedCell> getFunctionCallCoverage() {
+ DetailedCell> getFunctionCallCoverage() {
return createColoredCoverageColumn(getCoverageOfNode(Metric.FUNCTION_CALL));
}
- public DetailedCell> getMutationCoverage() {
+ DetailedCell> getMutationCoverage() {
return createColoredCoverageColumn(getCoverageOfNode(Metric.MUTATION));
}
- public DetailedCell> getTestStrength() {
+ DetailedCell> getTestStrength() {
return createColoredCoverageColumn(getCoverageOfNode(Metric.TEST_STRENGTH));
}
@@ -271,43 +271,43 @@ Coverage getCoverageOfNode(final Metric metric) {
return file.getTypedValue(metric, Coverage.nullObject(metric));
}
- public DetailedCell> getLineCoverageDelta() {
+ DetailedCell> getLineCoverageDelta() {
return createColoredFileCoverageDeltaColumn(Metric.LINE);
}
- public DetailedCell> getBranchCoverageDelta() {
+ DetailedCell> getBranchCoverageDelta() {
return createColoredFileCoverageDeltaColumn(Metric.BRANCH);
}
- public DetailedCell> getMutationCoverageDelta() {
+ DetailedCell> getMutationCoverageDelta() {
return createColoredFileCoverageDeltaColumn(Metric.MUTATION);
}
- public DetailedCell> getTestStrengthDelta() {
+ DetailedCell> getTestStrengthDelta() {
return createColoredFileCoverageDeltaColumn(Metric.TEST_STRENGTH);
}
- public int getLoc() {
+ int getLoc() {
return file.getTypedValue(Metric.LOC, ZERO_LOC).asInteger();
}
- public int getTests() {
+ int getTests() {
return file.getTypedValue(Metric.TESTS, ZERO_TESTS).asInteger();
}
- public int getCyclomaticComplexity() {
+ int getCyclomaticComplexity() {
return file.getTypedValue(Metric.CYCLOMATIC_COMPLEXITY, ZERO_CYCLOMATIC_COMPLEXITY).asInteger();
}
- public int getCognitiveComplexity() {
+ int getCognitiveComplexity() {
return file.getTypedValue(Metric.COGNITIVE_COMPLEXITY, ZERO_COGNITIVE_COMPLEXITY).asInteger();
}
- public int getNpathComplexity() {
+ int getNpathComplexity() {
return file.getTypedValue(Metric.NPATH_COMPLEXITY, ZERO_NPATH_COMPLEXITY).asInteger();
}
- public int getNcss() {
+ int getNcss() {
return file.getTypedValue(Metric.NCSS, ZERO_NCSS).asInteger();
}
diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTokenMacro.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTokenMacro.java
index 5cb8f50ba..662d25ffd 100644
--- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTokenMacro.java
+++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageTokenMacro.java
@@ -7,7 +7,7 @@
import java.util.function.Predicate;
import org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro;
-import hudson.Extension;
+import org.jenkinsci.plugins.variant.OptionalExtension;
import hudson.FilePath;
import hudson.model.AbstractBuild;
import hudson.model.Run;
@@ -17,11 +17,11 @@
import io.jenkins.plugins.coverage.metrics.model.ElementFormatter;
/**
- * Provides a token that evaluates to the number of issues.
+ * Provides a token that evaluates the number of issues.
*
* @author Ullrich Hafner
*/
-@Extension(optional = true)
+@OptionalExtension(requireClasses = DataBoundTokenMacro.class)
public class CoverageTokenMacro extends DataBoundTokenMacro {
private static final ElementFormatter FORMATTER = new ElementFormatter();
static final String COVERAGE = "COVERAGE";
diff --git a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageXmlStream.java b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageXmlStream.java
index 2b85ca7ea..98363efca 100644
--- a/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageXmlStream.java
+++ b/plugin/src/main/java/io/jenkins/plugins/coverage/metrics/steps/CoverageXmlStream.java
@@ -66,7 +66,7 @@ private static String[] toArray(final String value) {
}
@VisibleForTesting
- public XStream2 getStream() {
+ XStream2 getStream() {
return createStream();
}
@@ -169,7 +169,7 @@ protected Entry createMapping(final String key, final String valu
* @param
* type of the objects that will be marshalled and unmarshalled
*/
- public static class SimpleConverter implements Converter {
+ static class SimpleConverter implements Converter {
private final Class type;
private final Function marshaller;
private final Function unmarshaller;
diff --git a/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/view-model.js b/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/view-model.js
index aa85e1120..cb7323684 100644
--- a/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/view-model.js
+++ b/plugin/src/main/resources/io/jenkins/plugins/coverage/metrics/steps/CoverageViewModel/view-model.js
@@ -1,4 +1,4 @@
-/* global $, proxy, echartsJenkinsApi, bootstrap5 */
+/* global $, proxy, echartsJenkinsApi, bootstrap5, culori */
(function ($) {
function fillDialog(trendConfiguration, jsonConfiguration) {
@@ -34,7 +34,7 @@
if (colorHex.match(/^#[a-fA-F0-9]{6}$/) !== null) {
colorHexMapping.set(jenkinsId, colorHex);
}
- })
+ });
return colorHexMapping;
}
@@ -42,8 +42,12 @@
return echartsJenkinsApi.resolveJenkinsColor(colorName);
}
- function printPercentage(value, minimumFractionDigits = 2) {
- return Number(value / 100.0).toLocaleString(undefined, {style: 'percent', minimumFractionDigits: minimumFractionDigits});
+ function printPercentage(value, minimumFractionDigits) {
+ const options = {
+ style: 'percent',
+ minimumFractionDigits: minimumFractionDigits ? minimumFractionDigits : 2
+ };
+ return Number(value / 100.0).toLocaleString(undefined, options);
}
const openBuild = function (build) { // NOPMD
@@ -439,7 +443,7 @@
return true;
}
- return false
+ return false;
}
const selectedTabID = 'jenkins-coverage-activeTab';
@@ -595,7 +599,7 @@
else {
showNoSelection();
}
- })
+ });
datatable.on('deselect', function () {
showNoSelection();
});
diff --git a/plugin/src/test/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumnTest.java b/plugin/src/test/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumnTest.java
index 9d6e2e545..1872aab65 100644
--- a/plugin/src/test/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumnTest.java
+++ b/plugin/src/test/java/io/jenkins/plugins/coverage/metrics/steps/CoverageMetricColumnTest.java
@@ -70,7 +70,7 @@ void shouldAllowEnums() {
* @return the created stub
*/
@VisibleForTesting
- public static Job, ?> createJobWithActions(final CoverageBuildAction... actions) {
+ static Job, ?> createJobWithActions(final CoverageBuildAction... actions) {
Job, ?> job = mock(Job.class);
Run, ?> build = createBuildWithActions(actions);
when(job.getLastCompletedBuild()).thenAnswer(a -> build);
@@ -86,7 +86,7 @@ void shouldAllowEnums() {
* @return the created stub
*/
@VisibleForTesting
- public static Run, ?> createBuildWithActions(final CoverageBuildAction... actions) {
+ static Run, ?> createBuildWithActions(final CoverageBuildAction... actions) {
Run, ?> build = mock(Run.class);
when(build.getActions(CoverageBuildAction.class)).thenReturn(Arrays.asList(actions));
if (actions.length > 0) {
diff --git a/pom.xml b/pom.xml
index 796c00c68..b89f6fccf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
org.jvnet.hudson.plugins
analysis-pom
- 11.2958.v63511c4c1160
+ 12.3140.v667559b_d0470
@@ -21,7 +21,7 @@
- 2
+ 3
999999-SNAPSHOT
jenkinsci/coverage-plugin
diff --git a/ui-tests/pom.xml b/ui-tests/pom.xml
index 8b72d045f..de1d06181 100644
--- a/ui-tests/pom.xml
+++ b/ui-tests/pom.xml
@@ -5,7 +5,7 @@
edu.hm.hafner
codingstyle-pom
- 5.42.0
+ 6.8.0
diff --git a/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java b/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java
index 42407e1e0..fb3851129 100644
--- a/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java
+++ b/ui-tests/src/main/java/io/jenkins/plugins/coverage/publisher/threshold/AbstractThreshold.java
@@ -7,7 +7,7 @@
/**
* Used for thresholds and global thresholds.
*/
-abstract class AbstractThreshold extends PageAreaImpl {
+public abstract class AbstractThreshold extends PageAreaImpl {
private final Control thresholdTarget = control("thresholdTarget");
private final Control unhealthyThreshold = control("unhealthyThreshold");
private final Control unstableThreshold = control("unstableThreshold");
@@ -22,6 +22,7 @@ abstract class AbstractThreshold extends PageAreaImpl {
* @param path
* to threshold
*/
+ @SuppressWarnings("this-escape")
protected AbstractThreshold(final PageArea parent, final String path) {
super(parent, path);
}
@@ -70,7 +71,7 @@ public void delete() {
/**
* Ensures advanced options are activated so that Thresholds can be set.
*/
- public abstract void ensureAdvancedOptionsIsActivated();
+ abstract void ensureAdvancedOptionsIsActivated();
Control getThresholdTarget() {
return thresholdTarget;