Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
1 | <?php |
||
18 | class ScriptHandler extends ScriptHandlerBase |
||
|
|||
19 | { |
||
20 | /** |
||
21 | * Generates swagger.json |
||
22 | * |
||
23 | * @param CommandEvent $event Event |
||
24 | * |
||
25 | * @return void |
||
26 | */ |
||
27 | View Code Duplication | public static function generateSwaggerJson(CommandEvent $event) |
|
35 | } |
||
36 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.