@@ -48,11 +48,11 @@ |
||
48 | 48 | $content = file_get_contents($filename); |
49 | 49 | |
50 | 50 | $cloc = $lloc = 0; |
51 | - foreach($tokens as $token) { |
|
51 | + foreach ($tokens as $token) { |
|
52 | 52 | |
53 | - switch($token->getType()) { |
|
53 | + switch ($token->getType()) { |
|
54 | 54 | case T_STRING: |
55 | - if(';' == $token->getValue()) { |
|
55 | + if (';' == $token->getValue()) { |
|
56 | 56 | $lloc++; |
57 | 57 | } |
58 | 58 | break; |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * @inheritdoc |
50 | 50 | */ |
51 | 51 | public function asArray() { |
52 | - return array ( |
|
52 | + return array( |
|
53 | 53 | 'loc' => $this->getLoc() |
54 | 54 | ,'logicalLoc' => $this->getLogicalLoc() |
55 | 55 | ); |
@@ -40,12 +40,12 @@ |
||
40 | 40 | { |
41 | 41 | $result = new Result; |
42 | 42 | $result->setMaintainabilityIndexWithoutComment(max( |
43 | - (171 |
|
43 | + (171 |
|
44 | 44 | - (5.2 * \log($rHalstead->getVolume())) |
45 | 45 | - (0.23 * $rMcCabe->getCyclomaticComplexityNumber()) |
46 | 46 | - (16.2 * \log($rLoc->getLogicalLoc())) |
47 | - ) * 100 / 171 |
|
48 | - ,0)); |
|
47 | + ) * 100 / 171 |
|
48 | + ,0)); |
|
49 | 49 | |
50 | 50 | |
51 | 51 | // comment weight |
@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | |
51 | 51 | // comment weight |
52 | - if($rLoc->getLoc() > 0) { |
|
52 | + if ($rLoc->getLoc() > 0) { |
|
53 | 53 | $CM = $rLoc->getCommentLoc() / $rLoc->getLoc(); |
54 | 54 | $result->setCommentWeight( |
55 | 55 | 50 * sin(sqrt(2.4 * $CM)) |
@@ -60,10 +60,10 @@ |
||
60 | 60 | */ |
61 | 61 | public function setMaintainabilityIndexWithoutComment($maintainabilityIndexWithoutComment) |
62 | 62 | { |
63 | - if(is_infinite($maintainabilityIndexWithoutComment)) { |
|
63 | + if (is_infinite($maintainabilityIndexWithoutComment)) { |
|
64 | 64 | $maintainabilityIndexWithoutComment = 171; |
65 | 65 | } |
66 | - $this->maintainabilityIndexWithoutComment = round($maintainabilityIndexWithoutComment,2); |
|
66 | + $this->maintainabilityIndexWithoutComment = round($maintainabilityIndexWithoutComment, 2); |
|
67 | 67 | |
68 | 68 | } |
69 | 69 | /** |
@@ -28,16 +28,16 @@ |
||
28 | 28 | |
29 | 29 | $ac = $cc = $abstractness = 0; |
30 | 30 | |
31 | - foreach($results as $result) { |
|
31 | + foreach ($results as $result) { |
|
32 | 32 | $rOOP = $result->getOOP(); |
33 | - if(is_object($rOOP)) { |
|
33 | + if (is_object($rOOP)) { |
|
34 | 34 | $cc += sizeof($rOOP->getConcreteClasses(), COUNT_NORMAL); |
35 | 35 | $ac += sizeof($rOOP->getAbstractClasses(), COUNT_NORMAL); |
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | 39 | $result = new Result; |
40 | - if($ac + $cc > 0) { |
|
40 | + if ($ac + $cc > 0) { |
|
41 | 41 | $abstractness = round($ac / ($ac + $cc), 2); |
42 | 42 | } |
43 | 43 | $result->setAbstractness($abstractness); |
@@ -28,16 +28,16 @@ |
||
28 | 28 | |
29 | 29 | $ca = $ce = $i = 0; |
30 | 30 | |
31 | - foreach($results as $result) { |
|
31 | + foreach ($results as $result) { |
|
32 | 32 | $r = $result->getCoupling(); |
33 | - if(is_object($r)) { |
|
33 | + if (is_object($r)) { |
|
34 | 34 | $ce += $r->getEfferentCoupling(); |
35 | 35 | $ca += $r->getAfferentCoupling(); |
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | 39 | $result = new Result; |
40 | - if($ca + $ce > 0) { |
|
40 | + if ($ca + $ce > 0) { |
|
41 | 41 | $i = round($ce / ($ca + $ce), 2); |
42 | 42 | } |
43 | 43 | $result->setInstability($i); |