jaroslavtyc/drd-plus-codes

View on GitHub
tests/Codes/Properties/PropertyCodeTest.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '94', column '46').
Open

        $remarkableSenseCodeReflection = new \ReflectionClass(RemarkableSenseCode::class);

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

Avoid using static access to class '\DrdPlus\Codes\Properties\RemarkableSenseCode' in method 'I_can_get_remarkable_property_codes'.
Open

            RemarkableSenseCode::getPossibleValues(),

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\Properties\PropertyCode' in method 'I_can_get_restriction_property_codes'.
Open

            PropertyCode::getRestrictionPropertyPossibleValues()

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\Properties\PropertyCode' in method 'I_can_get_base_property_codes'.
Open

            PropertyCode::getBasePropertyPossibleValues()

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\Properties\PropertyCode' in method 'I_can_get_derived_property_codes'.
Open

            PropertyCode::getDerivedPropertyPossibleValues()

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\Properties\PropertyCode' in method 'I_can_get_body_property_codes'.
Open

            PropertyCode::getBodyPropertyPossibleValues()

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\Properties\PropertyCode' in method 'I_can_get_native_property_codes'.
Open

            PropertyCode::getNativePropertyPossibleValues()

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\Properties\PropertyCode' in method 'I_can_get_remarkable_property_codes'.
Open

            PropertyCode::getRemarkableSensePropertyPossibleValues()

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 excessively long variable names like $remarkableSenseCodeConstant. Keep variable name length under 20.
Open

        foreach ($remarkableSenseCodeReflection->getConstants() as $remarkableSenseCodeConstant => $value) {

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

Avoid excessively long variable names like $remarkableSenseCodeReflection. Keep variable name length under 20.
Open

        $remarkableSenseCodeReflection = new \ReflectionClass(RemarkableSenseCode::class);

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_native_property_codes is not named in camelCase.
Open

    public function I_can_get_native_property_codes()
    {
        self::assertEquals(
            [
                'infravision',

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_restriction_property_codes is not named in camelCase.
Open

    public function I_can_get_restriction_property_codes()
    {
        self::assertEquals(
            [
                'requires_dm_agreement',

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_body_property_codes is not named in camelCase.
Open

    public function I_can_get_body_property_codes()
    {
        self::assertEquals(
            [
                'age',

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_remarkable_property_codes is not named in camelCase.
Open

    public function I_can_get_remarkable_property_codes()
    {
        self::assertSame(
            RemarkableSenseCode::getPossibleValues(),
            PropertyCode::getRemarkableSensePropertyPossibleValues()

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_base_property_codes is not named in camelCase.
Open

    public function I_can_get_base_property_codes()
    {
        self::assertSame(
            [
                'strength',

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_derived_property_codes is not named in camelCase.
Open

    public function I_can_get_derived_property_codes()
    {
        self::assertEquals(
            [
                'beauty',

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

There are no issues that match your filters.

Category
Status