blob: 19bac095edbfa962c1d524eddaf7cc3d48446e90 [file] [log] [blame]
tom50a76dd2014-09-02 15:18:35 -07001<?xml version="1.0" encoding="UTF-8"?>
alshabibab984662014-12-04 18:56:18 -08002<!--
Brian O'Connora09fe5b2017-08-03 21:12:30 -07003 ~ Copyright 2014-present Open Networking Foundation
alshabibab984662014-12-04 18:56:18 -08004 ~
5 ~ Licensed under the Apache License, Version 2.0 (the "License");
6 ~ you may not use this file except in compliance with the License.
7 ~ You may obtain a copy of the License at
8 ~
9 ~ http://www.apache.org/licenses/LICENSE-2.0
10 ~
11 ~ Unless required by applicable law or agreed to in writing, software
12 ~ distributed under the License is distributed on an "AS IS" BASIS,
13 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ~ See the License for the specific language governing permissions and
15 ~ limitations under the License.
16 -->
tom50a76dd2014-09-02 15:18:35 -070017<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Carmelo Cascone87b893e2019-11-12 10:34:05 -080018 name="ONOS Rules"
19 xmlns="http://pmd.sf.net/ruleset/1.0.0"
20 xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
21 xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
tom50a76dd2014-09-02 15:18:35 -070022
23 <description>ONOS PMD rules</description>
24
Carmelo Cascone87b893e2019-11-12 10:34:05 -080025
26 <rule ref="category/java/errorprone.xml">
27 <exclude name="EmptyCatchBlock"/>
tom50a76dd2014-09-02 15:18:35 -070028 </rule>
Carmelo Cascone87b893e2019-11-12 10:34:05 -080029 <rule ref="category/java/errorprone.xml/EmptyCatchBlock">
30 <properties>
31 <property name="allowCommentedBlocks" value="true"/>
32 </properties>
tom50a76dd2014-09-02 15:18:35 -070033 </rule>
Carmelo Cascone87b893e2019-11-12 10:34:05 -080034 <rule ref="category/java/bestpractices.xml"/>
tom50a76dd2014-09-02 15:18:35 -070035 <rule ref="rulesets/java/optimizations.xml">
Carmelo Cascone87b893e2019-11-12 10:34:05 -080036 <exclude name="AvoidInstantiatingObjectsInLoops"/>
tom50a76dd2014-09-02 15:18:35 -070037 </rule>
38
39 <rule ref="rulesets/java/strings.xml">
Carmelo Cascone87b893e2019-11-12 10:34:05 -080040 <exclude name="AvoidDuplicateLiterals"/>
tom50a76dd2014-09-02 15:18:35 -070041 </rule>
42 <rule ref="rulesets/java/braces.xml"/>
Carmelo Cascone87b893e2019-11-12 10:34:05 -080043 <rule ref="category/java/codestyle.xml">
44 <!-- Explicit public keyword in interface methods is acceptable -->
45 <exclude name="UnnecessaryModifier"/>
46 <exclude name="UselessParentheses"/>
47 <exclude name="ShortClassName"/>
48 <exclude name="ShortMethodName"/>
49 <exclude name="ShortVariable"/>
50 <exclude name="LongVariable"/>
51 <exclude name="MethodArgumentCouldBeFinal"/>
52 <exclude name="LocalVariableCouldBeFinal"/>
tom50a76dd2014-09-02 15:18:35 -070053 </rule>
Carmelo Cascone87b893e2019-11-12 10:34:05 -080054 <rule ref="category/java/codestyle.xml/VariableNamingConventions">
55 <properties>
56 <!-- ONOS allows the name "log" for static final Loggers -->
57 <property name="violationSuppressRegex" value=".*'log'.*"/>
58 </properties>
tom50a76dd2014-09-02 15:18:35 -070059 </rule>
60
61 <rule ref="rulesets/java/clone.xml"/>
62 <rule ref="rulesets/java/strictexception.xml"/>
63 <rule ref="rulesets/java/design.xml">
Carmelo Cascone87b893e2019-11-12 10:34:05 -080064 <exclude name="GodClass"/>
tom50a76dd2014-09-02 15:18:35 -070065 </rule>
66 <rule ref="rulesets/java/coupling.xml">
Carmelo Cascone87b893e2019-11-12 10:34:05 -080067 <exclude name="LawOfDemeter"/>
68 <exclude name="ExcessiveImports"/>
69 <!-- Suppress Removed misconfigured rule warning -->
70 <exclude name="LoosePackageCoupling"/>
tom50a76dd2014-09-02 15:18:35 -070071 </rule>
72</ruleset>
73