Completed
Push — master ( 0e1c32...e580ff )
by T
05:02
created

Property   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 80%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 2
dl 10
loc 10
ccs 4
cts 5
cp 0.8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFullyQualifiedName() 8 8 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace PHPSemVerChecker\Node\Statement;
4
5
use PhpParser\Node\Stmt;
6
use PhpParser\Node\Stmt\Property as BaseProperty;
7
8 View Code Duplication
class Property {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9 4
	public static function getFullyQualifiedName(Stmt $context, BaseProperty $property)
10
	{
11 4
		$namespace = $context->name;
0 ignored issues
show
Bug introduced by
The property name does not seem to exist in PhpParser\Node\Stmt.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
12 4
		if (isset($context->namespacedName)) {
13
			$namespace = $context->namespacedName->toString();
0 ignored issues
show
Bug introduced by
The property namespacedName does not seem to exist in PhpParser\Node\Stmt.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
14
		}
15 4
		return $namespace . '::$' . $property->props[0]->name;
16
	}
17
}
18