steeffeen/FancyManiaLinks

View on GitHub
FML/XmlRpc/UIProperties.php

Summary

Maintainability
B
4 hrs
Test Coverage
A
100%

UIProperties has 32 functions (exceeds 20 allowed). Consider refactoring.
Open

class UIProperties
{

    /**
     * @var array $chatProperties Chat properties
Severity: Minor
Found in FML/XmlRpc/UIProperties.php - About 4 hrs to fix

    Function renderStandalone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function renderStandalone()
        {
            $domDocument                = new \DOMDocument("1.0", "utf-8");
            $domDocument->xmlStandalone = true;
    
    
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.php - About 25 mins to fix

    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 '338', column '43').
    Open

            $domDocument                = new \DOMDocument("1.0", "utf-8");
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.php by phpmd

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

        protected $scoresTableProperties = array();
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.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 $endMapLadderRecapProperties. Keep variable name length under 20.
    Open

        protected $endMapLadderRecapProperties = array();
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.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 closing brace for the class must go on the next line after the body
    Open

    }
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.php by phpcodesniffer

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

        public function getChatVisible()
        {
            return $this->getVisibleProperty($this->chatProperties);
        }
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.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 'getScoresTableAltVisible()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getScoresTableAltVisible()
        {
            return $this->getProperty($this->scoresTableProperties, "alt_visible");
        }
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.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 'getVisibleProperty()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        protected function getVisibleProperty(array &$properties)
        {
            return $this->getProperty($properties, "visible");
        }
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.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 'getChatAvatarVisible()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getChatAvatarVisible()
        {
            return $this->getVisibleProperty($this->chatAvatarProperties);
        }
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.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 'getMapInfoVisible()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getMapInfoVisible()
        {
            return $this->getVisibleProperty($this->mapInfoProperties);
        }
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.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 'getCountdownVisible()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getCountdownVisible()
        {
            return $this->getVisibleProperty($this->countdownProperties);
        }
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.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 'getEndMapLadderRecapVisible()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getEndMapLadderRecapVisible()
        {
            return $this->getVisibleProperty($this->endMapLadderRecapProperties);
        }
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.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 'getGoVisible()' method which returns a boolean should be named 'is...()' or 'has...()'
    Open

        public function getGoVisible()
        {
            return $this->getVisibleProperty($this->goProperties);
        }
    Severity: Minor
    Found in FML/XmlRpc/UIProperties.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