rspec/rules/S3400/comments-and-links.adoc

44 lines
1006 B
Plaintext
Raw Normal View History

=== Related: RSPEC-3516
=== On 2015-12-01T11:08:13Z Michael Gumowski Wrote:
LGTM!
=== On 2016-01-05T10:07:18Z Nicolas Peru Wrote:
\[~ann.campbell.2] I kinda lack the definition of what is a constant and limitation of cases to be 100% sure of the scope of this rule.
What about the following for instance :
----
int foo(boolean a) {
if(a) {
return 12;
}
return 12;
}
----
this is actually detected by intellij idea but the following is not :
----
int foo(boolean a) {
int b = 12;
if(a) {
return b;
}
return b;
}
----
IMO first implementation should be limited to method with only one return statement and a constant with the following definition:
A constant is a literal or a static final primitive variable.
Then we might want to improve this using SE engine to detect cases like I described.
WDYT ?
=== On 2016-01-05T16:21:17Z Ann Campbell Wrote:
Uhm... I thought it was evident from the examples [~nicolas.peru] that that's all that was expected.