Asymptix/Framework

View on GitHub

Showing 720 of 720 total issues

Method setValueWithComplexName has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function setValueWithComplexName(&$array, $complexName, $value, $rewrite = false) {
        if (!is_array($complexName)) {
            $complexName = self::parseComplexName($complexName);
        }

Severity: Minor
Found in framework/helpers/Naming.php - About 1 hr to fix

    Function __call has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __call($methodName, $methodParams) {
            /*
             * Selects DBObject record by some field value.
             *
             * @param <mixed> Value of the field
    Severity: Minor
    Found in framework/db/DBSelector.php - About 1 hr 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

    Function localize has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function localize($value = "") {
            $localizedValue = Languages::$langs;
            if (is_array($value)) {
                foreach ($localizedValue as $langKey => &$lValue) {
                    if (isset($value[$langKey])) {
    Severity: Minor
    Found in framework/localization/Localization.php - About 1 hr 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

    Function sqlPushValues has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function sqlPushValues($values, $separator = ", ") {
            $chunks = [];
            foreach ($values as $fieldName => $fieldValue) {
                if (!is_array($fieldValue)) {
                    if (!is_null($fieldValue)) {
    Severity: Minor
    Found in framework/db/DBPreparedQuery.php - About 1 hr 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

    Method __construct has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct($optionValue, $option, $currentValue, $template = "") {
            if (empty($template)) {
                $template = self::DEFAULT_TEMPLATE;
            }
            if (isObject($option)) {
    Severity: Minor
    Found in framework/ui/components/UIListOption.php - About 1 hr to fix

      Method getRedirectUrl has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getRedirectUrl($url) {
              $urlParts = @parse_url($url);
              if (!$urlParts) {
                  return false;
              }
      Severity: Minor
      Found in framework/web/Http.php - About 1 hr to fix

        Avoid using undefined variables such as '$null' which will lead to PHP notices.
        Open

                                'null' => $null,
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$parameters' which will lead to PHP notices.
        Open

                call_user_func_array([$stmt, 'bind_result'], $parameters);
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$comment' which will lead to PHP notices.
        Open

                            $field, $type, $collation, $null, $key, $default, $extra, $privileges, $comment
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$parameters' which will lead to PHP notices.
        Open

                    $parameters[] = &$$parameterName;
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$null' which will lead to PHP notices.
        Open

                            $field, $type, $collation, $null, $key, $default, $extra, $privileges, $comment
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$privileges' which will lead to PHP notices.
        Open

                                'privileges' => $privileges,
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$default' which will lead to PHP notices.
        Open

                                'default' => $default,
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$_FILTER' which will lead to PHP notices.
        Open

                return isset($_FILTER[$filterName]);
        Severity: Minor
        Found in framework/core/Tools.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$default' which will lead to PHP notices.
        Open

                            $field, $type, $collation, $null, $key, $default, $extra, $privileges, $comment
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$extra' which will lead to PHP notices.
        Open

                            $field, $type, $collation, $null, $key, $default, $extra, $privileges, $comment
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$parameters' which will lead to PHP notices.
        Open

                            $fieldValue = $parameters[$fieldValue];
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$collation' which will lead to PHP notices.
        Open

                            $field, $type, $collation, $null, $key, $default, $extra, $privileges, $comment
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$privileges' which will lead to PHP notices.
        Open

                            $field, $type, $collation, $null, $key, $default, $extra, $privileges, $comment
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Avoid using undefined variables such as '$collation' which will lead to PHP notices.
        Open

                                'collation' => $collation,
        Severity: Minor
        Found in framework/db/DBCore.php by phpmd

        UndefinedVariable

        Since: 2.8.0

        Detects when a variable is used that has not been defined before.

        Example

        class Foo
        {
            private function bar()
            {
                // $message is undefined
                echo $message;
            }
        }

        Source https://phpmd.org/rules/cleancode.html#undefinedvariable

        Severity
        Category
        Status
        Source
        Language