| 
									
										
										
										
											2023-06-21 12:34:58 +02:00
										 |  |  | <?xml version="1.0" encoding="UTF-8"?> | 
					
						
							| 
									
										
										
										
											2023-07-15 16:02:42 +02:00
										 |  |  | <!--
 | 
					
						
							|  |  |  |   ~ phpmd.xml | 
					
						
							|  |  |  |   ~ Copyright (c) 2023 james@firefly-iii.org | 
					
						
							|  |  |  |   ~ | 
					
						
							|  |  |  |   ~ This file is part of Firefly III (https://github.com/firefly-iii). | 
					
						
							|  |  |  |   ~ | 
					
						
							|  |  |  |   ~ This program is free software: you can redistribute it and/or modify | 
					
						
							|  |  |  |   ~ it under the terms of the GNU Affero General Public License as | 
					
						
							|  |  |  |   ~ published by the Free Software Foundation, either version 3 of the | 
					
						
							|  |  |  |   ~ License, or (at your option) any later version. | 
					
						
							|  |  |  |   ~ | 
					
						
							|  |  |  |   ~ This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |   ~ but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |   ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |   ~ GNU Affero General Public License for more details. | 
					
						
							|  |  |  |   ~ | 
					
						
							|  |  |  |   ~ You should have received a copy of the GNU Affero General Public License | 
					
						
							|  |  |  |   ~ along with this program.  If not, see <https://www.gnu.org/licenses/>. | 
					
						
							|  |  |  |   --> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-02 15:40:33 +02:00
										 |  |  | <ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 
					
						
							|  |  |  |          name="pcsg-generated-ruleset" | 
					
						
							| 
									
										
										
										
											2023-11-05 10:16:53 +01:00
										 |  |  |          xmlns="http://pmd.sf.net/ruleset/1.0.0" | 
					
						
							|  |  |  |          xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | 
					
						
							|  |  |  |          xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | 
					
						
							| 
									
										
										
										
											2023-11-05 20:18:16 +01:00
										 |  |  |     <description>Firefly III ruleset.</description> | 
					
						
							|  |  |  |     <!-- Import the entire controversial code rule set --> | 
					
						
							|  |  |  |     <rule ref="rulesets/controversial.xml"> | 
					
						
							| 
									
										
										
										
											2023-12-01 05:15:59 +01:00
										 |  |  |         <exclude name="CamelCasePropertyName"/> | 
					
						
							| 
									
										
										
										
											2023-11-05 20:18:16 +01:00
										 |  |  |     </rule> | 
					
						
							| 
									
										
										
										
											2023-06-21 12:34:58 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-05 20:18:16 +01:00
										 |  |  |     <!-- clean code --> | 
					
						
							|  |  |  |     <!-- <rule ref="rulesets/codesize.xml" /> --> | 
					
						
							| 
									
										
										
										
											2023-12-01 05:15:59 +01:00
										 |  |  |     <rule ref="rulesets/unusedcode.xml"/> | 
					
						
							| 
									
										
										
										
											2023-06-21 12:34:58 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-15 16:02:42 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-26 12:24:37 +01:00
										 |  |  |     <rule ref="rulesets/design.xml/NumberOfChildren"> | 
					
						
							|  |  |  |         <properties> | 
					
						
							| 
									
										
										
										
											2023-12-22 20:12:38 +01:00
										 |  |  |             <!-- This is now at 32, which excludes the controllers but should prevent more monoliths. --> | 
					
						
							|  |  |  |             <property name="minimum" value="32"/> | 
					
						
							| 
									
										
										
										
											2023-11-26 12:24:37 +01:00
										 |  |  |         </properties> | 
					
						
							|  |  |  |     </rule> | 
					
						
							|  |  |  |     <rule ref="rulesets/design.xml/CouplingBetweenObjects"> | 
					
						
							|  |  |  |         <properties> | 
					
						
							| 
									
										
										
										
											2023-12-22 20:12:38 +01:00
										 |  |  |             <!-- Leaving this at 28 excuses most current code but it can't get worse than that. --> | 
					
						
							|  |  |  |             <property name="maximum" value="28"/> | 
					
						
							| 
									
										
										
										
											2023-11-26 12:24:37 +01:00
										 |  |  |         </properties> | 
					
						
							|  |  |  |     </rule> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-21 12:34:58 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-05 20:18:16 +01:00
										 |  |  |     <rule ref="rulesets/naming.xml/ShortMethodName"> | 
					
						
							|  |  |  |         <properties> | 
					
						
							| 
									
										
										
										
											2023-12-01 05:15:59 +01:00
										 |  |  |             <property name="minimum" value="3"/> | 
					
						
							| 
									
										
										
										
											2023-11-05 20:18:16 +01:00
										 |  |  |         </properties> | 
					
						
							|  |  |  |     </rule> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     <!-- code size --> | 
					
						
							|  |  |  |     <rule ref="rulesets/codesize.xml/CyclomaticComplexity"> | 
					
						
							|  |  |  |         <properties> | 
					
						
							| 
									
										
										
										
											2023-12-22 20:12:38 +01:00
										 |  |  |             <!-- Leave at 20. This means methods will be pretty complex before the system starts complaining. --> | 
					
						
							|  |  |  |             <property name="reportLevel" value="20"/> | 
					
						
							| 
									
										
										
										
											2023-11-05 20:18:16 +01:00
										 |  |  |         </properties> | 
					
						
							|  |  |  |     </rule> | 
					
						
							|  |  |  |     <rule ref="rulesets/codesize.xml/NPathComplexity"> | 
					
						
							|  |  |  |         <properties> | 
					
						
							| 
									
										
										
										
											2023-12-22 20:12:38 +01:00
										 |  |  |             <!-- 2000 results in some pretty complex methods, but it's OK. --> | 
					
						
							|  |  |  |             <!-- They should not be much more complex than that though --> | 
					
						
							|  |  |  |             <property name="minimum" value="2000"/> | 
					
						
							| 
									
										
										
										
											2023-11-05 20:18:16 +01:00
										 |  |  |         </properties> | 
					
						
							|  |  |  |     </rule> | 
					
						
							|  |  |  |     <rule ref="rulesets/codesize.xml/ExcessiveMethodLength"> | 
					
						
							|  |  |  |         <properties> | 
					
						
							| 
									
										
										
										
											2023-12-22 17:28:42 +01:00
										 |  |  |             <!-- 75 seems like a nice number. Shorter isn't always feasible and there are a few exceptions already --> | 
					
						
							|  |  |  |             <property name="minimum" value="75"/> | 
					
						
							| 
									
										
										
										
											2023-12-02 07:05:34 +01:00
										 |  |  |             <property name="ignore-whitespace" value="true"/> | 
					
						
							| 
									
										
										
										
											2023-11-05 20:18:16 +01:00
										 |  |  |         </properties> | 
					
						
							|  |  |  |     </rule> | 
					
						
							|  |  |  |     <rule ref="rulesets/codesize.xml/ExcessiveParameterList"> | 
					
						
							|  |  |  |         <properties> | 
					
						
							| 
									
										
										
										
											2023-12-01 05:15:59 +01:00
										 |  |  |             <!-- 5 is fine. 6 is excessive, but I have just one of those. At the end of the day, I still need all params. --> | 
					
						
							|  |  |  |             <property name="minimum" value="5"/> | 
					
						
							| 
									
										
										
										
											2023-11-05 20:18:16 +01:00
										 |  |  |         </properties> | 
					
						
							|  |  |  |     </rule> | 
					
						
							| 
									
										
										
										
											2023-06-21 12:34:58 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-05 20:18:16 +01:00
										 |  |  |     <!-- include clean code manually --> | 
					
						
							| 
									
										
										
										
											2023-12-01 05:15:59 +01:00
										 |  |  |     <rule ref="rulesets/cleancode.xml/BooleanArgumentFlag"/> | 
					
						
							|  |  |  |     <rule ref="rulesets/cleancode.xml/ElseExpression"/> | 
					
						
							|  |  |  |     <rule ref="rulesets/cleancode.xml/MissingImport"/> | 
					
						
							|  |  |  |     <rule ref="rulesets/cleancode.xml/UndefinedVariable"/> | 
					
						
							|  |  |  |     <rule ref="rulesets/cleancode.xml/IfStatementAssignment"/> | 
					
						
							|  |  |  |     <rule ref="rulesets/cleancode.xml/DuplicatedArrayKey"/> | 
					
						
							|  |  |  |     <rule ref="rulesets/cleancode.xml/ErrorControlOperator"/> | 
					
						
							| 
									
										
										
										
											2023-07-15 16:02:42 +02:00
										 |  |  | </ruleset> |