I was approaching
Issue#11163 and was scoping out the different Check inputs in the process. I observed that more often than not, various checks contained
same input file. The said file has variety of unrelated inputs for name format, accessor, method size, method pattern etc.
This isn't an isolated issue, running
grep -r "Contains simple mistakes" src/ | tee >(wc -l)gives out 31 matches for that javadoc comment found in all these files. Output list is appended at the end.
Note: This may not contains all occurrence of this issue as this relies on the fact that such file carry on that original javadoc comment.
Example Check input:ParameterNumber (
Documentation) (
Check test)
Files with said issue:
InputParameterNumberSimple,InputParameterNumberSimple2,InputParameterNumberSimple3,InputParameterNumberSimple4Explanation for why the files above contains irrelevant inputs:The check is for enforcing number of parameters of a method or constructor, but these inputs are related to various other checks like name format, method patterns, constants etc.
Examples:/** Invalid format **/
public static final int badConstant = 2;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/** should be private **/
protected static int sTest3;That being said, these input checks may contain related tests for a few Check inputs. In this case an example for the relevant thing is
void toManyArgs:
- Issue is that there is no need to have all the other irrelevant inputs packaged with ParameterNumber check.
- In this case, similar type of input with same configuration is present in another input for that check, but even if it wasn't present it could be refactored or made into separate input with changed config if needed.
Also, all of these files contains unused
java.io import (Line 11).
Proposed fix:Keep only relevant portions of the inputs from these file or refactor them into existing input for the same check, or create a separate file if required, and change the corresponding Check test accordingly.
File list that contains this issue but may not be limited to:
Google sheetsShould I open an issue? or am I missing something here and this is supposed be this way?