diff --git a/src/main/java/edu/hm/hafner/analysis/parser/dry/cpd/CpdParser.java b/src/main/java/edu/hm/hafner/analysis/parser/dry/cpd/CpdParser.java index bc0e9d031..fd9e361d2 100644 --- a/src/main/java/edu/hm/hafner/analysis/parser/dry/cpd/CpdParser.java +++ b/src/main/java/edu/hm/hafner/analysis/parser/dry/cpd/CpdParser.java @@ -64,6 +64,8 @@ protected Report convertDuplicationsToIssues(final List duplication .setLineStart(file.getLine()) .setLineEnd(file.getLine() + duplication.getLines() - 1) .setFileName(file.getPath()) + .setCategory("CPD") + .setType("CodeDuplication") .setAdditionalProperties(group); Issue issue = issueBuilder.build(); group.add(issue); diff --git a/src/test/java/edu/hm/hafner/analysis/parser/dry/cpd/CpdParserTest.java b/src/test/java/edu/hm/hafner/analysis/parser/dry/cpd/CpdParserTest.java index 4e939bdd3..79fd63a67 100644 --- a/src/test/java/edu/hm/hafner/analysis/parser/dry/cpd/CpdParserTest.java +++ b/src/test/java/edu/hm/hafner/analysis/parser/dry/cpd/CpdParserTest.java @@ -84,12 +84,16 @@ protected void assertThatIssuesArePresent(final Report report, final SoftAsserti .hasLineStart(274).hasLineEnd(274 + 95 - 1) .hasFileName(FILE_NAME_REPORTER) .hasSeverity(Severity.WARNING_HIGH) - .hasMessage("Found duplicated code."); + .hasMessage("Found duplicated code.") + .hasType("CodeDuplication") + .hasCategory("CPD"); softly.assertThat(publisherSecond) .hasLineStart(202).hasLineEnd(202 + 95 - 1) .hasFileName(FILE_NAME_PUBLISHER) .hasSeverity(Severity.WARNING_HIGH) - .hasMessage("Found duplicated code."); + .hasMessage("Found duplicated code.") + .hasType("CodeDuplication") + .hasCategory("CPD"); Serializable additionalProperties = publisherSecond.getAdditionalProperties(); softly.assertThat(additionalProperties).isEqualTo(reporterSecond.getAdditionalProperties());