Skip to content

Commit

Permalink
#129: Disable AtLeastOneConstructor due to a lot of false-positives
Browse files Browse the repository at this point in the history
  • Loading branch information
dgroup authored Apr 27, 2022
2 parents 2ee5581 + 4aa8b3d commit a2923cb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
33 changes: 17 additions & 16 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ REST API, logging, monitoring, etc., including reconfigured default pmd
rules to decrease false-positive
violations during usage of well-known frameworks like Spring, Quarkus, etc.

In addition to our custom/reconfigured rules we are using the latest stable pmd-java version which is `6.42.0` with more than [320+ rules](https://pmd.github.io/pmd-6.42.0/pmd_rules_java.html) with default configuration.
In addition to our custom/reconfigured rules we are using the latest stable pmd-java version which is `6.44.0` with more than [320+ rules](https://pmd.github.io/pmd-6.44.0/pmd_rules_java.html) with default configuration.

*Legend*

Expand All @@ -40,7 +40,7 @@ In addition to our custom/reconfigured rules we are using the latest stable pmd-
- 🌵 temporary disabled or reconfigured in `arch4u-ruleset.xml`
- ❌ disabled/not planned in `arch4u-ruleset.xml`

| PMD rule | Provider | Status | Spring | Quarkus |
| PMD rule | Provider | Status | Spring | Quarkus |
|:------------------------------------------------------------------------------------------------------------------------------------------|:------------------:|:------:|:------:|:-------:|
| [UseExistingMediaTypeConstant](https://github.com/dgroup/arch4u-pmd/discussions/43) | `arch4u-pmd:0.1.0` ||||
| [UseOpenApiInRestEndpoints](https://github.com/dgroup/arch4u-pmd/discussions/73) | `arch4u-pmd:0.1.0` ||||
Expand All @@ -50,20 +50,21 @@ In addition to our custom/reconfigured rules we are using the latest stable pmd-
| [AvoidUsingObjectMapperAsALocalVariable](https://github.com/dgroup/arch4u-pmd/discussions/30) | `arch4u-pmd:0.1.0` ||||
| [AvoidMdcOutsideTryStatement](https://github.com/dgroup/arch4u-pmd/discussions/86) | `arch4u-pmd:0.1.0` ||||
| [PotentiallyThreadLocalPollutionByMdc](https://github.com/dgroup/arch4u-pmd/discussions/88) | `arch4u-pmd:0.1.0` ||||
| [GuardLogStatement](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#guardlogstatement) | `pmd-java:6.42.0` ||||
| [JUnitAssertionsShouldIncludeMessage](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#junitassertionsshouldincludemessage) | `pmd-java:6.42.0` | 🌵 |||
| [UnusedPrivateMethod](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#unusedprivatemethod) | `pmd-java:6.42.0` | 🌵 |||
| [AtLeastOneConstructor](https://pmd.github.io/latest/pmd_rules_java_codestyle.html#atleastoneconstructor) | `pmd-java:6.42.0` | 🌵 |||
| [OnlyOneReturn](https://pmd.github.io/latest/pmd_rules_java_codestyle.html#onlyonereturn) | `pmd-java:6.42.0` | 🌵 |||
| [CommentRequired](https://pmd.github.io/latest/pmd_rules_java_documentation.html#commentrequired) | `pmd-java:6.42.0` | 🌵 |||
| [AvoidCatchingGenericException](https://pmd.github.io/latest/pmd_rules_java_design.html#avoidcatchinggenericexception) | `pmd-java:6.42.0` ||||
| [CouplingBetweenObjects](https://pmd.github.io/latest/pmd_rules_java_design.html#couplingbetweenobjects) | `pmd-java:6.42.0` | 🌵 |||
| [LawOfDemeter](https://pmd.github.io/latest/pmd_rules_java_design.html#lawofdemeter) | `pmd-java:6.42.0` ||||
| [LoosePackageCoupling](https://pmd.github.io/latest/pmd_rules_java_design.html#loosepackagecoupling) | `pmd-java:6.42.0` ||||
| [SignatureDeclareThrowsException](https://pmd.github.io/latest/pmd_rules_java_design.html#signaturedeclarethrowsexception) | `pmd-java:6.42.0` ||||
| [TooManyFields](https://pmd.github.io/latest/pmd_rules_java_design.html#toomanyfields) | `pmd-java:6.42.0` | 🌵 |||
| [TooManyMethods](https://pmd.github.io/latest/pmd_rules_java_design.html#toomanymethods) | `pmd-java:6.42.0` | 🌵 |||
| [UseObjectForClearerAPI](https://pmd.github.io/latest/pmd_rules_java_design.html#useobjectforclearerapi) | `pmd-java:6.42.0` ||||
| [GuardLogStatement](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#guardlogstatement) | `pmd-java:6.44.0` ||||
| [JUnitAssertionsShouldIncludeMessage](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#junitassertionsshouldincludemessage) | `pmd-java:6.44.0` | 🌵 |||
| [UnusedPrivateMethod](https://pmd.github.io/latest/pmd_rules_java_bestpractices.html#unusedprivatemethod) | `pmd-java:6.44.0` | 🌵 |||
| [AtLeastOneConstructor](https://pmd.github.io/latest/pmd_rules_java_codestyle.html#atleastoneconstructor) | `pmd-java:6.44.0` | 🌵 |||
| [OnlyOneReturn](https://pmd.github.io/latest/pmd_rules_java_codestyle.html#onlyonereturn) | `pmd-java:6.44.0` | 🌵 |||
| [CommentRequired](https://pmd.github.io/latest/pmd_rules_java_documentation.html#commentrequired) | `pmd-java:6.44.0` | 🌵 |||
| [AvoidCatchingGenericException](https://pmd.github.io/latest/pmd_rules_java_design.html#avoidcatchinggenericexception) | `pmd-java:6.44.0` ||||
| [CouplingBetweenObjects](https://pmd.github.io/latest/pmd_rules_java_design.html#couplingbetweenobjects) | `pmd-java:6.44.0` | 🌵 |||
| [LawOfDemeter](https://pmd.github.io/latest/pmd_rules_java_design.html#lawofdemeter) | `pmd-java:6.44.0` ||||
| [LoosePackageCoupling](https://pmd.github.io/latest/pmd_rules_java_design.html#loosepackagecoupling) | `pmd-java:6.44.0` ||||
| [SignatureDeclareThrowsException](https://pmd.github.io/latest/pmd_rules_java_design.html#signaturedeclarethrowsexception) | `pmd-java:6.44.0` ||||
| [TooManyFields](https://pmd.github.io/latest/pmd_rules_java_design.html#toomanyfields) | `pmd-java:6.44.0` | 🌵 |||
| [TooManyMethods](https://pmd.github.io/latest/pmd_rules_java_design.html#toomanymethods) | `pmd-java:6.44.0` | 🌵 |||
| [UseObjectForClearerAPI](https://pmd.github.io/latest/pmd_rules_java_design.html#useobjectforclearerapi) | `pmd-java:6.44.0` ||||
| [AtLeastOneConstructor](https://pmd.github.io/latest/pmd_rules_java_codestyle.html#atleastoneconstructor) | `pmd-java:6.44.0` ||||

### How to use?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@
<exclude name="AtLeastOneConstructor"/>
<exclude name="OnlyOneReturn"/> <!-- @todo #/DEV OnlyOneReturn: deep investigation is needed regarding purpose and goal of this this rule. Potentially improvement is needed. -->
</rule>
<rule ref="category/java/codestyle.xml/AtLeastOneConstructor">
<properties>
<property name="ignoredAnnotations" value="lombok.Data|lombok.Value|lombok.Builder|lombok.NoArgsConstructor|lombok.RequiredArgsConstructor|lombok.AllArgsConstructor|org.springframework.context.annotation.Configuration|org.springframework.web.bind.annotation.ControllerAdvice|org.springframework.web.bind.annotation.RestController|lombok.experimental.SuperBuilder|org.springframework.stereotype.Component|org.springframework.stereotype.Service|org.springframework.stereotype.Repository|org.springframework.boot.context.properties.ConfigurationProperties|org.mapstruct.Mapper|javax.xml.bind.annotation.XmlRootElement|org.junit.jupiter.api.extension.ExtendWith|org.mockserver.junit.jupiter.MockServerSettings|org.springframework.test.context.ContextConfiguration|org.springframework.test.context.web.WebAppConfiguration|org.junit.runner.RunWith" />
</properties>
</rule>

<rule ref="category/java/design.xml">
<exclude name="LawOfDemeter"/> <!-- @todo #/DEV LawOfDemeter: deep investigation is needed regarding purpose and goal of this this rule. Potentially improvement is needed. -->
Expand Down

0 comments on commit a2923cb

Please sign in to comment.