| Conditions | 1 |
| Paths | 1 |
| Total Lines | 235 |
| Code Lines | 7 |
| 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 |
||
| 140 | private function getMenu() |
||
| 141 | { |
||
| 142 | /** |
||
| 143 | * Array |
||
| 144 | * ( |
||
| 145 | * [0] => Array ( |
||
| 146 | * [name] => Home |
||
| 147 | * [link] => /index.php?mainmenu=home&leftmenu=home |
||
| 148 | * [title] => Home |
||
| 149 | * [level] => 0 |
||
| 150 | * [enabled] => 1 |
||
| 151 | * [target] => |
||
| 152 | * [mainmenu] => home |
||
| 153 | * [leftmenu] => |
||
| 154 | * [position] => 10 |
||
| 155 | * [id] => mainmenu |
||
| 156 | * [idsel] => home |
||
| 157 | * [classname] => class="tmenusel" |
||
| 158 | * [prefix] => fa fa-home |
||
| 159 | * ) |
||
| 160 | * |
||
| 161 | * [1] => Array ( |
||
| 162 | * [name] => Members |
||
| 163 | * [link] => /adherents/index.php?mainmenu=members&leftmenu= |
||
| 164 | * [title] => MenuMembers |
||
| 165 | * [level] => 0 |
||
| 166 | * [enabled] => 0 |
||
| 167 | * [target] => |
||
| 168 | * [mainmenu] => members |
||
| 169 | * [leftmenu] => |
||
| 170 | * [position] => 18 |
||
| 171 | * [id] => mainmenu |
||
| 172 | * [idsel] => members |
||
| 173 | * [classname] => class="tmenu" |
||
| 174 | * [prefix] => fas fa-user-alt |
||
| 175 | * ) |
||
| 176 | * |
||
| 177 | * [2] => Array ( |
||
| 178 | * [name] => Companies |
||
| 179 | * [link] => /societe/index.php?mainmenu=companies&leftmenu= |
||
| 180 | * [title] => ThirdParties |
||
| 181 | * [level] => 0 |
||
| 182 | * [enabled] => 1 |
||
| 183 | * [target] => |
||
| 184 | * [mainmenu] => companies |
||
| 185 | * [leftmenu] => |
||
| 186 | * [position] => 20 |
||
| 187 | * [id] => mainmenu |
||
| 188 | * [idsel] => companies |
||
| 189 | * [classname] => class="tmenu" |
||
| 190 | * [prefix] => fas fa-building |
||
| 191 | * [session] => 1 |
||
| 192 | * ) |
||
| 193 | * |
||
| 194 | * [3] => Array ( |
||
| 195 | * [name] => Products |
||
| 196 | * [link] => /product/index.php?mainmenu=products&leftmenu= |
||
| 197 | * [title] => Array ( |
||
| 198 | * [0] => TMenuProducts |
||
| 199 | * [1] => | |
||
| 200 | * [2] => TMenuServices |
||
| 201 | * ) |
||
| 202 | * [level] => 0 |
||
| 203 | * [enabled] => 1 |
||
| 204 | * [target] => |
||
| 205 | * [mainmenu] => products |
||
| 206 | * [leftmenu] => |
||
| 207 | * [position] => 30 |
||
| 208 | * [id] => mainmenu |
||
| 209 | * [idsel] => products |
||
| 210 | * [classname] => class="tmenu" |
||
| 211 | * [prefix] => fas fa-cube |
||
| 212 | * [session] => 1 |
||
| 213 | * ) |
||
| 214 | * |
||
| 215 | * [4] => Array ( |
||
| 216 | * [name] => TMenuMRP |
||
| 217 | * [link] => /mrp/index.php?mainmenu=mrp&leftmenu= |
||
| 218 | * [title] => TMenuMRP |
||
| 219 | * [level] => 0 |
||
| 220 | * [enabled] => 1 |
||
| 221 | * [target] => |
||
| 222 | * [mainmenu] => mrp |
||
| 223 | * [leftmenu] => |
||
| 224 | * [position] => 31 |
||
| 225 | * [id] => mainmenu |
||
| 226 | * [idsel] => mrp |
||
| 227 | * [classname] => class="tmenu" |
||
| 228 | * [prefix] => fas fa-cubes |
||
| 229 | * [session] => 1 |
||
| 230 | * ) |
||
| 231 | * |
||
| 232 | * [5] => Array ( |
||
| 233 | * [name] => Projet |
||
| 234 | * [link] => /projet/index.php?mainmenu=project&leftmenu= |
||
| 235 | * [title] => Projects |
||
| 236 | * [level] => 0 |
||
| 237 | * [enabled] => 1 |
||
| 238 | * [target] => |
||
| 239 | * [mainmenu] => project |
||
| 240 | * [leftmenu] => |
||
| 241 | * [position] => 35 |
||
| 242 | * [id] => mainmenu |
||
| 243 | * [idsel] => project |
||
| 244 | * [classname] => class="tmenu" |
||
| 245 | * [prefix] => fas fa-project-diagram |
||
| 246 | * [session] => 1 |
||
| 247 | * ) |
||
| 248 | * |
||
| 249 | * [6] => Array ( |
||
| 250 | * [name] => Commercial |
||
| 251 | * [link] => /comm/index.php?mainmenu=commercial&leftmenu= |
||
| 252 | * [title] => Commercial |
||
| 253 | * [level] => 0 |
||
| 254 | * [enabled] => 1 |
||
| 255 | * [target] => |
||
| 256 | * [mainmenu] => commercial |
||
| 257 | * [leftmenu] => |
||
| 258 | * [position] => 40 |
||
| 259 | * [id] => mainmenu |
||
| 260 | * [idsel] => commercial |
||
| 261 | * [classname] => class="tmenu" |
||
| 262 | * [prefix] => fas fa-suitcase |
||
| 263 | * [session] => 1 |
||
| 264 | * ) |
||
| 265 | * |
||
| 266 | * [7] => Array ( |
||
| 267 | * [name] => Compta |
||
| 268 | * [link] => /compta/index.php?mainmenu=billing&leftmenu= |
||
| 269 | * [title] => MenuFinancial |
||
| 270 | * [level] => 0 |
||
| 271 | * [enabled] => 1 |
||
| 272 | * [target] => |
||
| 273 | * [mainmenu] => billing |
||
| 274 | * [leftmenu] => |
||
| 275 | * [position] => 50 |
||
| 276 | * [id] => mainmenu |
||
| 277 | * [idsel] => billing |
||
| 278 | * [classname] => class="tmenu" |
||
| 279 | * [prefix] => fas fa-file-invoice-dollar |
||
| 280 | * [session] => 1 |
||
| 281 | * ) |
||
| 282 | * |
||
| 283 | * [8] => Array ( |
||
| 284 | * [name] => Bank |
||
| 285 | * [link] => /compta/bank/list.php?mainmenu=bank&leftmenu= |
||
| 286 | * [title] => MenuBankCash |
||
| 287 | * [level] => 0 |
||
| 288 | * [enabled] => 0 |
||
| 289 | * [target] => |
||
| 290 | * [mainmenu] => bank |
||
| 291 | * [leftmenu] => |
||
| 292 | * [position] => 52 |
||
| 293 | * [id] => mainmenu |
||
| 294 | * [idsel] => bank |
||
| 295 | * [classname] => class="tmenu" |
||
| 296 | * [prefix] => fas fa-university |
||
| 297 | * [session] => 1 |
||
| 298 | * ) |
||
| 299 | * |
||
| 300 | * [9] => Array ( |
||
| 301 | * [name] => Accounting |
||
| 302 | * [link] => /accountancy/index.php?mainmenu=accountancy&leftmenu= |
||
| 303 | * [title] => MenuAccountancy |
||
| 304 | * [level] => 0 |
||
| 305 | * [enabled] => 0 |
||
| 306 | * [target] => |
||
| 307 | * [mainmenu] => accountancy |
||
| 308 | * [leftmenu] => |
||
| 309 | * [position] => 54 |
||
| 310 | * [id] => mainmenu |
||
| 311 | * [idsel] => accountancy |
||
| 312 | * [classname] => class="tmenu" |
||
| 313 | * [prefix] => fas fa-search-dollar |
||
| 314 | * [session] => 1 |
||
| 315 | * ) |
||
| 316 | * |
||
| 317 | * [10] => Array ( |
||
| 318 | * [name] => HRM |
||
| 319 | * [link] => /hrm/index.php?mainmenu=hrm&leftmenu= |
||
| 320 | * [title] => HRM |
||
| 321 | * [level] => 0 |
||
| 322 | * [enabled] => 0 |
||
| 323 | * [target] => |
||
| 324 | * [mainmenu] => hrm |
||
| 325 | * [leftmenu] => |
||
| 326 | * [position] => 80 |
||
| 327 | * [id] => mainmenu |
||
| 328 | * [idsel] => hrm |
||
| 329 | * [classname] => class="tmenu" |
||
| 330 | * [prefix] => fas fa-user-tie |
||
| 331 | * [session] => 1 |
||
| 332 | * ) |
||
| 333 | * |
||
| 334 | * [11] => Array ( |
||
| 335 | * [name] => Ticket |
||
| 336 | * [link] => /ticket/index.php?mainmenu=ticket&leftmenu= |
||
| 337 | * [title] => Tickets |
||
| 338 | * [level] => 0 |
||
| 339 | * [enabled] => 1 |
||
| 340 | * [target] => |
||
| 341 | * [mainmenu] => ticket |
||
| 342 | * [leftmenu] => |
||
| 343 | * [position] => 88 |
||
| 344 | * [id] => mainmenu |
||
| 345 | * [idsel] => ticket |
||
| 346 | * [classname] => class="tmenu" |
||
| 347 | * [prefix] => fas fa-ticket-alt |
||
| 348 | * [session] => 1 |
||
| 349 | * ) |
||
| 350 | * |
||
| 351 | * [12] => Array ( |
||
| 352 | * [name] => Tools |
||
| 353 | * [link] => /core/tools.php?mainmenu=tools&leftmenu= |
||
| 354 | * [title] => Tools |
||
| 355 | * [level] => 0 |
||
| 356 | * [enabled] => 1 |
||
| 357 | * [target] => |
||
| 358 | * [mainmenu] => tools |
||
| 359 | * [leftmenu] => |
||
| 360 | * [position] => 90 |
||
| 361 | * [id] => mainmenu |
||
| 362 | * [idsel] => tools |
||
| 363 | * [classname] => class="tmenu" |
||
| 364 | * [prefix] => fas fa-tools |
||
| 365 | * [session] => 1 |
||
| 366 | * ) |
||
| 367 | */ |
||
| 368 | $module = strtolower(filter_input(INPUT_GET, 'module')); |
||
| 369 | $this->menu = []; |
||
| 370 | $this->menu[] = $this->addItem( |
||
| 371 | 'portfolio', |
||
| 372 | Translator::trans('portfolio'), |
||
| 373 | '?module=Portfolio&controller=Index', |
||
| 374 | $module === 'portfolio' |
||
| 375 | ); |
||
| 529 |