
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
53 lines
1.2 KiB
Plaintext
53 lines
1.2 KiB
Plaintext
== Why is this an issue?
|
|
|
|
Names should be self-descriptive and this can't be the case when they are made of less than 3 characters.
|
|
|
|
Two-letter English words such as "is", "as", "of", etc. are allowed.
|
|
|
|
|
|
Local variables are not verified by this rule.
|
|
|
|
|
|
The following code snippet illustrates this rule:
|
|
|
|
|
|
----
|
|
public class A { // Non-Compliant
|
|
|
|
public int convert(String a) { // Non-Compliant
|
|
for (int i = 0; i < 42 ; i++) { // Compliant - local variable
|
|
/* ... */
|
|
}
|
|
}
|
|
|
|
public void a() { // Non-Compliant
|
|
int i = 0; // Compliant - local variable
|
|
try {
|
|
/* ... */
|
|
} catch (Exception e) { // Compliant - local variable
|
|
/* ... */
|
|
}
|
|
}
|
|
|
|
private boolean is(Object a) { // Compliant - two-letter English word
|
|
/* ... */
|
|
}
|
|
}
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 1 Aug 2013, 12:50:19 Freddy Mallet wrote:
|
|
Is implemented by \http://jira.codehaus.org/browse/SONARJAVA-262
|
|
|
|
=== on 20 Aug 2013, 11:38:45 Freddy Mallet wrote:
|
|
This rule generates too many false-positives
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|