Conditions | 19 |
Paths | > 20000 |
Total Lines | 104 |
Code Lines | 100 |
Lines | 0 |
Ratio | 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 |
||
90 | function execute() { |
||
91 | global $wgHtml5; |
||
92 | // Suppress warnings to prevent notices about missing indexes in $this->data |
||
93 | wfSuppressWarnings(); |
||
94 | |||
95 | $this->html( 'headelement' ); |
||
96 | |||
97 | echo "\n<!-- FUSIONFORGE BodyHeader BEGIN -->\n"; |
||
98 | $GLOBALS['HTML']->header($this->params); |
||
99 | echo "<div id=\"ff-mw-wrapper\"><div style=\"font-size:x-small;\">\n"; |
||
100 | echo "<!-- FUSIONFORGE BodyHeader END -->\n"; |
||
101 | |||
102 | ?><div id="globalWrapper"> |
||
103 | <div id="column-content"><div id="content"> |
||
104 | <a id="top"></a> |
||
105 | <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?> |
||
106 | |||
107 | <h1 id="firstHeading" class="firstHeading"><span<?php if ($wgHtml5) echo ' dir="auto"'; ?>><?php $this->html('title') ?></span></h1> |
||
108 | <div id="bodyContent" class="mw-body"> |
||
109 | <div id="siteSub"><?php $this->msg('tagline') ?></div> |
||
110 | <div id="contentSub"<?php $this->html('userlangattributes') ?>><?php $this->html('subtitle') ?></div> |
||
111 | <?php if($this->data['undelete']) { ?> |
||
112 | <div id="contentSub2"><?php $this->html('undelete') ?></div> |
||
113 | <?php } ?><?php if($this->data['newtalk'] ) { ?> |
||
114 | <div class="usermessage"><?php $this->html('newtalk') ?></div> |
||
115 | <?php } ?><?php if($this->data['showjumplinks']) { ?> |
||
116 | <div id="jump-to-nav" class="mw-jump"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a>, <a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div> |
||
117 | <?php } ?> |
||
118 | <!-- start content --> |
||
119 | <?php $this->html('bodytext') ?> |
||
120 | <?php if($this->data['catlinks']) { $this->html('catlinks'); } ?> |
||
121 | <!-- end content --> |
||
122 | <?php if($this->data['dataAfterContent']) { $this->html ('dataAfterContent'); } ?> |
||
123 | <div class="visualClear"></div> |
||
124 | </div> |
||
125 | </div></div> |
||
126 | <div id="column-one"<?php $this->html('userlangattributes') ?>> |
||
127 | <?php $this->cactions(); ?> |
||
128 | <div class="portlet" id="p-personal"> |
||
129 | <h5><?php $this->msg('personaltools') ?></h5> |
||
130 | <div class="pBody"> |
||
131 | <?php |
||
132 | $ul_shown = false; |
||
133 | foreach ($this->getPersonalTools() as $key => $item) { |
||
134 | if (!$ul_shown) { |
||
135 | ?> |
||
136 | <ul<?php $this->html('userlangattributes') ?>> |
||
137 | <?php |
||
138 | $ul_shown = true; |
||
139 | } |
||
140 | echo "\n" . $this->makeListItem($key, $item); |
||
141 | } |
||
142 | if ($ul_shown) { |
||
143 | echo "\n</ul>\n"; |
||
144 | } |
||
145 | ?> |
||
146 | </div> |
||
147 | </div> |
||
148 | <?php |
||
149 | $this->renderPortals( $this->data['sidebar'] ); |
||
150 | ?> |
||
151 | </div><!-- end of the left (by default at least) column --> |
||
152 | <div class="visualClear"></div> |
||
153 | <?php |
||
154 | $validFooterIcons = $this->getFooterIcons( "icononly" ); |
||
155 | $validFooterLinks = $this->getFooterLinks( "flat" ); // Additional footer links |
||
156 | |||
157 | if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) { ?> |
||
158 | <div id="footer"<?php $this->html('userlangattributes') ?>> |
||
159 | <?php |
||
160 | $footerEnd = '</div>'; |
||
161 | } else { |
||
162 | $footerEnd = ''; |
||
163 | } |
||
164 | foreach ( $validFooterIcons as $blockName => $footerIcons ) { ?> |
||
165 | <div id="f-<?php echo htmlspecialchars($blockName); ?>ico"> |
||
166 | <?php foreach ( $footerIcons as $icon ) { ?> |
||
167 | <?php echo $this->getSkin()->makeFooterIcon( $icon ); ?> |
||
168 | |||
169 | <?php } |
||
170 | ?> |
||
171 | </div> |
||
172 | <?php } |
||
173 | |||
174 | if ( count( $validFooterLinks ) > 0 ) { |
||
175 | ?> <ul id="f-list"> |
||
176 | <?php |
||
177 | foreach( $validFooterLinks as $aLink ) { ?> |
||
178 | <li id="<?php echo $aLink ?>"><?php $this->html($aLink) ?></li> |
||
179 | <?php |
||
180 | } |
||
181 | ?> |
||
182 | </ul> |
||
183 | <?php } |
||
184 | echo $footerEnd; |
||
185 | ?> |
||
186 | |||
187 | </div> |
||
188 | <?php |
||
189 | $this->printTrail(); |
||
190 | echo "</div></div>\n"; |
||
191 | $GLOBALS['HTML']->footer($this->params); |
||
192 | wfRestoreWarnings(); |
||
193 | } // end of execute() method |
||
194 | |||
318 |