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 |
||
22 | class ALNP_Twenty_Thirteen { |
||
23 | |||
24 | /** |
||
25 | * Initlize Theme. |
||
26 | * |
||
27 | * @access public |
||
28 | * @static |
||
29 | */ |
||
30 | View Code Duplication | public static function init() { |
|
40 | |||
41 | /** |
||
42 | * Adds a compaitable post navigation. |
||
43 | * |
||
44 | * @access public |
||
45 | * @static |
||
46 | */ |
||
47 | public static function alnp_twentythirteen_post_navigation() { |
||
50 | |||
51 | /** |
||
52 | * Add theme support by providing the theme selectors |
||
53 | * to be applied once the theme is activated. |
||
54 | * |
||
55 | * @access public |
||
56 | * @static |
||
57 | */ |
||
58 | public static function add_theme_support() { |
||
68 | |||
69 | } // END class |
||
70 | |||
72 |