aboutsummaryrefslogtreecommitdiff
path: root/config/suppressions.xml
blob: fffc9ebcba25131b330f2826d68a3c316044cc6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?xml version="1.0"?>

<!DOCTYPE suppressions PUBLIC
    "-//Puppy Crawl//DTD Suppressions 1.1//EN"
    "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">

<suppressions>
    <suppress checks="FileLength"
              files="TokenTypes.java"
              lines="1"/>

    <!-- we can not change it as, Check name is part of API (used in configurations) -->
    <suppress checks="AbbreviationAsWordInName"
              files="JavaNCSSCheck.java"
              lines="41"/>
    <!-- test should be named as their main class -->
    <suppress checks="AbbreviationAsWordInName"
              files="JavaNCSSCheckTest.java"
              lines="42"/>

    <!-- illegal words are part of Javadoc -->
    <suppress checks="TodoComment" files=".*TodoCommentCheck\.java"/>

    <!-- All disallowed characters are stored there -->
    <suppress checks="AvoidEscapedUnicodeCharactersCheck"
              files="AvoidEscapedUnicodeCharactersCheck.java"/>

    <!-- Can not change API -->
    <suppress checks="AbstractClassNameCheck"
              files="Check.java"/>

    <!-- 'Abstract' pattern is used to show it is checking for abstract class name -->
    <suppress checks="AbstractClassNameCheck"
              files="AbstractClassNameCheck.java"/>
    <!-- test should be named as their main class -->
    <suppress checks="AbstractClassNameCheck"
              files="AbstractClassNameCheckTest.java|AbstractTypeAwareCheckTest.java|AbstractJavadocCheckTest.java|AbstractViolationReporterTest.java"/>

    <!-- Tone down the checking for test code -->
    <suppress checks="EmptyBlock" files=".*[\\/]src[\\/]test[\\/]"/>
    <suppress checks="ImportControl" files=".*[\\/]src[\\/](test|it)[\\/]"/>
    <suppress checks="Javadoc" files=".*[\\/]src[\\/](test|it)[\\/]"/>
    <suppress checks="MagicNumber" files=".*[\\/]src[\\/](test|it)[\\/]"/>
    <suppress checks="AvoidStaticImport" files=".*[\\/]src[\\/](test|it)[\\/]"/>
    <suppress checks="MethodCount" files="[\\/]ImportOrderCheckTest.java$"/>
    <suppress checks="MethodCount" files="[\\/]IndentationCheckTest.java$"/>
    <suppress checks="MethodCount" files="[\\/]JavadocMethodCheckTest.java$"/>
    <suppress checks="MethodCount" files="[\\/]MainTest.java$"/>
    <suppress checks="EqualsAvoidNull" files="[\\/]Int.*FilterTest.java$"/>
    <suppress checks="VisibilityModifier" files="[\\/]BaseCheckTestSupport.java$"/>
    <suppress checks="WriteTag" files=".*[\\/]src[\\/](test|it)[\\/]"/>

    <!-- Suppressions to remove over time -->
    <suppress checks="." files=".*[\\/]src[\\/]it[\\/]" lines="40-999"/>

    <!--
      Turn off all checks for Generated and Test code. Fixes issues with using
      Eclipse plug-in.
      -->
    <suppress checks="." files=".*[\\/]grammars[\\/]Generated[a-zA-Z]*\.java"/>
    <suppress checks="." files=".*[\\/]grammars[\\/]Generated[a-zA-Z]*\.java"/>

    <!--Classes FileDrop, Main, ParseTreeInfoPanel from gui-package contain Magic Numbers.
    The Check generates too many violations, fixing them will make code unmanageable.-->
    <suppress checks="MagicNumber" files=".*[\\/]checkstyle[\\/]gui[\\/]"/>

    <!-- Methods that build fake AST are very long-->
    <suppress checks="MethodLength" files="src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]grammars[\\/]comments[\\/]CommentsTest\.java"/>
    <suppress checks="ExecutableStatementCount" files="src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]grammars[\\/]comments[\\/]CommentsTest\.java"/>
    <suppress checks="JavaNCSS" files="src[\\/]test[\\/]java[\\/]com[\\/]puppycrawl[\\/]tools[\\/]checkstyle[\\/]grammars[\\/]comments[\\/]CommentsTest\.java"/>

    <suppress checks="." files=".*JavadocTokenTypes\.java"/>
    <suppress checks="." files=".*ParseTreeBuilder\.java"/>

    <!-- Till https://github.com/checkstyle/checkstyle/issues/1854 -->
    <suppress checks="TrailingComment" files="(InnerAssignmentCheck\.java|OperatorWrapCheck\.java|XMLLoggerTest\.java|AbbreviationAsWordInNameCheckTest\.java)"/>

    <!-- Fixing these cases will decrease code readability -->
    <suppress checks="MultipleStringLiterals" files="JavadocStyleCheck\.java|AbstractTypeAwareCheck\.java|XMLLogger\.java"/>
    <suppress checks="MultipleStringLiterals" files=".*[\\/]src[\\/]test[\\/]"/>

    <!-- There are a lot of setters/getters in the Check. A small number of methods is left for Check's logic -->
    <suppress checks="MethodCount" files="[\\/]JavadocMethodCheck.java$"/>

    <!-- getDetails() method - huge Switch, it has to be monolithic -->
    <suppress checks="ExecutableStatementCount" files="RightCurlyCheck\.java" lines="304"/>
    <suppress checks="JavaNCSS" files="RightCurlyCheck\.java" lines="304"/>
    <suppress checks="CyclomaticComplexity" files="RightCurlyCheck\.java" lines="304"/>

    <!-- we need that set of converters -->
    <suppress checks="ClassDataAbstractionCoupling" files="AutomaticBean\.java"/>
    <!-- they are aggregators of logic, usage a several of classes are ok -->
    <suppress checks="ClassDataAbstractionCoupling" files="(Checker|TreeWalker|Main|CheckstyleAntTask|AbstractJavadocCheck)\.java"/>
    <suppress checks="ClassDataAbstractionCoupling" files="(CheckerTest|TreeWalkerTest|BaseCheckTestSupport)\.java"/>
    <!-- a lot of GUI elements is OK -->
    <suppress checks="ClassDataAbstractionCoupling" files="ParseTreeInfoPanel\.java"/>

    <!-- Should be fixed after moving https://github.com/sevntu-checkstyle/sevntu.checkstyle/blob/master/sevntu-checks/src/main/java/com/github/sevntu/checkstyle/checks/coding/ReturnCountExtendedCheck.java into the main repo -->
    <suppress checks="ReturnCount" files="(ClassResolver|ConfigurationLoader|IndentationCheckTest)\.java"/>
    
    <!-- Just big switches. Cannot be split to several methods. Till https://github.com/checkstyle/checkstyle/issues/2029 -->
    <suppress checks="CyclomaticComplexity" files="(AbstractDeclarationCollector|SuppressWarningsHolder|LeftCurlyCheck|FallThroughCheck|FinalLocalVariableCheck|ModifiedControlVariableCheck)\.java"/>
    <suppress checks="CyclomaticComplexity" files="(ParameterAssignmentCheck|VariableDeclarationUsageDistanceCheck|BooleanExpressionComplexityCheck|NPathComplexityCheck|CheckUtils)\.java"/>

    <!-- Suppressions from PMD configuration-->
    <!-- validateCli is not reasonable to split as encapsulation of logic will be damaged -->
    <suppress checks="CyclomaticComplexity" files="Main\.java"  lines="179"/>
    <!-- JavadocMethodCheck, JavadocStyleCheck, JavadocUtils.getJavadocTags() - deprecated -->
    <suppress checks="CyclomaticComplexity" files="JavadocMethodCheck\.java"/>
    <suppress checks="CyclomaticComplexity" files="JavadocStyleCheck\.java"/>
    <suppress checks="CyclomaticComplexity" files="CustomImportOrderCheck\.java"/>
    
    <!-- equals() - a lot of fields to check -->
    <suppress checks="CyclomaticComplexity" files="LocalizedMessage\.java" lines="211"/>
    <!-- SWITCH was transformed into IF-ELSE -->
    <suppress checks="CyclomaticComplexity" files="ImportOrderCheck\.java" lines="331"/>

    <!-- LocalizedMessage class is immutable, we need that amount of arguments. -->
    <suppress checks="ParameterNumber"
              files="LocalizedMessage.java"
              lines="106, 144, 175"/>
</suppressions>