Conditions | 30 |
Paths | 288 |
Total Lines | 112 |
Code Lines | 76 |
Lines | 16 |
Ratio | 14.29 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
73 | (2, 'phone', 'user_phone', 'text', '', '', '', 0, '', '', 9, 0, 1, 3, 88), |
||
74 | (3, 'mobilephone', 'user_mobile', 'text', '', '', '', 0, '', '', 9, 0, 1, 5, 88), |
||
75 | (4, 'fax', 'user_fax', 'text', '', '', '', 0, '', '', 9, 0, 1, 6, 88), |
||
76 | (5, 'street', 'user_street', 'text', '', '', '', 0, '', '', 9, 0, 1, 7, 88), |
||
77 | (6, 'city', 'user_city', 'text', '', '', '', 0, '', '', 9, 0, 1, 8, 88), |
||
78 | (7, 'state', 'user_state', 'text', '', '', '', 0, '', '', 9, 0, 1, 9, 88), |
||
79 | (8, 'zip', 'user_zip', 'text', '', '', '', 0, '', '', 9, 0, 1, 10, 88), |
||
80 | (9, 'country', 'user_country', 'select', '', '', '', 0, '', '', 9, 0, 1, 11, 88), |
||
81 | (10, 'dob', 'user_dob', 'date', '', '', '', 0, '', '', 9, 0, 1, 12, 88), |
||
82 | (11, 'gender', 'user_gender', 'select', '', '', '', 0, '||user_male==1||user_female==2||user_other==3', '', 9, 0, 1, 13, 88), |
||
83 | (12, 'comment', '', 'textarea', '', '', '', 0, '', '', 9, 0, 1, 14, 88), |
||
84 | (13, 'logincount', 'user_logincount', 'custom', '', '', '', 0, '', '[+value+]', 9, 0, 1, 15, 88); |
||
85 | /*!40000 ALTER TABLE `modx_system_templates` ENABLE KEYS */; |
||
86 | |||
87 | /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; |
||
88 | /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; |
||
89 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; |
||
90 | |||
91 | --> |
||
92 |
This check looks
TODO
comments that have been left in the code.``TODO``s show that something is left unfinished and should be attended to.