aboutsummaryrefslogtreecommitdiff
path: root/config/intellij-idea-inspections.xml
diff options
context:
space:
mode:
authorvasilyeva <vasilyeva@rutarget.ru>2017-07-14 23:40:12 +0300
committerRoman Ivanov <romani@users.noreply.github.com>2017-07-14 15:13:49 -0700
commit370ce010137d2f43c7284750d551acfd295ebea9 (patch)
tree4c5c2a2cc1830550f573e223014b01d0185c6e7f /config/intellij-idea-inspections.xml
parent66d866e59189f2eb707cc4eca3d7ee0240e38a70 (diff)
downloadcheckstyle-370ce010137d2f43c7284750d551acfd295ebea9.tar.gz
Issue #4707: fixed abstraction IDEA violations
Diffstat (limited to 'config/intellij-idea-inspections.xml')
-rw-r--r--config/intellij-idea-inspections.xml21
1 files changed, 18 insertions, 3 deletions
diff --git a/config/intellij-idea-inspections.xml b/config/intellij-idea-inspections.xml
index b5cea4875..0c3bf4b13 100644
--- a/config/intellij-idea-inspections.xml
+++ b/config/intellij-idea-inspections.xml
@@ -223,6 +223,9 @@
<inspection_tool class="CastThatLosesPrecision" enabled="true" level="ERROR" enabled_by_default="true">
<option name="ignoreIntegerCharCasts" value="false" />
</inspection_tool>
+ <!-- this is valid but there are many false-positvies as we use reflection to load modules after recheck
+ by instanceof and we restricted in by existing api types, but some cases are valid, inspection lack of
+ properties to make it less demanding -->
<inspection_tool class="CastToConcreteClass" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="CastToIncompatibleInterface" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CaughtExceptionImmediatelyRethrown" enabled="true" level="ERROR" enabled_by_default="true" />
@@ -1055,14 +1058,17 @@
<option name="m_minLength" value="2" />
<option name="m_maxLength" value="64" />
</inspection_tool>
+ <!-- this is valid but there are many false-positvies as we use reflection to load modules after recheck by instanceof -->
<inspection_tool class="InstanceVariableOfConcreteClass" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="InstanceVariableUninitializedUse" enabled="true" level="ERROR" enabled_by_default="true">
<option name="m_ignorePrimitives" value="false" />
<option name="annotationNamesString" value="" />
</inspection_tool>
<inspection_tool class="InstanceofCatchParameter" enabled="true" level="WARNING" enabled_by_default="true" />
- <inspection_tool class="InstanceofChain" enabled="false" level="ERROR" enabled_by_default="false">
- <option name="ignoreInstanceofOnLibraryClasses" value="false" />
+ <!-- we do reflection for testing -->
+ <inspection_tool class="InstanceofChain" enabled="true" level="ERROR" enabled_by_default="true">
+ <scope name="Tests" level="ERROR" enabled="false" />
+ <option name="ignoreInstanceofOnLibraryClasses" value="true" />
</inspection_tool>
<inspection_tool class="InstanceofIncompatibleInterface" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="InstanceofInterfaces" enabled="false" level="ERROR" enabled_by_default="false" />
@@ -1281,6 +1287,7 @@
<option name="m_minLength" value="1" />
<option name="m_maxLength" value="32" />
</inspection_tool>
+ <!-- we like concrete types in concrete logic, inspection is not practical and lack more options to skip cases -->
<inspection_tool class="LocalVariableOfConcreteClass" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="LogStatementGuardedByLogCondition" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="true" level="ERROR" enabled_by_default="true">
@@ -1300,7 +1307,9 @@
<inspection_tool class="MVCPathVariableInspection" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="MagicCharacter" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="MagicConstant" enabled="false" level="WARNING" enabled_by_default="false" />
- <inspection_tool class="MagicNumber" enabled="false" level="ERROR" enabled_by_default="false" />
+ <inspection_tool class="MagicNumber" enabled="true" level="ERROR" enabled_by_default="true" >
+ <scope name="Tests" level="ERROR" enabled="false" />
+ </inspection_tool>
<inspection_tool class="MagicNumberJS" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="MalformedFormatString" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="MalformedRegex" enabled="true" level="ERROR" enabled_by_default="true" />
@@ -1348,6 +1357,8 @@
<inspection_tool class="MethodOverridesPackageLocalMethod" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MethodOverridesPrivateMethod" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MethodOverridesStaticMethod" enabled="true" level="WARNING" enabled_by_default="true" />
+ <!-- it is too demanding, event violated private methods. Nothing is bad to be exact inside custom logic,
+ might be good for api classes validation, but setup of this is too heavy for us -->
<inspection_tool class="MethodReturnOfConcreteClass" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="MethodWithMultipleLoops" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="MimeType" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -1929,6 +1940,7 @@
<option name="m_minLength" value="4" />
<option name="m_maxLength" value="64" />
</inspection_tool>
+ <!-- we are a library, not used by us heavily does not mean that is not required -->
<inspection_tool class="StaticMethodOnlyUsedInOneClass" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="StaticNonFinalField" enabled="false" level="WARNING" enabled_by_default="true">
<scope name="Tests" level="WARNING" enabled="false" />
@@ -1944,6 +1956,7 @@
<option name="m_minLength" value="5" />
<option name="m_maxLength" value="32" />
</inspection_tool>
+ <!-- it lacks option to skip inner field of the same size that we use give convenient ready to use instances -->
<inspection_tool class="StaticVariableOfConcreteClass" enabled="false" level="ERROR" enabled_by_default="false" />
<inspection_tool class="StaticVariableUninitializedUse" enabled="false" level="WARNING" enabled_by_default="true">
<scope name="Tests" level="WARNING" enabled="false">
@@ -2014,6 +2027,8 @@
<option value="ProhibitedExceptionThrown" />
<!-- we have to use it when pass null argument in test purporses -->
<option value="NullArgumentToVariableArgMethod" />
+ <option value="ChainOfInstanceofChecks"/>
+ <option value="MagicNumber"/>
</list>
</option>
</inspection_tool>