Details
-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Message:Rename this field "XXX" to match the regular expression ${format}.
-
List of parameters:
-
Default Severity:Minor
-
Impact:Low
-
Likelihood:Low
-
Default Quality Profiles:Sonar way
-
Covered Languages:Java
-
Remediation Function:Constant/Issue
-
Constant Cost:2min
-
Analysis Scope:Main Sources, Test Sources
-
Checkstyle:StaticVariableName
Description
Shared naming conventions allow teams to collaborate efficiently. This rule checks that static non-final field names match a provided regular expression.
Noncompliant Code Example
With the default regular expression ^[a-z][a-zA-Z0-9]*$:
public final class MyClass { private static String foo_bar; }
Compliant Solution
class MyClass { private static String fooBar; }
Attachments
Issue Links
- is implemented by
-
SONARJAVA-1145 Rule: S3008 Static non-final field names should comply with a naming convention
-
- Closed
-