Skip to content

Commit

Permalink
build: change rules
Browse files Browse the repository at this point in the history
Rules were modified.

#10
  • Loading branch information
josantonius committed Jun 21, 2022
1 parent 80bb790 commit 0b7ddc4
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 32 deletions.
78 changes: 70 additions & 8 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,79 @@
<?xml version="1.0"?>
<ruleset name="Coding Standards">

<ruleset name="PHP Coding Standards">
<description>Coding Standards</description>

<description>PHP Coding Standards</description>
<rule ref="PSR2"/>

<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.Commenting.Fixme"/>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="100"/>
<property name="absoluteLineLimit" value="120"/>
</properties>
</rule>
<rule ref="Generic.Formatting.DisallowMultipleStatements"/>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.Functions.CallTimePassByReference"/>
<rule ref="Generic.Functions.FunctionCallArgumentSpacing"/>
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="50"/>
<property name="absoluteComplexity" value="100"/>
</properties>
</rule>
<rule ref="Generic.Metrics.NestingLevel">
<properties>
<property name="nestingLevel" value="10"/>
<property name="absoluteNestingLevel" value="30"/>
</properties>
</rule>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.DisallowShortOpenTag"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"/>

<rule ref="PSR2" />
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
</properties>
</rule>
<rule ref="MySource.PHP.EvalObjectFactory"/>
<rule ref="PSR1.Classes.ClassDeclaration"/>
<rule ref="PSR1.Files.SideEffects"/>
<rule ref="PSR2.Classes.ClassDeclaration"/>
<rule ref="PSR2.Classes.PropertyDeclaration"/>
<rule ref="PSR2.ControlStructures.ControlStructureSpacing"/>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
<rule ref="PSR2.ControlStructures.SwitchDeclaration"/>
<rule ref="PSR2.Files.EndFileNewline"/>
<rule ref="PSR2.Methods.MethodDeclaration"/>
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
<rule ref="PSR2.Namespaces.UseDeclaration"/>
<rule ref="Zend.Files.ClosingTag"/>

<exclude-pattern>node_modules</exclude-pattern>

<exclude-pattern>vendor</exclude-pattern>
<arg name="colors"/>
<arg value="spvnl"/>
<ini name="memory_limit" value="128M"/>

<exclude-pattern>node_modules</exclude-pattern>
<exclude-pattern>vendor</exclude-pattern>
</ruleset>
64 changes: 40 additions & 24 deletions phpmd.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
<ruleset
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<!--codesize-->
<ruleset name="PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<!--Clean Code Rules-->
<!--<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag"/>-->
<!--<rule ref="rulesets/cleancode.xml/ElseExpression"/>-->
<!--<rule ref="rulesets/cleancode.xml/StaticAccess"/>-->
<rule ref="rulesets/cleancode.xml/IfStatementAssignment"/>
<rule ref="rulesets/cleancode.xml/DuplicatedArrayKey"/>
<rule ref="rulesets/cleancode.xml/MissingImport"/>
<rule ref="rulesets/cleancode.xml/UndefinedVariable"/>
<!--<rule ref="rulesets/cleancode.xml/ErrorControlOperator"/>-->
<!--Code Size Rules-->
<rule ref="rulesets/codesize.xml/CyclomaticComplexity"/>
<rule ref="rulesets/codesize.xml/NPathComplexity"/>
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity"/>
<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength"/>
<rule ref="rulesets/codesize.xml/ExcessiveClassLength"/>
<rule ref="rulesets/codesize.xml/ExcessiveParameterList"/>
<rule ref="rulesets/codesize.xml/ExcessivePublicCount"/>
<rule ref="rulesets/codesize.xml/TooManyFields"/>
<rule ref="rulesets/codesize.xml/TooManyMethods"/>
<!--design-->
<rule ref="rulesets/design.xml/EvalExpression"/>
<!--<rule ref="rulesets/codesize.xml/TooManyPublicMethods"/>-->
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity"/>
<!--Controversial Rules-->
<!--<rule ref="rulesets/controversial.xml/Superglobals"/>-->
<rule ref="rulesets/controversial.xml/CamelCaseClassName"/>
<rule ref="rulesets/controversial.xml/CamelCasePropertyName"/>
<rule ref="rulesets/controversial.xml/CamelCaseMethodName"/>
<rule ref="rulesets/controversial.xml/CamelCaseParameterName"/>
<rule ref="rulesets/controversial.xml/CamelCaseVariableName"/>
<!--Design Rules-->
<rule ref="rulesets/design.xml/ExitExpression"/>
<rule ref="rulesets/design.xml/EvalExpression"/>
<rule ref="rulesets/design.xml/GotoStatement"/>
<rule ref="rulesets/design.xml/NumberOfChildren"/>
<rule ref="rulesets/design.xml/DepthOfInheritance"/>
Expand All @@ -24,22 +41,21 @@
<property name="minimum" value="14"/>
</properties>
</rule>
<!--naming-->
<rule ref="rulesets/design.xml/DevelopmentCodeFragment"/>
<rule ref="rulesets/design.xml/EmptyCatchBlock"/>
<rule ref="rulesets/design.xml/CountInLoopExpression"/>
<!--Naming Rules-->
<rule ref="rulesets/naming.xml/LongClassName"/>
<rule ref="rulesets/naming.xml/ShortClassName"/>
<!--<rule ref="rulesets/naming.xml/ShortVariable"/>-->
<rule ref="rulesets/naming.xml/LongVariable"/>
<!--<rule ref="rulesets/naming.xml/ShortMethodName"/>-->
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass"/>
<rule ref="rulesets/naming.xml/ConstantNamingConventions"/>
<rule ref="rulesets/naming.xml/BooleanGetMethodName"/>
<!--unusedcode-->
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>
<!--<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>-->
<!--Unused Code Rules-->
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField"/>
<!--<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable"/>-->
<rule ref="rulesets/unusedcode.xml/UnusedPrivateMethod"/>
<!--controversial-->
<!--<rule ref="rulesets/controversial.xml/Superglobals"/>-->
<rule ref="rulesets/controversial.xml/CamelCaseClassName"/>
<rule ref="rulesets/controversial.xml/CamelCasePropertyName"/>
<rule ref="rulesets/controversial.xml/CamelCaseMethodName"/>
<rule ref="rulesets/controversial.xml/CamelCaseParameterName"/>
<rule ref="rulesets/controversial.xml/CamelCaseVariableName"/>
<!--cleancode-->
<!--<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag"/>-->
<!--<rule ref="rulesets/cleancode.xml/ElseExpression"/>-->
<rule ref="rulesets/unusedcode.xml/UnusedFormalParameter"/>
</ruleset>

0 comments on commit 0b7ddc4

Please sign in to comment.