Skip to content

Commit cb401fe

Browse files
authored
chore: configure PMD (#5155)
1 parent bbe4a02 commit cb401fe

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

.github/workflows/build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ jobs:
3333
run: mvn checkstyle:check
3434
- name: SpotBugs
3535
run: mvn spotbugs:check
36+
- name: PMD
37+
run: mvn pmd:check

pmd-exclude.properties

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
com.thealgorithms.bitmanipulation.SingleBitOperations=UselessParentheses
2+
com.thealgorithms.ciphers.AffineCipher=UselessParentheses
3+
com.thealgorithms.ciphers.ColumnarTranspositionCipher=UnnecessaryFullyQualifiedName
4+
com.thealgorithms.ciphers.DES=UselessParentheses
5+
com.thealgorithms.ciphers.HillCipher=UselessParentheses
6+
com.thealgorithms.ciphers.RSA=UselessParentheses
7+
com.thealgorithms.conversions.AnyBaseToAnyBase=UselessParentheses
8+
com.thealgorithms.conversions.AnytoAny=UselessParentheses
9+
com.thealgorithms.conversions.HexToOct=UselessParentheses
10+
com.thealgorithms.conversions.IntegerToRoman=UnnecessaryFullyQualifiedName
11+
com.thealgorithms.datastructures.crdt.LWWElementSet=UselessParentheses
12+
com.thealgorithms.datastructures.crdt.Pair=UnusedPrivateField
13+
com.thealgorithms.datastructures.graphs.A_Star=UselessParentheses
14+
com.thealgorithms.datastructures.graphs.AdjacencyMatrixGraph=CollapsibleIfStatements,UnnecessaryFullyQualifiedName,UselessParentheses
15+
com.thealgorithms.datastructures.graphs.BipartiteGrapfDFS=CollapsibleIfStatements
16+
com.thealgorithms.datastructures.graphs.Kruskal=UselessParentheses
17+
com.thealgorithms.datastructures.hashmap.hashing.HashMapCuckooHashing=UselessParentheses
18+
com.thealgorithms.datastructures.heaps.FibonacciHeap=UselessParentheses
19+
com.thealgorithms.datastructures.heaps.HeapElement=UselessParentheses
20+
com.thealgorithms.datastructures.heaps.HeapNode=UselessParentheses
21+
com.thealgorithms.datastructures.lists.DoublyLinkedList=UselessParentheses
22+
com.thealgorithms.datastructures.lists.SearchSinglyLinkedListRecursion=UselessParentheses
23+
com.thealgorithms.datastructures.lists.SinglyLinkedList=UnusedLocalVariable
24+
com.thealgorithms.datastructures.queues.PriorityQueue=UselessParentheses
25+
com.thealgorithms.datastructures.stacks.NodeStack=UnnecessaryFullyQualifiedName,UnusedFormalParameter
26+
com.thealgorithms.datastructures.stacks.StackArray=UselessParentheses
27+
com.thealgorithms.datastructures.trees.CheckBinaryTreeIsValidBST=UselessParentheses
28+
com.thealgorithms.datastructures.trees.Point=OverrideBothEqualsAndHashcode
29+
com.thealgorithms.datastructures.trees.SegmentTree=UselessParentheses
30+
com.thealgorithms.devutils.nodes.LargeTreeNode=UselessParentheses
31+
com.thealgorithms.devutils.nodes.SimpleNode=UselessParentheses
32+
com.thealgorithms.devutils.nodes.SimpleTreeNode=UselessParentheses
33+
com.thealgorithms.devutils.nodes.TreeNode=UselessParentheses
34+
com.thealgorithms.divideandconquer.ClosestPair=UnnecessaryFullyQualifiedName,UselessParentheses
35+
com.thealgorithms.divideandconquer.Point=UselessParentheses
36+
com.thealgorithms.dynamicprogramming.KnapsackMemoization=UselessParentheses
37+
com.thealgorithms.dynamicprogramming.MatrixChainMultiplication=UselessParentheses
38+
com.thealgorithms.dynamicprogramming.ShortestSuperSequence=UselessParentheses
39+
com.thealgorithms.dynamicprogramming.UniquePaths=UnnecessarySemicolon
40+
com.thealgorithms.dynamicprogramming.WineProblem=UselessParentheses
41+
com.thealgorithms.maths.BinomialCoefficient=UselessParentheses
42+
com.thealgorithms.maths.Complex=UselessParentheses
43+
com.thealgorithms.maths.DistanceFormulaTest=UnnecessaryFullyQualifiedName
44+
com.thealgorithms.maths.DudeneyNumber=UselessParentheses
45+
com.thealgorithms.maths.FibonacciJavaStreamsTest=BigIntegerInstantiation
46+
com.thealgorithms.maths.Gaussian=UselessParentheses
47+
com.thealgorithms.maths.GcdSolutionWrapper=UselessParentheses
48+
com.thealgorithms.maths.HeronsFormula=UselessParentheses
49+
com.thealgorithms.maths.KaprekarNumbers=UselessParentheses
50+
com.thealgorithms.maths.KeithNumber=UselessParentheses
51+
com.thealgorithms.maths.LeonardoNumber=UselessParentheses
52+
com.thealgorithms.maths.LinearDiophantineEquationsSolver=UselessParentheses
53+
com.thealgorithms.maths.MatrixUtil=BigIntegerInstantiation,UselessParentheses
54+
com.thealgorithms.maths.RomanNumeralUtil=UselessParentheses
55+
com.thealgorithms.maths.SecondMinMax=UselessParentheses
56+
com.thealgorithms.maths.SecondMinMaxTest=UnnecessaryFullyQualifiedName
57+
com.thealgorithms.maths.StandardDeviation=UselessParentheses
58+
com.thealgorithms.maths.SumOfArithmeticSeries=UselessParentheses
59+
com.thealgorithms.maths.TrinomialTriangle=UselessParentheses
60+
com.thealgorithms.maths.VampireNumber=CollapsibleIfStatements
61+
com.thealgorithms.maths.Volume=UselessParentheses
62+
com.thealgorithms.matrixexponentiation.Fibonacci=UnnecessaryFullyQualifiedName
63+
com.thealgorithms.misc.Sparsity=UselessParentheses
64+
com.thealgorithms.misc.ThreeSumProblem=UselessParentheses
65+
com.thealgorithms.misc.WordBoggle=UselessParentheses
66+
com.thealgorithms.others.CRC16=UselessParentheses
67+
com.thealgorithms.others.Damm=UnnecessaryFullyQualifiedName
68+
com.thealgorithms.others.Luhn=UnnecessaryFullyQualifiedName
69+
com.thealgorithms.others.Mandelbrot=UselessParentheses
70+
com.thealgorithms.others.MaximumSumOfDistinctSubarraysWithLengthK=CollapsibleIfStatements
71+
com.thealgorithms.others.MiniMaxAlgorithm=UselessParentheses
72+
com.thealgorithms.others.PageRank=UselessParentheses
73+
com.thealgorithms.others.PerlinNoise=UselessParentheses
74+
com.thealgorithms.others.QueueUsingTwoStacks=UselessParentheses
75+
com.thealgorithms.others.QueueWithStack=UselessParentheses
76+
com.thealgorithms.others.Trieac=UselessParentheses
77+
com.thealgorithms.others.Verhoeff=UnnecessaryFullyQualifiedName
78+
com.thealgorithms.searches.InterpolationSearch=UselessParentheses
79+
com.thealgorithms.searches.KMPSearch=UselessParentheses
80+
com.thealgorithms.searches.LinearSearchThread=EmptyCatchBlock
81+
com.thealgorithms.searches.RabinKarpAlgorithm=UselessParentheses
82+
com.thealgorithms.sorts.BubbleSortRecursion=UselessParentheses
83+
com.thealgorithms.sorts.CircleSort=EmptyControlStatement
84+
com.thealgorithms.sorts.CombSort=UselessParentheses
85+
com.thealgorithms.sorts.DutchNationalFlagSort=UselessParentheses
86+
com.thealgorithms.sorts.LinkListSort=EmptyControlStatement,UnusedLocalVariable
87+
com.thealgorithms.sorts.MergeSortNoExtraSpace=UselessParentheses
88+
com.thealgorithms.sorts.PigeonholeSort=UselessParentheses
89+
com.thealgorithms.sorts.RadixSort=UselessParentheses
90+
com.thealgorithms.sorts.WiggleSort=UselessParentheses
91+
com.thealgorithms.stacks.PostfixToInfix=UselessParentheses
92+
com.thealgorithms.strings.HorspoolSearch=UnnecessaryFullyQualifiedName,UselessParentheses
93+
com.thealgorithms.strings.MyAtoi=UselessParentheses
94+
com.thealgorithms.strings.Palindrome=UselessParentheses
95+
com.thealgorithms.strings.Solution=CollapsibleIfStatements

pom.xml

+11
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,17 @@
135135
</plugins>
136136
</configuration>
137137
</plugin>
138+
<plugin>
139+
<groupId>org.apache.maven.plugins</groupId>
140+
<artifactId>maven-pmd-plugin</artifactId>
141+
<version>3.22.0</version>
142+
<configuration>
143+
<printFailingErrors>true</printFailingErrors>
144+
<includeTests>true</includeTests>
145+
<linkXRef>false</linkXRef>
146+
<excludeFromFailureFile>pmd-exclude.properties</excludeFromFailureFile>
147+
</configuration>
148+
</plugin>
138149
</plugins>
139150
</build>
140151
</project>

0 commit comments

Comments
 (0)