| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| --> |
| <ruleset name="Maven PMD Plugin Ruleset" |
| xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> |
| |
| <description>Default PMD Rules for Apache NiFi</description> |
| |
| <exclude-pattern>.*/antlr/AttributeExpressionParser\.java</exclude-pattern> |
| <exclude-pattern>.*/antlr/AttributeExpressionLexer\.java</exclude-pattern> |
| <exclude-pattern>.*/antlr/HL7QueryParser\.java</exclude-pattern> |
| <exclude-pattern>.*/antlr/HL7QueryLexer\.java</exclude-pattern> |
| <exclude-pattern>.*/antlr/Protobuf3Parser\.java</exclude-pattern> |
| <exclude-pattern>.*/antlr/Protobuf3Lexer\.java</exclude-pattern> |
| <exclude-pattern>.*/path/RecordPathParser\.java</exclude-pattern> |
| <exclude-pattern>.*/path/RecordPathLexer\.java</exclude-pattern> |
| <exclude-pattern>.*/generated.*/.+?\.java</exclude-pattern> |
| |
| <rule ref="category/java/bestpractices.xml/AvoidMessageDigestField" /> |
| <rule ref="category/java/bestpractices.xml/AvoidReassigningCatchVariables" /> |
| <rule ref="category/java/bestpractices.xml/DoubleBraceInitialization" /> |
| <rule ref="category/java/bestpractices.xml/ForLoopCanBeForeach" /> |
| <rule ref="category/java/bestpractices.xml/LooseCoupling"> |
| <!--Classes below excluded from this rule due to their prevalence within the code base.--> |
| <properties> |
| <property name="allowedTypes" |
| value="java.util.EnumSet, |
| java.util.Properties, |
| java.util.jar.Attributes, |
| jakarta.ws.rs.core.MultivaluedHashMap, |
| com.google.api.services.drive.DriveRequest, |
| com.google.api.services.drive.model.File, |
| com.google.cloud.bigquery.FieldValueList, |
| org.bson.BsonDocument, |
| org.bson.Document, |
| com.nimbusds.oauth2.sdk.Scope, |
| org.apache.nifi.attribute.expression.language.ValueLookup, |
| org.apache.nifi.processor.util.listen.queue.TrackingLinkedBlockingQueue |
| " /> |
| </properties> |
| </rule> |
| <rule ref="category/java/bestpractices.xml/MissingOverride" /> |
| <rule ref="category/java/bestpractices.xml/PrimitiveWrapperInstantiation" /> |
| <rule ref="category/java/bestpractices.xml/SimplifiableTestAssertion" /> |
| <rule ref="category/java/bestpractices.xml/UnusedPrivateField" /> |
| <rule ref="category/java/bestpractices.xml/UnnecessaryVarargsArrayCreation" /> |
| <rule ref="category/java/bestpractices.xml/UnusedLocalVariable" /> |
| <rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty" /> |
| <rule ref="category/java/bestpractices.xml/UseStandardCharsets" /> |
| |
| <rule ref="category/java/codestyle.xml/AvoidDollarSigns" /> |
| <rule ref="category/java/codestyle.xml/ExtendsObject" /> |
| <rule ref="category/java/codestyle.xml/IdenticalCatchBranches" /> |
| <rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" /> |
| <rule ref="category/java/codestyle.xml/UnnecessaryConstructor" /> |
| <rule ref="category/java/codestyle.xml/UnnecessaryImport" /> |
| <rule ref="category/java/codestyle.xml/UnnecessaryModifier"> |
| <!--The following xpath excludes try with resources that use a final modifier when defining variable(s) --> |
| <properties> |
| <property name="violationSuppressXPath" value="./ancestor::ResourceList/Resource/LocalVariableDeclaration/ModifierList[contains(@ExplicitModifiers, 'final')]"/> |
| </properties> |
| </rule> |
| <rule ref="category/java/codestyle.xml/UnnecessarySemicolon" /> |
| <rule ref="category/java/codestyle.xml/UseDiamondOperator" /> |
| <rule ref="category/java/codestyle.xml/UseExplicitTypes" /> |
| |
| <rule ref="category/java/errorprone.xml/AvoidAssertAsIdentifier" /> |
| <rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor" /> |
| <rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators" /> |
| <rule ref="category/java/errorprone.xml/AvoidUsingOctalValues" /> |
| <rule ref="category/java/errorprone.xml/BrokenNullCheck" /> |
| <rule ref="category/java/errorprone.xml/CheckSkipResult" /> |
| <rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray" /> |
| <rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices" /> |
| <rule ref="category/java/errorprone.xml/EmptyCatchBlock" /> |
| <rule ref="category/java/errorprone.xml/JumbledIncrementer" /> |
| <rule ref="category/java/errorprone.xml/MisplacedNullCheck" /> |
| <rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock" /> |
| <rule ref="category/java/errorprone.xml/UnconditionalIfStatement" /> |
| <rule ref="category/java/errorprone.xml/UnnecessaryConversionTemporary" /> |
| |
| <rule ref="category/java/multithreading.xml/AvoidThreadGroup" /> |
| <rule ref="category/java/multithreading.xml/DontCallThreadRun" /> |
| <rule ref="category/java/multithreading.xml/DoubleCheckedLocking" /> |
| <rule ref="category/java/multithreading.xml/UnsynchronizedStaticFormatter" /> |
| |
| <rule ref="category/java/performance.xml/BigIntegerInstantiation" /> |
| <rule ref="category/java/performance.xml/InefficientEmptyStringCheck" /> |
| <rule ref="category/java/performance.xml/StringInstantiation" /> |
| <rule ref="category/java/performance.xml/StringToString" /> |
| <rule ref="category/java/performance.xml/TooFewBranchesForSwitch"> |
| <properties> |
| <property name="minimumNumberCaseForASwitch" value="2" /> |
| </properties> |
| </rule> |
| <rule ref="category/java/performance.xml/UselessStringValueOf" /> |
| <rule ref="category/java/performance.xml/UseStringBufferForStringAppends" /> |
| </ruleset> |