Reputation: 35557
following line of code in my code segment detected as an Issue by sonar.
code segment:
final int Pending=1;
sonar Issue:
Name 'Pending' must match pattern '^[a-z][a-zA-Z0-9]*$'.
why sonar detect this as an issue?
Upvotes: 2
Views: 14147
Reputation: 26843
Well, Sonar gives an explicit message for the violation: the variable "Pending" does not match the given regexp pattern "^[a-z][a-zA-Z0-9]*$". This pattern means: any string that begins with a lowercase letter, followed by any letters or digits. So your variable should be called "pending", not "Pending".
What's more, as Juvanis said, this is the standard naming convention for variables in Java.
Upvotes: 11