Conditions | 1 |
Paths | 1 |
Total Lines | 56 |
Code Lines | 52 |
Lines | 0 |
Ratio | 0 % |
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 |
||
106 | function jetpack_social_menu_social_links_icons() { |
||
107 | // Supported social links icons. |
||
108 | $social_links_icons = array( |
||
109 | 'amazon.cn' => 'amazon', |
||
110 | 'amazon.in' => 'amazon', |
||
111 | 'amazon.fr' => 'amazon', |
||
112 | 'amazon.de' => 'amazon', |
||
113 | 'amazon.it' => 'amazon', |
||
114 | 'amazon.nl' => 'amazon', |
||
115 | 'amazon.es' => 'amazon', |
||
116 | 'amazon.co' => 'amazon', |
||
117 | 'amazon.ca' => 'amazon', |
||
118 | 'amazon.com' => 'amazon', |
||
119 | 'apple.com' => 'apple', |
||
120 | 'itunes.com' => 'apple', |
||
121 | 'bandcamp.com' => 'bandcamp', |
||
122 | 'behance.net' => 'behance', |
||
123 | 'codepen.io' => 'codepen', |
||
124 | 'deviantart.com' => 'deviantart', |
||
125 | 'digg.com' => 'digg', |
||
126 | 'dribbble.com' => 'dribbble', |
||
127 | 'dropbox.com' => 'dropbox', |
||
128 | 'facebook.com' => 'facebook', |
||
129 | '/feed/' => 'feed', |
||
130 | 'flickr.com' => 'flickr', |
||
131 | 'foursquare.com' => 'foursquare', |
||
132 | 'plus.google.com' => 'google-plus', |
||
133 | 'google.com' => 'google', |
||
134 | 'github.com' => 'github', |
||
135 | 'instagram.com' => 'instagram', |
||
136 | 'linkedin.com' => 'linkedin', |
||
137 | 'mailto:' => 'mail', |
||
138 | 'medium.com' => 'medium', |
||
139 | 'pinterest.com' => 'pinterest', |
||
140 | 'getpocket.com' => 'pocket', |
||
141 | 'reddit.com' => 'reddit', |
||
142 | 'skype.com' => 'skype', |
||
143 | 'skype:' => 'skype', |
||
144 | 'slideshare.net' => 'slideshare', |
||
145 | 'snapchat.com' => 'snapchat', |
||
146 | 'soundcloud.com' => 'soundcloud', |
||
147 | 'spotify.com' => 'spotify', |
||
148 | 'stumbleupon.com' => 'stumbleupon', |
||
149 | 'tumblr.com' => 'tumblr', |
||
150 | 'twitch.tv' => 'twitch', |
||
151 | 'twitter.com' => 'twitter', |
||
152 | 'vimeo.com' => 'vimeo', |
||
153 | 'vk.com' => 'vk', |
||
154 | 'wordpress.org' => 'wordpress', |
||
155 | 'wordpress.com' => 'wordpress', |
||
156 | 'yelp.com' => 'yelp', |
||
157 | 'youtube.com' => 'youtube', |
||
158 | ); |
||
159 | |||
160 | return $social_links_icons; |
||
161 | } |
||
162 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.