Function Has_unique_codes_across_all_weaponlikes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function Has_unique_codes_across_all_weaponlikes()
{
$sutClass = self::getSutClass();
$reflection = new \ReflectionClass($sutClass);
$sameCodes = [];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Missing class import via use statement (line '14', column '27'). Open
$reflection = new \ReflectionClass(self::getSutClass());
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '31', column '27'). Open
$reflection = new \ReflectionClass($sutClass);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The method I_can_easily_find_out_if_is_melee is not named in camelCase. Open
abstract public function I_can_easily_find_out_if_is_melee();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method I_can_easily_find_out_if_is_shield is not named in camelCase. Open
abstract public function I_can_easily_find_out_if_is_shield();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method I_can_easily_find_out_it_is_not_projectile is not named in camelCase. Open
abstract public function I_can_easily_find_out_it_is_not_projectile();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method I_can_easily_find_out_if_is_weapon is not named in camelCase. Open
abstract public function I_can_easily_find_out_if_is_weapon();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method I_can_easily_find_out_if_is_ranged is not named in camelCase. Open
abstract public function I_can_easily_find_out_if_is_ranged();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method Has_unique_codes_across_all_weaponlikes is not named in camelCase. Open
public function Has_unique_codes_across_all_weaponlikes()
{
$sutClass = self::getSutClass();
$reflection = new \ReflectionClass($sutClass);
$sameCodes = [];
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method It_is_weaponlike_code is not named in camelCase. Open
public function It_is_weaponlike_code()
{
$reflection = new \ReflectionClass(self::getSutClass());
/** @var WeaponlikeCode $sut */
$sut = $reflection->newInstanceWithoutConstructor();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method I_can_easily_find_out_if_weapon_is_unarmed_in_fact is not named in camelCase. Open
abstract public function I_can_easily_find_out_if_weapon_is_unarmed_in_fact();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}