Completed
Push — master ( 89be15...80fd60 )
by Igor
11:15
created

IndexController::actionSignupProvider()   D

Complexity

Conditions 10
Paths 6

Size

Total Lines 44
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 110

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 44
ccs 0
cts 27
cp 0
rs 4.8196
cc 10
eloc 28
nc 6
nop 0
crap 110

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 app\controllers;
4
5
use Yii;
6
use yii\web\NotFoundHttpException;
7
8
class IndexController extends \yii\web\Controller
9
{
10
    /**
11
     * @inheritdoc
12
     */
13
    public function actions()
14
    {
15
        return [
16
            'error' => [
17
                'class' => 'yii\web\ErrorAction',
18
            ],
19
        ];
20
    }
21
22 45
    public function actionIndex()
23
    {
24 45
        return $this->render('index');
25
    }
26 45
27 45
    /** @see commands/MaintenanceController **/
28
    public function actionMaintenance()
29
    {
30
        if (!Yii::$app->catchAll) {
31
            throw new NotFoundHttpException(Yii::t('app.msg', 'Page not found'));
32 45
        }
33
34
        $this->layout = 'maintenance';
35 45
        return $this->render('maintenance');
36
    }
37
}
38