RED-8085 pmd checkup/cleanup

This commit is contained in:
Timo Bejan 2024-01-29 10:33:22 +01:00
parent 34557c7cff
commit ba5eaec957
8 changed files with 15 additions and 10 deletions

View File

@ -11,6 +11,10 @@ group = "com.iqser.red.service"
java.sourceCompatibility = JavaVersion.VERSION_17 java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17 java.targetCompatibility = JavaVersion.VERSION_17
pmd {
isConsoleOutput = true
}
tasks.pmdMain { tasks.pmdMain {
pmd.ruleSetFiles = files("${rootDir}/config/pmd/pmd.xml") pmd.ruleSetFiles = files("${rootDir}/config/pmd/pmd.xml")
} }

View File

@ -9,13 +9,12 @@
</description> </description>
<rule ref="category/java/errorprone.xml"> <rule ref="category/java/errorprone.xml">
<exclude name="DataflowAnomalyAnalysis"/>
<exclude name="MissingSerialVersionUID"/> <exclude name="MissingSerialVersionUID"/>
<exclude name="NullAssignment"/>
<exclude name="AvoidLiteralsInIfCondition"/> <exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="AvoidDuplicateLiterals"/> <exclude name="AvoidDuplicateLiterals"/>
<exclude name="AvoidFieldNameMatchingMethodName"/> <exclude name="NullAssignment"/>
<exclude name="AssignmentInOperand"/> <exclude name="AssignmentInOperand"/>
<exclude name="BeanMembersShouldSerialize"/>
</rule> </rule>
</ruleset> </ruleset>

View File

@ -10,15 +10,13 @@
<rule ref="category/java/errorprone.xml"> <rule ref="category/java/errorprone.xml">
<exclude name="DataflowAnomalyAnalysis"/>
<exclude name="MissingSerialVersionUID"/> <exclude name="MissingSerialVersionUID"/>
<exclude name="NullAssignment"/>
<exclude name="AvoidLiteralsInIfCondition"/> <exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="AvoidDuplicateLiterals"/> <exclude name="AvoidDuplicateLiterals"/>
<exclude name="AvoidFieldNameMatchingMethodName"/> <exclude name="NullAssignment"/>
<exclude name="AvoidFieldNameMatchingTypeName"/>
<exclude name="AssignmentInOperand"/> <exclude name="AssignmentInOperand"/>
<exclude name="TestClassWithoutTestCases"/> <exclude name="TestClassWithoutTestCases"/>
<exclude name="BeanMembersShouldSerialize"/>
</rule> </rule>
</ruleset> </ruleset>

View File

@ -22,6 +22,7 @@ import lombok.experimental.FieldDefaults;
@Builder @Builder
@AllArgsConstructor @AllArgsConstructor
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
@SuppressWarnings("PMD.AvoidFieldNameMatchingMethodName")
public class ManualEntity implements IEntity { public class ManualEntity implements IEntity {
// The id must be mapped into a TextEntity as is for comments to work correctly // The id must be mapped into a TextEntity as is for comments to work correctly

View File

@ -13,6 +13,7 @@ import lombok.Setter;
@Setter @Setter
@EqualsAndHashCode @EqualsAndHashCode
@SuppressWarnings("PMD.AvoidFieldNameMatchingMethodName")
public class TextRange implements Comparable<TextRange> { public class TextRange implements Comparable<TextRange> {
private int start; private int start;

View File

@ -28,6 +28,7 @@ import lombok.experimental.FieldDefaults;
@AllArgsConstructor @AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE) @FieldDefaults(level = AccessLevel.PRIVATE)
@EqualsAndHashCode(onlyExplicitlyIncluded = true) @EqualsAndHashCode(onlyExplicitlyIncluded = true)
@SuppressWarnings("PMD.AvoidFieldNameMatchingMethodName")
public class TextEntity implements IEntity { public class TextEntity implements IEntity {
// primary key // primary key

View File

@ -1,6 +1,7 @@
plugins { plugins {
application application
id("com.iqser.red.service.java-conventions") id("com.iqser.red.service.java-conventions")
id("io.freefair.lombok") version "8.4"
} }
group = "com.knecon.fforesight.utility" group = "com.knecon.fforesight.utility"
@ -27,7 +28,6 @@ sourceSets {
dependencies { dependencies {
implementation(project(":redaction-service-server-v1")) implementation(project(":redaction-service-server-v1"))
implementation("org.projectlombok:lombok:1.18.28")
testImplementation(platform("org.junit:junit-bom:5.10.0")) testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter") testImplementation("org.junit.jupiter:junit-jupiter")

View File

@ -9,6 +9,7 @@ import lombok.experimental.FieldDefaults;
@AllArgsConstructor @AllArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true) @EqualsAndHashCode(onlyExplicitlyIncluded = true)
@SuppressWarnings("PMD.AvoidFieldNameMatchingMethodName")
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
public class RuleType { public class RuleType {