| Conditions | 1 |
| Paths | 1 |
| Total Lines | 55 |
| 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 |
||
| 31 | public static function getWikiPages() { |
||
| 32 | |||
| 33 | // Initialize the table of contents. |
||
| 34 | $tableContents = []; |
||
| 35 | |||
| 36 | // Twig extensions > Code |
||
| 37 | $tableContents[] = new WikiPage("twig-extension", "code", "basic-block", "Basic block"); |
||
| 38 | $tableContents[] = new WikiPage("twig-extension", "code", "inline", "Inline"); |
||
| 39 | $tableContents[] = new WikiPage("twig-extension", "code", "sample-output", "Sample output"); |
||
| 40 | $tableContents[] = new WikiPage("twig-extension", "code", "user-input", "User input"); |
||
| 41 | $tableContents[] = new WikiPage("twig-extension", "code", "variable", "Variable"); |
||
| 42 | |||
| 43 | // Twig extensions > Component |
||
| 44 | $tableContents[] = new WikiPage("twig-extension", "component", "alert", "Alert"); |
||
| 45 | $tableContents[] = new WikiPage("twig-extension", "component", "badge", "Badge"); |
||
| 46 | $tableContents[] = new WikiPage("twig-extension", "component", "button", "Button"); |
||
| 47 | $tableContents[] = new WikiPage("twig-extension", "component", "glyphicon", "Glyphicon"); |
||
| 48 | $tableContents[] = new WikiPage("twig-extension", "component", "label", "Label"); |
||
| 49 | $tableContents[] = new WikiPage("twig-extension", "component", "progress-bar", "Progress bar"); |
||
| 50 | |||
| 51 | // Twig extensions > Form |
||
| 52 | $tableContents[] = new WikiPage("twig-extension", "form", "button", "Button"); |
||
| 53 | |||
| 54 | // Twig extensions > Grid |
||
| 55 | $tableContents[] = new WikiPage("twig-extension", "grid", "grid", "Grid"); |
||
| 56 | |||
| 57 | // Twig extensions > Image |
||
| 58 | $tableContents[] = new WikiPage("twig-extension", "image", "base64", "Base 64"); |
||
| 59 | |||
| 60 | // Twig extensions > Plugin |
||
| 61 | $tableContents[] = new WikiPage("twig-extension", "plugin", "font-awesome", "Font Awesome"); |
||
| 62 | $tableContents[] = new WikiPage("twig-extension", "plugin", "jquery-inputmask", "jQuery InputMask"); |
||
| 63 | $tableContents[] = new WikiPage("twig-extension", "plugin", "material-design-iconic-font", "Material Design Iconic Font"); |
||
| 64 | $tableContents[] = new WikiPage("twig-extension", "plugin", "meteocons", "Meteocons"); |
||
| 65 | |||
| 66 | // Twig extensions > Table |
||
| 67 | $tableContents[] = new WikiPage("twig-extension", "table", "button", "Button"); |
||
| 68 | |||
| 69 | // Twig extensions > Typography |
||
| 70 | $tableContents[] = new WikiPage("twig-extension", "typography", "bold", "Bold"); |
||
| 71 | $tableContents[] = new WikiPage("twig-extension", "typography", "deleted", "Deleted"); |
||
| 72 | $tableContents[] = new WikiPage("twig-extension", "typography", "heading", "Heading"); |
||
| 73 | $tableContents[] = new WikiPage("twig-extension", "typography", "inserted", "Inserted"); |
||
| 74 | $tableContents[] = new WikiPage("twig-extension", "typography", "italic", "Italic"); |
||
| 75 | $tableContents[] = new WikiPage("twig-extension", "typography", "marked", "Marked"); |
||
| 76 | $tableContents[] = new WikiPage("twig-extension", "typography", "small", "Small"); |
||
| 77 | $tableContents[] = new WikiPage("twig-extension", "typography", "strikethrough", "Strikethrough"); |
||
| 78 | $tableContents[] = new WikiPage("twig-extension", "typography", "underlined", "Underlined"); |
||
| 79 | |||
| 80 | // Twig extensions > Utility |
||
| 81 | $tableContents[] = new WikiPage("twig-extension", "utility", "role-label", "Role label"); |
||
| 82 | |||
| 83 | // Return the table of contents. |
||
| 84 | return $tableContents; |
||
| 85 | } |
||
| 86 | |||
| 147 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.