The curly brace of the class is not followed by another line
Variable name initials lowercase hump mode [a-z][a-za-z0-9]*
Note to start another line instead of following the code,
The code snippet to remove the comment
Swtich contains at least 3 case, otherwise use if.
If etc cannot be nested more than 3 times
The method in the class cannot be more than 20, and if it is more than one, split the
Removing unused parameters
Remove a useless variable
If must be with else
If always follow curly braces
Don't have too many return in the code.
Switch to add default
The following code
if (condition) {return true;} else {return false;} or if (a==b) {return true;} Else{return false;} should be written as return Condition;return a==b;
Direct return function Compute_duration_in_milliseconds () {$duration = ((($hours *) + $minutes) * + $seconds) * 1000; return $duration;} Compliant Solutionfunction Compute_duration_in_milliseconds () {return (($hours * + $minutes) * + $seconds) * 10 00;}
Duplicate parameter function run () {Prepare (' action1 ') appears; Non-compliant-' action1 ' is duplicated 3 times execute (' Action1 '); Release (' Action1 ');} The correct procedure action_1 = ' action1 '; function run () {prepare (action_1); Execute (action_1); Release (action_1);}
Boolean values directly determine if ($booleanVariable = = true) {/* ... */}if ($booleanVariable! = True) {/* ... */}if ($booleanVariable | | fal SE) {/* ... */}dosomething (!false); Compliant solutionif ($booleanVariable) {/* ... */}if (! $booleanVariable) {/* ... */}if ($booleanVariable) {/* ... */ }dosomething (TRUE);