PSR2 is a coding style guide maintained by the PHP Framework Interop(ability) Group
Magic Numbers are coding issue in which configuration information is littered throughout the code base, rather than being clearly defined as config.
Clean Code checks look for four things:
Whether all of these are appropriate for your code is a matter of some contention, particularly the ELSE rule.
This checks against a number of metrics including:
We check for unused code in the following:
This sometimes gives false positives, such as in situations where function names are passed, quoted, as parameters to other functions. (uasort is notorious for this.)
The SOLID checks test for a large number of things, from goto statements, to the use of print_r
In practice, we find the coding error it regularly catches is the use of assignments in if clauses. These are possible in PHP, but in our experience tend to happen when someone has typed = (assignment) instead of == (equality).
Code duplication is generally a sing of copy/paste, and tends to break the DRY principle.
By default, code duplication will be flagged if the number of duplicated lines is over 5 / the number of duplicated tokens is over 70.