Add more tests

This commit is contained in:
Dennis Eichhorn 2018-02-28 20:39:16 +01:00
parent 70f334fd6f
commit a0792d8691

View File

@ -1,116 +1,151 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ruleset name="default"> <ruleset name="default">
<description></description> <description></description>
<exclude-pattern>*.tpl.php</exclude-pattern> <exclude-pattern>*.tpl.php</exclude-pattern>
<exclude-pattern>*Routes.php</exclude-pattern> <exclude-pattern>*Routes.php</exclude-pattern>
<exclude-pattern>*ObjLoader.js</exclude-pattern> <exclude-pattern>*ObjLoader.js</exclude-pattern>
<exclude-pattern>*/vendor/*</exclude-pattern> <exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/Routes/*</exclude-pattern> <exclude-pattern>*/Routes/*</exclude-pattern>
<arg value="q"/> <arg value="q"/>
<rule ref="Generic.Classes.DuplicateClassName"/> <arg name="colors"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/> <rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/> <rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/> <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
<rule ref="Generic.Commenting.Todo"> <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
<severity>3</severity> <rule ref="Generic.Commenting.Todo">
</rule> <severity>3</severity>
<rule ref="Generic.Commenting.Fixme"> </rule>
<severity>3</severity> <rule ref="Generic.Commenting.Fixme">
</rule> <severity>3</severity>
<rule ref="Generic.ControlStructures.InlineControlStructure"/> </rule>
<rule ref="Generic.Files.ByteOrderMark"/> <rule ref="Generic.ControlStructures.InlineControlStructure"/>
<rule ref="Generic.Files.LineEndings"/> <rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.Files.LineLength"> <rule ref="Generic.PHP.DisallowAlternativePHPTags"/>
<severity>3</severity> <rule ref="Generic.PHP.DisallowShortOpenTag"/>
<properties> <rule ref="Generic.PHP.DiscourageGoto"/>
<property name="lineLimit" value="150"/> <rule ref="Generic.PHP.ForbiddenFunctions">
<property name="absoluteLineLimit" value="250"/> <properties>
</properties> <property name="forbiddenFunctions" type="array" value="delete=>unset,print=>echo,create_function=>null" />
</rule> </properties>
<rule ref="Generic.Formatting.DisallowMultipleStatements"> </rule>
<exclude-pattern>*/tests/*</exclude-pattern><!-- inline function definition --> <rule ref="Generic.Files.ByteOrderMark"/>
</rule> <rule ref="Generic.Files.LineLength">
<rule ref="Generic.Formatting.MultipleStatementAlignment"/> <rule ref="Generic.Files.OneTraitPerFile"/>
<rule ref="Generic.Formatting.SpaceAfterCast"/> <rule ref="Generic.Files.OneInterfacePerFile"/>
<rule ref="Generic.Functions.CallTimePassByReference"/> <rule ref="Generic.Files.OneClassPerFile"/>
<rule ref="Generic.Functions.OpeningFunctionBraceBsdAllman"/> <rule ref="Generic.Files.OneObjectStructurePerFile"/>
<rule ref="Generic.Metrics.CyclomaticComplexity"> <rule ref="Generic.Files.LineEndings">
<properties> <properties>
<property name="complexity" value="15"/> <property name="eolChar" value="\n"/>
<property name="absoluteComplexity" value="25"/> </properties>
</properties> </rule>
<exclude-pattern>*Measurement.php</exclude-pattern><!-- Very simple switch statements --> <rule ref="Generic.Debug.ESLint"/>
</rule> <rule ref="Generic.Debug.CSSLint"/>
<rule ref="Generic.Metrics.NestingLevel"> <rule ref="Generic.Debug.JSHint"/>
<properties> <severity>3</severity>
<property name="nestingLevel" value="5"/> <properties>
<property name="absoluteNestingLevel" value="11"/> <property name="lineLimit" value="150"/>
</properties> <property name="absoluteLineLimit" value="250"/>
</rule> </properties>
<rule ref="Generic.NamingConventions.ConstructorName"/> </rule>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/> <rule ref="Generic.Formatting.DisallowMultipleStatements">
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"> <exclude-pattern>*/tests/*</exclude-pattern><!-- inline function definition -->
<severity>3</severity> </rule>
<exclude-pattern>*StringUtils.php</exclude-pattern><!-- Implements missing default functions --> <rule ref="Generic.Formatting.MultipleStatementAlignment"/>
<exclude-pattern>*FinanceFormulas.php</exclude-pattern><!-- Correct name is more important than rule --> <rule ref="Generic.Formatting.SpaceAfterCast"/>
<exclude-pattern>*StockBonds.php</exclude-pattern><!-- Correct name is more important than rule --> <rule ref="Generic.Functions.CallTimePassByReference"/>
<exclude-pattern>*ExponentialSmoothing.php</exclude-pattern><!-- Correct name is more important than rule --> <rule ref="Generic.Metrics.CyclomaticComplexity">
</rule> <properties>
<rule ref="Generic.PHP.LowerCaseConstant"/> <property name="complexity" value="15"/>
<rule ref="Generic.PHP.NoSilencedErrors"/> <property name="absoluteComplexity" value="25"/>
<rule ref="Generic.Strings.UnnecessaryStringConcat"> </properties>
<properties> <exclude-pattern>*Measurement.php</exclude-pattern><!-- Very simple switch statements -->
<property name="allowMultiline" value="true" /> </rule>
</properties> <rule ref="Generic.Metrics.NestingLevel">
</rule> <properties>
<rule ref="Generic.WhiteSpace.DisallowTabIndent"/> <property name="nestingLevel" value="5"/>
<rule ref="MySource.PHP.EvalObjectFactory"/> <property name="absoluteNestingLevel" value="11"/>
<rule ref="MySource.PHP.GetRequestData"> </properties>
<exclude-pattern>*Request.php</exclude-pattern> </rule>
</rule> <rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="PEAR.Classes.ClassDeclaration"/> <rule ref="Generic.NamingConventions.UpperCaseConstantName"/>
<rule ref="PEAR.Commenting.FunctionComment"> <rule ref="Generic.NamingConventions.CamelCapsFunctionName">
<exclude-pattern>*/tests/*</exclude-pattern><!-- Tests don't need comments --> <severity>3</severity>
</rule> <exclude-pattern>*StringUtils.php</exclude-pattern><!-- Implements missing default functions -->
<rule ref="PEAR.Commenting.InlineComment"/> <exclude-pattern>*FinanceFormulas.php</exclude-pattern><!-- Correct name is more important than rule -->
<rule ref="PEAR.ControlStructures.ControlSignature"/> <exclude-pattern>*StockBonds.php</exclude-pattern><!-- Correct name is more important than rule -->
<rule ref="PEAR.ControlStructures.MultiLineCondition"/> <exclude-pattern>*ExponentialSmoothing.php</exclude-pattern><!-- Correct name is more important than rule -->
<rule ref="PEAR.Functions.ValidDefaultValue"/> </rule>
<rule ref="PSR1.Classes.ClassDeclaration"/> <rule ref="Generic.PHP.LowerCaseConstant"/>
<rule ref="PSR1.Files.SideEffects"> <rule ref="Generic.PHP.NoSilencedErrors"/>
<severity>3</severity> <rule ref="Generic.Strings.UnnecessaryStringConcat">
<exclude-pattern>*Pdf.php</exclude-pattern><!-- Just a wrapper --> <properties>
<exclude-pattern>*Excel.php</exclude-pattern><!-- Just a wrapper --> <property name="allowMultiline" value="true" />
<exclude-pattern>*/tests/*</exclude-pattern><!-- Tests don't always have side effects --> </properties>
</rule> </rule>
<rule ref="PSR2.Classes.ClassDeclaration"/> <rule ref="Generic.WhiteSpace.DisallowTabIndent"/>
<rule ref="PSR2.Classes.PropertyDeclaration"/> <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
<rule ref="PSR2.ControlStructures.ControlStructureSpacing"/> <rule ref="PEAR.Classes.ClassDeclaration"/>
<rule ref="PSR2.ControlStructures.ElseIfDeclaration"/> <rule ref="PEAR.Commenting.FunctionComment">
<rule ref="PSR2.ControlStructures.SwitchDeclaration"/> <exclude-pattern>*/tests/*</exclude-pattern><!-- Tests don't need comments -->
<rule ref="PSR2.Files.EndFileNewline"/> </rule>
<rule ref="PSR2.Methods.MethodDeclaration"/> <rule ref="PEAR.Commenting.InlineComment"/>
<rule ref="PSR2.Namespaces.NamespaceDeclaration"/> <rule ref="PEAR.ControlStructures.ControlSignature"/>
<rule ref="PSR2.Namespaces.UseDeclaration"/> <rule ref="PEAR.ControlStructures.MultiLineCondition"/>
<rule ref="Squiz.PHP.NonExecutableCode"/> <rule ref="PEAR.Functions.ValidDefaultValue"/>
<rule ref="Squiz.Scope.StaticThisUsage"/> <rule ref="PSR1.Files.SideEffects">
<rule ref="Squiz.WhiteSpace.CastSpacing"/> <rule ref="PSR1.Classes.ClassDeclaration"/>
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/> <severity>3</severity>
<rule ref="Squiz.WhiteSpace.ObjectOperatorSpacing"> <exclude-pattern>*Pdf.php</exclude-pattern><!-- Just a wrapper -->
<properties> <exclude-pattern>*Excel.php</exclude-pattern><!-- Just a wrapper -->
<property name="ignoreNewlines" value="true"/> <exclude-pattern>*/tests/*</exclude-pattern><!-- Tests don't always have side effects -->
</properties> </rule>
</rule> <rule ref="PSR2.Classes.ClassDeclaration"/>
<rule ref="Squiz.WhiteSpace.OperatorSpacing"> <rule ref="PSR2.Classes.PropertyDeclaration"/>
<properties> <rule ref="PSR2.ControlStructures.ControlStructureSpacing"/>
<property name="ignoreNewlines" value="true"/> <rule ref="PSR2.ControlStructures.ElseIfDeclaration"/>
</properties> <rule ref="PSR2.ControlStructures.SwitchDeclaration"/>
<exclude-pattern>*Http.js</exclude-pattern><!-- Regex false positive --> <rule ref="PSR2.Files.EndFileNewline"/>
</rule> <rule ref="PSR2.Methods.MethodDeclaration"/>
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/> <rule ref="PSR2.Namespaces.NamespaceDeclaration"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/> <rule ref="PSR2.Namespaces.UseDeclaration"/>
<rule ref="Zend.Files.ClosingTag"/> <rule ref="MySource.Objects.AssignThis"/>
<rule ref="MySource.PHP.EvalObjectFactory"/>
<rule ref="MySource.PHP.GetRequestData">
<exclude-pattern>*Request.php</exclude-pattern>
</rule>
<rule ref="Squiz.Classes.DuplicateProperty"/>
<rule ref="Squiz.CSS.DuplicateStyleDefinition"/>
<rule ref="Squiz.CSS.EmptyClassDefinition"/>
<rule ref="Squiz.CSS.EmptyStyleDefinition"/>
<rule ref="Squiz.CSS.Indentation"/>
<rule ref="Squiz.CSS.LowercaseStyleDefinition"/>
<rule ref="Squiz.CSS.MissingColon"/>
<rule ref="Squiz.CSS.ShorthandSize"/>
<rule ref="Squiz.Functions.GlobalFunction">
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Squiz.PHP.ForbiddenFunctions"/>
<rule ref="Squiz.PHP.GlobalKeyword"/>
<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">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
<properties>
<property name="ignoreNewlines" value="true"/>
</properties>
<exclude-pattern>*Http.js</exclude-pattern><!-- Regex false positive -->
</rule>
<rule ref="Squiz.WhiteSpace.ScopeKeywordSpacing"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
<rule ref="Zend.Files.ClosingTag"/>
</ruleset> </ruleset>