src/Hal/Metric/Class_/Component/MaintainabilityIndexVisitor.php 1 location
|
@@ 52-57 (lines=6) @@
|
| 49 |
|
{ |
| 50 |
|
if ($node instanceof Stmt\Class_) { |
| 51 |
|
|
| 52 |
|
if ($node instanceof Stmt\Class_) { |
| 53 |
|
$classOrFunction = $this->metrics->get($node->namespacedName->toString()); |
| 54 |
|
} else { |
| 55 |
|
$classOrFunction = new FunctionMetric($node->name); |
| 56 |
|
$this->metrics->attach($classOrFunction); |
| 57 |
|
} |
| 58 |
|
if (null === $lloc = $classOrFunction->get('lloc')) { |
| 59 |
|
throw new \LogicException('please enable length (lloc) visitor first'); |
| 60 |
|
} |
src/Hal/Metric/Class_/Text/HalsteadVisitor.php 1 location
|
@@ 48-53 (lines=6) @@
|
| 45 |
|
{ |
| 46 |
|
if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Function_) { |
| 47 |
|
|
| 48 |
|
if ($node instanceof Stmt\Class_) { |
| 49 |
|
$classOrFunction = $this->metrics->get($node->namespacedName->toString()); |
| 50 |
|
} else { |
| 51 |
|
$classOrFunction = new FunctionMetric($node->name); |
| 52 |
|
$this->metrics->attach($classOrFunction); |
| 53 |
|
} |
| 54 |
|
|
| 55 |
|
// search for operands and operators |
| 56 |
|
$operands = []; |
src/Hal/Metric/Class_/Text/LengthVisitor.php 1 location
|
@@ 39-44 (lines=6) @@
|
| 36 |
|
{ |
| 37 |
|
if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Function_) { |
| 38 |
|
|
| 39 |
|
if ($node instanceof Stmt\Class_) { |
| 40 |
|
$classOrFunction = $this->metrics->get($node->namespacedName->toString()); |
| 41 |
|
} else { |
| 42 |
|
$classOrFunction = new FunctionMetric($node->name); |
| 43 |
|
$this->metrics->attach($classOrFunction); |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
|
| 47 |
|
$prettyPrinter = new PrettyPrinter\Standard(); |