Details
-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Message:Rename this abstract class name to match the regular expression ${format}
-
List of parameters:
-
Default Severity:Minor
-
Impact:Low
-
Likelihood:Low
-
Covered Languages:Java
-
Remediation Function:Constant/Issue
-
Constant Cost:10min
-
Analysis Scope:Main Sources, Test Sources
-
Checkstyle:AbstractClassName, AbbreviationAsWordInName
-
PMD:AbstractNaming
Description
Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate. This rule allows to check that all abstract class names match a provided regular expression. If a non-abstract class match the regular expression, an issue is raised to suggest to either make it abstract or to rename it.
Noncompliant Code Example
With the default regular expression: ^Abstract[A-Z][a-zA-Z0-9]*$:
abstract class MyClass { // Noncompliant } class AbstractLikeClass { // Noncompliant }
Compliant Solution
abstract class AbstractClass { } class LikeClass { }
Attachments
Issue Links
- is implemented by
-
SONARJAVA-147 Rule S00118: Abstract class names should comply with a naming convention
-
- Closed
-