Code Duplication    Length = 7-7 lines in 2 locations

src/Hal/Metric/Class_/Text/HalsteadVisitor.php 1 location

@@ 46-52 (lines=7) @@
43
    public function leaveNode(Node $node)
44
    {
45
        if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Function_ || $node instanceof Stmt\Trait_) {
46
            if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Trait_) {
47
                $name = (string) (isset($node->namespacedName) ? $node->namespacedName : 'anonymous@'.spl_object_hash($node));
48
                $classOrFunction = $this->metrics->get($name);
49
            } else {
50
                $classOrFunction = new FunctionMetric((string) $node->name);
51
                $this->metrics->attach($classOrFunction);
52
            }
53
54
            // search for operands and operators
55
            $operands = [];

src/Hal/Metric/Class_/Text/LengthVisitor.php 1 location

@@ 36-42 (lines=7) @@
33
    public function leaveNode(Node $node)
34
    {
35
        if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Function_ || $node instanceof Stmt\Trait_) {
36
            if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Trait_) {
37
                $name = (string) (isset($node->namespacedName) ? $node->namespacedName : 'anonymous@'.spl_object_hash($node));
38
                $classOrFunction = $this->metrics->get($name);
39
            } else {
40
                $classOrFunction = new FunctionMetric((string) $node->name);
41
                $this->metrics->attach($classOrFunction);
42
            }
43
44
45
            $prettyPrinter = new PrettyPrinter\Standard();