2011-08-28 16:33:55 +02:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
<!DOCTYPE ruleset SYSTEM "ruleset.dtd">
|
|
|
|
|
<ruleset name="Dolibarr">
|
|
|
|
|
<description>Dolibarr coding standard.</description>
|
|
|
|
|
|
|
|
|
|
<!-- List of all tests -->
|
|
|
|
|
|
2013-09-10 11:50:18 +02:00
|
|
|
<rule ref="Internal.NoCodeFound">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
|
2011-08-28 16:33:55 +02:00
|
|
|
|
2012-01-10 10:24:16 +01:00
|
|
|
<rule ref="Generic.CodeAnalysis.EmptyStatement.NotAllowed">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-09-20 18:07:36 +02:00
|
|
|
<rule ref="Generic.CodeAnalysis.EmptyStatement.NotAllowedWarning">
|
2011-09-20 20:19:04 +02:00
|
|
|
<severity>0</severity>
|
2011-09-20 18:07:36 +02:00
|
|
|
</rule>
|
|
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<!-- <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" />
|
2011-09-24 16:19:24 +02:00
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.Found">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod" />
|
|
|
|
|
|
2012-01-16 12:50:55 +01:00
|
|
|
<!--
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="Generic.Commenting.Todo" />
|
2012-01-16 12:50:55 +01:00
|
|
|
-->
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<!-- Warning if action on same line than if -->
|
|
|
|
|
<!--
|
|
|
|
|
<rule ref="Generic.ControlStructures.InlineControlStructure">
|
|
|
|
|
<properties> <property name="error" value="false"/> </properties>
|
|
|
|
|
</rule>
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<!-- Lines can be 85 chars long, but never show errors -->
|
|
|
|
|
<rule ref="Generic.Files.LineLength">
|
|
|
|
|
<properties>
|
2011-08-28 19:40:51 +02:00
|
|
|
<property name="lineLimit" value="1000" />
|
2011-08-28 16:33:55 +02:00
|
|
|
<property name="absoluteLineLimit" value="0" />
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<!-- Use Unix newlines -->
|
|
|
|
|
<rule ref="Generic.Files.LineEndings">
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="eolChar" value="\n" />
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<!-- To disallow several statements on same line -->
|
|
|
|
|
<!-- <rule ref="Generic.Formatting.DisallowMultipleStatements" /> -->
|
|
|
|
|
|
|
|
|
|
<!-- Have 2 chars padding maximum and always show as errors -->
|
|
|
|
|
<!--
|
|
|
|
|
<rule ref="Generic.Formatting.MultipleStatementAlignment">
|
|
|
|
|
<properties> <property name="maxPadding" value="2"/> <property
|
|
|
|
|
name="ignoreMultiLine" value="true"/> </properties> </rule>
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.Formatting.SpaceAfterCast" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.Functions.CallTimePassByReference" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
|
|
|
|
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2012-07-22 14:08:05 +02:00
|
|
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceBeforeEquals">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterEquals">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
|
2011-08-28 16:33:55 +02:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<!-- Tweaks to metrics -->
|
|
|
|
|
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
|
|
|
|
<properties>
|
2012-05-06 00:45:15 +02:00
|
|
|
<property name="complexity" value="80" />
|
2012-07-25 11:40:23 +02:00
|
|
|
<property name="absoluteComplexity" value="200" />
|
2011-08-28 16:33:55 +02:00
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.Metrics.NestingLevel">
|
|
|
|
|
<properties>
|
2012-03-18 23:41:36 +01:00
|
|
|
<property name="nestingLevel" value="10" />
|
2011-08-28 16:33:55 +02:00
|
|
|
<property name="absoluteNestingLevel" value="50" />
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.NamingConventions.ConstructorName" />
|
|
|
|
|
<!-- Check if we use PHP4 constructor instead of __construct() -->
|
|
|
|
|
<rule ref="Generic.NamingConventions.ConstructorName.OldStyle">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.PHP.DeprecatedFunctions" />
|
2012-07-26 09:34:51 +02:00
|
|
|
<rule ref="Generic.PHP.DeprecatedFunctions.Deprecated">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="Generic.PHP.DisallowShortOpenTag" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.PHP.ForbiddenFunctions" />
|
|
|
|
|
|
|
|
|
|
<!-- Warning when using @ before functions -->
|
|
|
|
|
<!-- <rule ref="Generic.PHP.NoSilencedErrors" /> -->
|
|
|
|
|
|
|
|
|
|
<!-- Say if null, true, false must be uppercase -->
|
|
|
|
|
<!-- <rule ref="Generic.PHP.UpperCaseConstant" /> -->
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.Strings.UnnecessaryStringConcat" />
|
|
|
|
|
|
2012-07-25 11:29:45 +02:00
|
|
|
<rule ref="Generic.Strings.UnnecessaryStringConcat.Found">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="Generic.VersionControl.SubversionProperties" />
|
|
|
|
|
|
|
|
|
|
<!-- Disallow usage of tab -->
|
|
|
|
|
<!-- <rule ref="Generic.WhiteSpace.DisallowTabIndent" /> -->
|
|
|
|
|
|
|
|
|
|
<!-- Check indent are done with spaces and wiht correct number -->
|
|
|
|
|
<!-- Disabled as this does not support tab -->
|
|
|
|
|
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.Classes.ClassDeclaration" />
|
|
|
|
|
|
|
|
|
|
<!-- Check for duplicate class names -->
|
|
|
|
|
<!-- <rule ref="Generic.Classes.DuplicateClassName" /> -->
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.Commenting.ClassComment" />
|
|
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
<rule ref="PEAR.Commenting.FileComment" />
|
|
|
|
|
<rule ref="PEAR.Commenting.FileComment.WrongStyle">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FileComment.MissingVersion">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FileComment.MissingTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
-->
|
2011-09-10 14:28:00 +02:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.Empty">
|
|
|
|
|
<severity>5</severity>
|
|
|
|
|
</rule>
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment" />
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterLongType">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterLongName">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParams">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.ParameterCommentsNotAligned">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-09-21 13:54:41 +02:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.ParameterNamesNotAligned">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<rule ref="PEAR.Commenting.InlineComment" />
|
|
|
|
|
|
|
|
|
|
<!-- <rule ref="PEAR.ControlStructures.ControlSignature" /> -->
|
|
|
|
|
|
|
|
|
|
<!-- <rule ref="PEAR.ControlStructures.MultiLineCondition" /> -->
|
|
|
|
|
|
|
|
|
|
<!-- Test if () are removed for includes -->
|
|
|
|
|
<!-- <rule ref="PEAR.Files.IncludingFile"/> -->
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.Formatting.MultiLineAssignment" />
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature" />
|
|
|
|
|
|
2012-08-27 17:55:15 +02:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="PEAR.Functions.ValidDefaultValue" />
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName" />
|
2012-03-18 17:51:40 +01:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName.Invalid">
|
2012-03-18 17:16:46 +01:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2012-07-25 12:20:45 +02:00
|
|
|
|
2013-09-10 12:11:08 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
|
2011-08-28 19:40:51 +02:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2013-09-10 12:11:08 +02:00
|
|
|
<!-- some phpcs have a typo error in rule, so we add it too -->
|
|
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCaptial">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName" />
|
2012-07-25 12:20:45 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2013-09-10 02:32:24 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<!-- some phpcs have a typo error in rule, so we add it too -->
|
2011-09-16 19:57:09 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCaptial">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 19:40:51 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-09-16 19:57:09 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore">
|
2011-08-28 19:08:13 +02:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidVariableName" />
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" />
|
|
|
|
|
|
2012-01-05 01:06:50 +01:00
|
|
|
<!-- Need to be commented to be disabled
|
2011-12-30 14:32:33 +01:00
|
|
|
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2012-01-05 01:06:50 +01:00
|
|
|
-->
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<!-- Already found as a Generic rule -->
|
|
|
|
|
<!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> -->
|
|
|
|
|
|
|
|
|
|
</ruleset>
|