Method I_can_get_all_values
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function I_can_get_all_values()
{
self::assertSame(
$expectedValues = [
RidingAnimalCode::HORSE => [
The method I_can_get_all_values() has 106 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function I_can_get_all_values()
{
self::assertSame(
$expectedValues = [
RidingAnimalCode::HORSE => [
- Exclude checks
Avoid using static access to class '\DrdPlus\Codes\Transport\RidingAnimalCode' in method 'I_can_get_defiance_of_domesticated'. Open
RidingAnimalCode::getIt(RidingAnimalCode::YAK),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\DrdPlus\Codes\Transport\RidingAnimalCode' in method 'I_can_get_defiance_of_wild'. Open
RidingAnimalCode::getIt(RidingAnimalCode::BULL),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\DrdPlus\Codes\Transport\RidingAnimalCode' in method 'I_can_get_defiance_of_wild'. Open
RidingAnimalCode::getIt(RidingAnimalCode::BULL),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\DrdPlus\Codes\Transport\RidingAnimalCode' in method 'I_can_get_defiance_of_wild'. Open
RidingAnimalCode::getIt(RidingAnimalCode::BULL),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\DrdPlus\Codes\Transport\RidingAnimalCode' in method 'I_can_get_maximal_load'. Open
self::assertSame(11, (new RidingAnimalsTable())->getMaximalLoad(RidingAnimalCode::getIt(RidingAnimalCode::HINNY)));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\DrdPlus\Codes\Transport\RidingAnimalCode' in method 'I_can_get_endurance'. Open
self::assertSame(4, (new RidingAnimalsTable())->getEndurance(RidingAnimalCode::getIt(RidingAnimalCode::COW)));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\DrdPlus\Codes\Transport\RidingAnimalCode' in method 'I_can_get_defiance_of_domesticated'. Open
RidingAnimalCode::getIt(RidingAnimalCode::YAK),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\DrdPlus\Codes\Transport\RidingAnimalCode' in method 'I_can_get_speed'. Open
self::assertSame(-2, (new RidingAnimalsTable())->getSpeed(RidingAnimalCode::getIt(RidingAnimalCode::BULL)));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\DrdPlus\Codes\Transport\RidingAnimalCode' in method 'I_can_get_maximal_load_in_kg'. Open
self::assertSame(110, (new RidingAnimalsTable())->getMaximalLoadInKg(RidingAnimalCode::getIt(RidingAnimalCode::PONY)));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid unused local variables such as '$expectedValues'. Open
$expectedValues = [
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid unused local variables such as '$givenValues'. Open
$givenValues = (new RidingAnimalsTable())->getIndexedValues()
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Avoid excessively long variable names like $defianceOfWildPercents. Keep variable name length under 20. Open
$defianceOfWildPercents = $this->mockery(DefianceOfWildPercents::class);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
The method I_can_get_maximal_load is not named in camelCase. Open
public function I_can_get_maximal_load()
{
self::assertSame(11, (new RidingAnimalsTable())->getMaximalLoad(RidingAnimalCode::getIt(RidingAnimalCode::HINNY)));
}
- 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_get_header is not named in camelCase. Open
public function I_can_get_header()
{
self::assertSame(
[
[
- 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_get_speed is not named in camelCase. Open
public function I_can_get_speed()
{
self::assertSame(-2, (new RidingAnimalsTable())->getSpeed(RidingAnimalCode::getIt(RidingAnimalCode::BULL)));
}
- 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_get_maximal_load_in_kg is not named in camelCase. Open
public function I_can_get_maximal_load_in_kg()
{
self::assertSame(110, (new RidingAnimalsTable())->getMaximalLoadInKg(RidingAnimalCode::getIt(RidingAnimalCode::PONY)));
}
- 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_get_defiance_of_wild is not named in camelCase. Open
public function I_can_get_defiance_of_wild()
{
self::assertSame(
19,
(new RidingAnimalsTable())->getDefianceOfWild(
- 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_get_all_values is not named in camelCase. Open
public function I_can_get_all_values()
{
self::assertSame(
$expectedValues = [
RidingAnimalCode::HORSE => [
- 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_get_endurance is not named in camelCase. Open
public function I_can_get_endurance()
{
self::assertSame(4, (new RidingAnimalsTable())->getEndurance(RidingAnimalCode::getIt(RidingAnimalCode::COW)));
}
- 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_get_defiance_of_domesticated is not named in camelCase. Open
public function I_can_get_defiance_of_domesticated()
{
self::assertSame(
5,
(new RidingAnimalsTable())->getDefianceOfDomesticated(
- 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() {
}
}