finally-a-fast/faftephp

View on GitHub
src/Helpers/ElementSetting.php

Summary

Maintainability
A
2 hrs
Test Coverage

ElementSetting has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

class ElementSetting extends BaseObject
{
    /**
     * @var string
     */
Severity: Minor
Found in src/Helpers/ElementSetting.php - About 2 hrs to fix

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

        public function setMultipleAttributeExpression(string $multipleAttributeExpression): self
    Severity: Minor
    Found in src/Helpers/ElementSetting.php by phpmd

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

        public string $multipleAttributeExpression = '/^{{name}}(-(.*))?$/i';
    Severity: Minor
    Found in src/Helpers/ElementSetting.php by phpmd

    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 'getMultiple()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getMultiple(): bool
        {
            return $this->multiple;
        }
    Severity: Minor
    Found in src/Helpers/ElementSetting.php by phpmd

    BooleanGetMethodName

    Since: 0.2

    Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

    Example

    class Foo {
        /**
         * @return boolean
         */
        public function getFoo() {} // bad
        /**
         * @return bool
         */
        public function isFoo(); // ok
        /**
         * @return boolean
         */
        public function getFoo($bar); // ok, unless checkParameterizedMethods=true
    }

    Source https://phpmd.org/rules/naming.html#booleangetmethodname

    The 'getSafeData()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getSafeData(): bool
        {
            return $this->safeData;
        }
    Severity: Minor
    Found in src/Helpers/ElementSetting.php by phpmd

    BooleanGetMethodName

    Since: 0.2

    Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

    Example

    class Foo {
        /**
         * @return boolean
         */
        public function getFoo() {} // bad
        /**
         * @return bool
         */
        public function isFoo(); // ok
        /**
         * @return boolean
         */
        public function getFoo($bar); // ok, unless checkParameterizedMethods=true
    }

    Source https://phpmd.org/rules/naming.html#booleangetmethodname

    The 'getRawData()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getRawData(): bool
        {
            return $this->rawData;
        }
    Severity: Minor
    Found in src/Helpers/ElementSetting.php by phpmd

    BooleanGetMethodName

    Since: 0.2

    Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

    Example

    class Foo {
        /**
         * @return boolean
         */
        public function getFoo() {} // bad
        /**
         * @return bool
         */
        public function isFoo(); // ok
        /**
         * @return boolean
         */
        public function getFoo($bar); // ok, unless checkParameterizedMethods=true
    }

    Source https://phpmd.org/rules/naming.html#booleangetmethodname

    The 'getAttributeNameAsKey()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getAttributeNameAsKey(): bool
        {
            return $this->attributeNameAsKey;
        }
    Severity: Minor
    Found in src/Helpers/ElementSetting.php by phpmd

    BooleanGetMethodName

    Since: 0.2

    Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

    Example

    class Foo {
        /**
         * @return boolean
         */
        public function getFoo() {} // bad
        /**
         * @return bool
         */
        public function isFoo(); // ok
        /**
         * @return boolean
         */
        public function getFoo($bar); // ok, unless checkParameterizedMethods=true
    }

    Source https://phpmd.org/rules/naming.html#booleangetmethodname

    There are no issues that match your filters.

    Category
    Status