|
189 | 189 | <!-- Other operators are left undefined. --> |
190 | 190 | <rule ref="Totara.Operators.OperatorSpacing"/> |
191 | 191 |
|
| 192 | + <!-- SonarQube rule coverage (php:S107, php:S110, php:S134, php:S2004) --> |
| 193 | + <!-- Nesting depth and complexity checks --> |
| 194 | + <rule ref="Generic.Metrics.NestingLevel"> |
| 195 | + <properties> |
| 196 | + <property name="nestingLevel" value="5"/> |
| 197 | + <property name="absoluteNestingLevel" value="10"/> |
| 198 | + </properties> |
| 199 | + </rule> |
| 200 | + <rule ref="Generic.Metrics.CyclomaticComplexity"> |
| 201 | + <!-- php:S3776 Cognitive/cyclomatic complexity --> |
| 202 | + <properties> |
| 203 | + <property name="complexity" value="15"/> |
| 204 | + <property name="absoluteComplexity" value="30"/> |
| 205 | + </properties> |
| 206 | + </rule> |
| 207 | + |
| 208 | + <!-- SonarQube rule coverage (php:S1068, php:S1172) --> |
| 209 | + <!-- Unused parameters --> |
| 210 | + <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/> |
| 211 | + |
| 212 | + <!-- SonarQube rule coverage (php:S1116) --> |
| 213 | + <!-- Empty PHP statements (;;) --> |
| 214 | + <rule ref="Generic.CodeAnalysis.EmptyPHPStatement"/> |
| 215 | + |
| 216 | + <!-- SonarQube rule coverage (php:S1186, php:S905) --> |
| 217 | + <!-- Empty catch/if/else bodies --> |
| 218 | + <rule ref="Generic.CodeAnalysis.EmptyStatement"/> |
| 219 | + |
| 220 | + <!-- SonarQube rule coverage (php:S1121) --> |
| 221 | + <!-- Assignment in condition --> |
| 222 | + <rule ref="Generic.CodeAnalysis.AssignmentInCondition"/> |
| 223 | + |
| 224 | + <!-- SonarQube rule coverage (php:S1145) --> |
| 225 | + <!-- if (true) / if (false) unconditional --> |
| 226 | + <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> |
| 227 | + |
| 228 | + <!-- SonarQube rule coverage (php:S1185) --> |
| 229 | + <!-- Useless overriding methods that just call parent --> |
| 230 | + <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/> |
| 231 | + |
| 232 | + <!-- SonarQube rule coverage (php:S1110) --> |
| 233 | + <!-- Unnecessary parentheses --> |
| 234 | + <rule ref="Generic.WhiteSpace.ArbitraryParenthesesSpacing"/> |
| 235 | + |
| 236 | + <!-- SonarQube rule coverage (php:S1134) --> |
| 237 | + <!-- FIXME comments --> |
| 238 | + <rule ref="Generic.Commenting.Fixme"/> |
| 239 | + |
| 240 | + <!-- SonarQube rule coverage (php:S1135) --> |
| 241 | + <!-- TODO comments --> |
| 242 | + <rule ref="Generic.Commenting.Todo"/> |
| 243 | + |
| 244 | + <!-- SonarQube rule coverage (php:S125) --> |
| 245 | + <!-- Commented-out code --> |
| 246 | + <rule ref="Squiz.PHP.CommentedOutCode"> |
| 247 | + <properties> |
| 248 | + <property name="maxPercentage" value="35"/> |
| 249 | + </properties> |
| 250 | + </rule> |
| 251 | + |
| 252 | + <!-- SonarQube rule coverage (php:S1763, php:S881) --> |
| 253 | + <!-- Dead/non-executable code after return/throw/etc --> |
| 254 | + <rule ref="Squiz.PHP.NonExecutableCode"/> |
| 255 | + |
| 256 | + <!-- SonarQube rule coverage (php:S139) --> |
| 257 | + <!-- Inline comments after statements --> |
| 258 | + <rule ref="Squiz.Commenting.PostStatementComment"/> |
| 259 | + |
| 260 | + <!-- SonarQube rule coverage (php:S1788) --> |
| 261 | + <!-- Default parameter values must not follow non-default params --> |
| 262 | + <rule ref="PEAR.Functions.ValidDefaultValue"/> |
| 263 | + |
| 264 | + <!-- SonarQube rule coverage (php:S907) --> |
| 265 | + <!-- Discourage goto --> |
| 266 | + <rule ref="Generic.PHP.DiscourageGoto"/> |
| 267 | + |
| 268 | + <!-- SonarQube rule coverage (php:S2068) --> |
| 269 | + <!-- No hardcoded credentials / passwords in code --> |
| 270 | + <rule ref="Generic.PHP.ForbiddenFunctions"/> |
| 271 | + |
| 272 | + <!-- SonarQube rule coverage (php:S1192) --> |
| 273 | + <!-- Unnecessary string concatenation --> |
| 274 | + <rule ref="Generic.Strings.UnnecessaryStringConcat"/> |
| 275 | + |
| 276 | + <!-- SonarQube rule coverage (php:S1301) --> |
| 277 | + <!-- Single-case switch statements --> |
| 278 | + <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> |
| 279 | + |
| 280 | + <!-- SonarQube rule coverage (php:S1155, php:S3699) --> |
| 281 | + <!-- Duplicate class names --> |
| 282 | + <rule ref="Generic.Classes.DuplicateClassName"/> |
| 283 | + |
| 284 | + <!-- SonarQube rule coverage (php:S2612) --> |
| 285 | + <!-- No silenced errors (@) --> |
| 286 | + <rule ref="Generic.PHP.NoSilencedErrors"/> |
| 287 | + |
| 288 | + <!-- Git merge conflicts left in code --> |
| 289 | + <rule ref="Generic.VersionControl.GitMergeConflict"/> |
| 290 | + |
192 | 291 | </ruleset> |
0 commit comments