YetiForceCompany/YetiForceCRM

View on GitHub
app/Conditions/RecordFields/ReferenceField.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\Record' in method 'operatorC'.
Open

        return false !== strpos(\App\Record::getLabel($this->getValue(), true), $this->value);

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 '\App\Record' in method 'operatorK'.
Open

        return false === strpos(\App\Record::getLabel($this->getValue(), true), $this->value);

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 '\App\Record' in method 'operatorS'.
Open

        $referenceLabel = \App\Record::getLabel($this->getValue(), true);

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 '\App\Record' in method 'operatorE'.
Open

        return \App\Record::getLabel($this->getValue(), true) === $this->value;

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 '\App\Record' in method 'operatorEw'.
Open

        $referenceLabel = \App\Record::getLabel($this->getValue(), true);

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 $lengthValueConditions. Keep variable name length under 20.
Open

        $lengthValueConditions = \strlen($this->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 $lengthValueConditions. Keep variable name length under 20.
Open

        $lengthValueConditions = \strlen($this->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

Spaces must be used for alignment; tabs are not allowed
Open

        }

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

    public function operatorK(): bool

Spaces must be used for alignment; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used for alignment; tabs are not allowed
Open

    public function operatorC()

Spaces must be used for alignment; tabs are not allowed
Open

        return false !== strpos(\App\Record::getLabel($this->getValue(), true), $this->value);

Spaces must be used for alignment; tabs are not allowed
Open

 * @license        YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)

Spaces must be used for alignment; tabs are not allowed
Open

        return \App\Record::getLabel($this->getValue(), true) === $this->value;

Spaces must be used for alignment; tabs are not allowed
Open

    public function operatorS(): bool

Spaces must be used for alignment; tabs are not allowed
Open

 * @author        Radosław Skrzypczak <r.skrzypczak@yetiforce.com>

Spaces must be used for alignment; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used for alignment; tabs are not allowed
Open

        $referenceLabel = \App\Record::getLabel($this->getValue(), true);

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used for alignment; tabs are not allowed
Open

        $referenceLabel = \App\Record::getLabel($this->getValue(), true);

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

        return false === strpos(\App\Record::getLabel($this->getValue(), true), $this->value);

Spaces must be used for alignment; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used for alignment; tabs are not allowed
Open

            return 0 == substr_compare($referenceLabel, $this->value, $lengthLabelRecord - $lengthValueConditions, $lengthValueConditions);

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

        if (\strlen($referenceLabel) >= $lengthValueConditions) {

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

    public function operatorE()

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

    public function operatorEw(): bool

Spaces must be used for alignment; tabs are not allowed
Open

        $lengthValueConditions = \strlen($this->value);

Spaces must be used for alignment; tabs are not allowed
Open

        }

Spaces must be used for alignment; tabs are not allowed
Open

        if ($lengthLabelRecord >= $lengthValueConditions) {

Spaces must be used for alignment; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used for alignment; tabs are not allowed
Open

 * @author        Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>

Spaces must be used for alignment; tabs are not allowed
Open

        $lengthValueConditions = \strlen($this->value);

Spaces must be used for alignment; tabs are not allowed
Open

        return false;

Spaces must be used for alignment; tabs are not allowed
Open

            return 0 == substr_compare($referenceLabel, $this->value, 0, $lengthValueConditions, true);

Spaces must be used for alignment; tabs are not allowed
Open

        $lengthLabelRecord = \strlen($referenceLabel);

Spaces must be used for alignment; tabs are not allowed
Open

        return false;

Line exceeds 120 characters; contains 139 characters
Open

            return 0 == substr_compare($referenceLabel, $this->value, $lengthLabelRecord - $lengthValueConditions, $lengthValueConditions);

There are no issues that match your filters.

Category
Status