Conditions | 1 |
Paths | 1 |
Total Lines | 54 |
Code Lines | 31 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 |
||
66 | public static function getWikiPages() { |
||
67 | |||
68 | // Initialize the table of contents. |
||
69 | $tableContents = []; |
||
70 | |||
71 | // Twig extensions > Code |
||
72 | $tableContents[] = new WikiPage("twig-extension", "code", "basic-block", "Basic block"); |
||
73 | $tableContents[] = new WikiPage("twig-extension", "code", "inline", "Inline"); |
||
74 | $tableContents[] = new WikiPage("twig-extension", "code", "sample-output", "Sample output"); |
||
75 | $tableContents[] = new WikiPage("twig-extension", "code", "user-input", "User input"); |
||
76 | $tableContents[] = new WikiPage("twig-extension", "code", "variable", "Variable"); |
||
77 | |||
78 | // Twig extensions > Component |
||
79 | $tableContents[] = new WikiPage("twig-extension", "component", "alert", "Alert"); |
||
80 | $tableContents[] = new WikiPage("twig-extension", "component", "badge", "Badge"); |
||
81 | $tableContents[] = new WikiPage("twig-extension", "component", "button", "Button"); |
||
82 | $tableContents[] = new WikiPage("twig-extension", "component", "glyphicon", "Glyphicon"); |
||
83 | $tableContents[] = new WikiPage("twig-extension", "component", "label", "Label"); |
||
84 | $tableContents[] = new WikiPage("twig-extension", "component", "progress-bar", "Progress bar"); |
||
85 | |||
86 | // Twig extensions > Form |
||
87 | $tableContents[] = new WikiPage("twig-extension", "form", "button", "Button"); |
||
88 | |||
89 | // Twig extensions > Grid |
||
90 | $tableContents[] = new WikiPage("twig-extension", "grid", "grid", "Grid"); |
||
91 | |||
92 | // Twig extensions > Image |
||
93 | $tableContents[] = new WikiPage("twig-extension", "image", "base64", "Base 64"); |
||
94 | |||
95 | // Twig extensions > Plugin |
||
96 | $tableContents[] = new WikiPage("twig-extension", "plugin", "font-awesome", "Font Awesome"); |
||
97 | $tableContents[] = new WikiPage("twig-extension", "plugin", "jquery-inputmask", "jQuery InputMask"); |
||
98 | $tableContents[] = new WikiPage("twig-extension", "plugin", "material-design-iconic-font", "Material Design Iconic Font"); |
||
99 | |||
100 | // Twig extensions > Table |
||
101 | $tableContents[] = new WikiPage("twig-extension", "table", "button", "Button"); |
||
102 | |||
103 | // Twig extensions > Typography |
||
104 | $tableContents[] = new WikiPage("twig-extension", "typography", "bold", "Bold"); |
||
105 | $tableContents[] = new WikiPage("twig-extension", "typography", "deleted", "Deleted"); |
||
106 | $tableContents[] = new WikiPage("twig-extension", "typography", "heading", "Heading"); |
||
107 | $tableContents[] = new WikiPage("twig-extension", "typography", "inserted", "Inserted"); |
||
108 | $tableContents[] = new WikiPage("twig-extension", "typography", "italic", "Italic"); |
||
109 | $tableContents[] = new WikiPage("twig-extension", "typography", "marked", "Marked"); |
||
110 | $tableContents[] = new WikiPage("twig-extension", "typography", "small", "Small"); |
||
111 | $tableContents[] = new WikiPage("twig-extension", "typography", "strikethrough", "Strikethrough"); |
||
112 | $tableContents[] = new WikiPage("twig-extension", "typography", "underlined", "Underlined"); |
||
113 | |||
114 | // Twig extensions > Utility |
||
115 | $tableContents[] = new WikiPage("twig-extension", "utility", "role-label", "Role label"); |
||
116 | |||
117 | // Return the table of contents. |
||
118 | return $tableContents; |
||
119 | } |
||
120 | |||
178 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.