Completed
Branch master (4f211e)
by Robert
03:21
created

Controller   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 35
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B beforeRender() 0 27 2
1
<?php
2
class Controller extends CController
3
{
4
    public $layout='//layouts/column1';
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 0 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
5
    public $menu=array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 8 spaces but found 0 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
6
    public $breadcrumbs=array();
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 1 space but found 0 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
7
    public $contentClass;
8
9
    public function beforeRender($view)
10
    {
11
        $cs = Yii::app()->getClientScript();
12
13
        //CSS
14
        $cs->registerCssFile(Yii::app()->request->baseUrl . '/css/themes/brown.css');
15
        $cs->registerCssFile(Yii::app()->request->baseUrl . '/css/jquery.mobile.external-png-1.4.5.min.css');
16
        $cs->registerCssFile(Yii::app()->request->baseUrl . '/css/jquery.mobile.structure-1.4.5.min.css');
17
        $cs->registerCssFile(Yii::app()->request->baseUrl . '/css/game.css?3');
18
19
        //js
20
        $cs->registerCoreScript('jquery');
21
        //$cs->registerScriptFile(Yii::app()->request->baseUrl . '/js/jquery.countdown.min.js', CClientScript::POS_HEAD);
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
22
        //$cs->registerScriptFile(Yii::app()->request->baseUrl . '/js/fish.js', CClientScript::POS_HEAD);
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
23
        $cs->registerScriptFile(Yii::app()->request->baseUrl . '/js/jquery.mobile-1.4.5.min.js', CClientScript::POS_HEAD);
24
        $cs->registerScript(
25
            'vars',
26
            'var justAdvanced = ' . (Yii::app()->player->model->justAdvanced?'true':'false') . ';
27
            var refillTime = ' . Yii::app()->player->model->remainingTimeToRefill . ';
28
            var rpi = ' .  Yii::app()->player->model->refillPerInterval . '; ',
29
            CClientScript::POS_HEAD
30
        );
31
32
33
34
        return true;
35
    }
36
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
37