Passed
Push — master ( 5b5c00...4c0c12 )
by Julien
04:52
created

Rest::setRestResponse()   B

Complexity

Conditions 11
Paths 99

Size

Total Lines 57
Code Lines 39

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 132

Importance

Changes 3
Bugs 1 Features 0
Metric Value
cc 11
eloc 39
c 3
b 1
f 0
nc 99
nop 5
dl 0
loc 57
ccs 0
cts 39
cp 0
crap 132
rs 7.3166

How to fix   Long Method    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
/**
4
 * This file is part of the Zemit Framework.
5
 *
6
 * (c) Zemit Team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.txt
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zemit\Mvc\Controller;
13
14
use Zemit\Mvc\Controller\Rest\Fractal;
15
use Zemit\Mvc\Controller\Rest\Response;
16
17
class Rest extends \Zemit\Mvc\Controller
18
{
19
    // Helpers
20
    use Debug;
21
    use Behavior;
0 ignored issues
show
introduced by
The trait Zemit\Mvc\Controller\Behavior requires some properties which are not provided by Zemit\Mvc\Controller\Rest: $eventType, $priority
Loading history...
22
    
23
    // Rest Helpers
24
    use Params;
25
    use Fractal;
26
    use Response;
27
}
28