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 |
||
13 | class CommentController extends AdminController |
||
14 | { |
||
15 | |||
16 | |||
17 | /** |
||
18 | * Shows the post(question or answer) and create comment form |
||
19 | * |
||
20 | * @return void |
||
21 | */ |
||
22 | View Code Duplication | public function getPostCreateComment($id) |
|
35 | } |
||
36 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.