vempo | 09d4f06 | 2017-08-29 18:15:04 +0300 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 2 | <ruleset name="SDC Essential Rule-set" |
| 3 | xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" |
| 4 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 5 | xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd http://pmd.sourceforge.net/ruleset/2.0.0 "> |
| 6 | |
| 7 | <description> |
| 8 | Essential rules according to SonarQube. Note that it is impossible to make PMD rules exactly match the |
| 9 | SonarQube ones, but they will probably catch about 90% of violations before they get into the source control. |
| 10 | The advantage is that PMD can be ran locally on any development setup and does not require a license. |
| 11 | </description> |
| 12 | |
| 13 | <!-- |
| 14 | All available Java rule-sets: https://pmd.github.io/pmd-5.6.1/pmd-java/rules/index.html |
| 15 | --> |
| 16 | |
| 17 | <!-- Blocker severity in SonarQube --> |
| 18 | <rule ref="rulesets/java/strictexception.xml/AvoidCatchingThrowable"/> |
| 19 | <rule ref="rulesets/java/empty.xml/EmptyCatchBlock"> |
| 20 | <properties> |
| 21 | <property name="allowCommentedBlocks" value="true"/> |
| 22 | </properties> |
| 23 | </rule> |
| 24 | |
| 25 | <!-- THERE IS NO GOOD RULE TO CATCH NULL DEREFERENCING IN PMD --> |
| 26 | <rule ref="rulesets/java/basic.xml/MisplacedNullCheck"/> |
| 27 | <rule ref="rulesets/java/basic.xml/BrokenNullCheck"/> |
| 28 | |
| 29 | |
| 30 | <rule ref="rulesets/java/design.xml/CloseResource"> |
| 31 | <properties> |
| 32 | <property name="types" |
| 33 | value="java.sql.Connection,java.sql.Statement,java.sql.ResultSet,java.io.OutputStream,java.net.URLConnection,java.io.InputStream,java.io.FileInputStream,java.io.FileOutputStream,java.util.zip.ZipOutputStream,java.util.zip.ZipInputStream,java.util.jar.JarInputStream,java.util.jar.JarOutputStream,java.io.BufferedReader,java.io.BufferedWriter"/> |
| 34 | </properties> |
| 35 | </rule> |
| 36 | <rule ref="rulesets/java/basic.xml/OverrideBothEqualsAndHashcode"/> |
| 37 | |
| 38 | <!-- |
| 39 | Critical severity in SonarQube. Should be empty until all Critical have been fixed. |
| 40 | --> |
| 41 | |
| 42 | </ruleset> |