Skip to content

Commit

Permalink
Add category and type to cpd issues
Browse files Browse the repository at this point in the history
  • Loading branch information
emouty committed Aug 9, 2023
1 parent a137c72 commit 423d363
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ protected Report convertDuplicationsToIssues(final List<Duplication> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 423d363

Please sign in to comment.