Build/Config/phpcs.xml

98 lines
4.6 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="default">
<description></description>
<exclude-pattern>*.tpl.php</exclude-pattern>
<exclude-pattern>*Routes.php</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/Routes/*</exclude-pattern>
<arg value="q"/>
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<rule ref="Generic.Commenting.Todo">
<severity>3</severity>
</rule>
<rule ref="Generic.Commenting.Fixme">
<severity>3</severity>
</rule>
<rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.Files.LineEndings"/>
<rule ref="Generic.Files.LineLength">
<severity>3</severity>
<properties>
<property name="lineLimit" value="150"/>
<property name="absoluteLineLimit" value="250"/>
</properties>
</rule>
<rule ref="Generic.Formatting.DisallowMultipleStatements">
<exclude-pattern>*/tests/*</exclude-pattern><!-- inline function definition -->
</rule>
<rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/>
<rule ref="Generic.Functions.CallTimePassByReference"/>
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/>
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="15"/>
<property name="absoluteComplexity" value="25"/>
</properties>
<exclude-pattern>*Measurement.php</exclude-pattern><!-- Very simple switch statements -->
</rule>
<rule ref="Generic.Metrics.NestingLevel">
<properties>
<property name="nestingLevel" value="5"/>
<property name="absoluteNestingLevel" value="11"/>
</properties>
</rule>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="Generic.NamingConventions.CamelCapsFunctionName">
<severity>3</severity>
<exclude-pattern>*StringUtils.php</exclude-pattern><!-- Implements missing default functions -->
<exclude-pattern>*FinanceFormulas.php</exclude-pattern><!-- Correct name is more important than rule -->
<exclude-pattern>*StockBonds.php</exclude-pattern><!-- Correct name is more important than rule -->
<exclude-pattern>*ExponentialSmoothing.php</exclude-pattern><!-- Correct name is more important than rule -->
</rule>
<rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<!--<rule ref="Generic.Strings.UnnecessaryStringConcat"/> Bugged for single quotes where $ cannot be put inside -->
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="MySource.PHP.EvalObjectFactory"/>
<rule ref="MySource.PHP.GetRequestData"/>
<rule ref="PEAR.Classes.ClassDeclaration"/>
<!--<rule ref="PEAR.Commenting.FunctionComment"/> problem with inheritdocblock-->
<rule ref="PEAR.Commenting.InlineComment"/>
<rule ref="PEAR.ControlStructures.ControlSignature"/>
<rule ref="PEAR.ControlStructures.MultiLineCondition"/>
<rule ref="PEAR.Functions.ValidDefaultValue"/>
<rule ref="PSR1.Classes.ClassDeclaration"/>
<rule ref="PSR1.Files.SideEffects">
<severity>3</severity>
<exclude-pattern>*Pdf.php</exclude-pattern><!-- Just a wrapper -->
<exclude-pattern>*Excel.php</exclude-pattern><!-- Just a wrapper -->
<exclude-pattern>*/tests/*</exclude-pattern><!-- Tests don't always have side effects -->
</rule>
<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="Squiz.PHP.NonExecutableCode"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<!--<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing"/> multiline object operator should be valid e.g. -> -->
<rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<rule ref="Zend.Files.ClosingTag"/>
</ruleset>