Test Failed
Push — main ( ac1cad...7178bf )
by Rafael
50:59
created

AdherentTypeController::index()   B

Complexity

Conditions 10
Paths 10

Size

Total Lines 34
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 10
eloc 29
nc 10
nop 1
dl 0
loc 34
rs 7.6666
c 2
b 0
f 0

How to fix   Complexity   

Long Method

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:

1
<?php
2
3
namespace Modules\Adherent\Controller;
4
5
use Alxarafe\Base\Controller;
6
7
class AdherentTypeController extends Controller
8
{
9
    public function index(bool $executeActions = true): bool
10
    {
11
        switch ($this->action) {
12
            case 'logina':
13
                $this->template = 'theme/adminlte/auth/login';
14
                break;
15
            case 'loginm':
16
                $this->template = 'theme/md/auth/login';
17
                break;
18
            case 'logine':
19
                $this->template = 'theme/eldy/auth/login';
20
                break;
21
            case 'lista':
22
                $this->template = 'theme/adminlte/page/adherent/type_list';
23
                break;
24
            case 'listm':
25
                $this->template = 'theme/md/page/adherent/type_list';
26
                break;
27
            case 'liste':
28
                $this->template = 'theme/eldy/page/adherent/type_list';
29
                break;
30
            case 'edita':
31
                $this->template = 'theme/adminlte/page/adherent/type_edit';
32
                break;
33
            case 'editm':
34
                $this->template = 'theme/md/page/adherent/type_edit';
35
                break;
36
            case 'edite':
37
                $this->template = 'theme/md/page/adherent/type_edit';
38
                break;
39
//            default:
40
//                $this->template = 'page/adherent/type_edit';
41
        }
42
        return parent::index();
43
    }
44
}
45