mambax7/adslight

View on GitHub
include/notification.inc.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method adslight_notify_iteminfo has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function adslight_notify_iteminfo(
    $category,
    $item_id
) {
    global $xoopsDB;
Severity: Minor
Found in include/notification.inc.php - About 1 hr to fix

    Function adslight_notify_iteminfo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php - About 55 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

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

            $item['url'] = XOOPS_URL . '/modules/adslight/viewads.php?lid= ' . $item_id;
    Severity: Minor
    Found in include/notification.inc.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 '$item' which will lead to PHP notices.
    Open

            $item['name'] = $result_array['title'];
    Severity: Minor
    Found in include/notification.inc.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 '$item' which will lead to PHP notices.
    Open

                return $item;
    Severity: Minor
    Found in include/notification.inc.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 '$item' which will lead to PHP notices.
    Open

                $item['url']  = XOOPS_URL . '/modules/adslight/index.php?pa=adsview&cid=' . $item_id;
    Severity: Minor
    Found in include/notification.inc.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 '$item' which will lead to PHP notices.
    Open

            $item['url']  = '';
    Severity: Minor
    Found in include/notification.inc.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 '$item' which will lead to PHP notices.
    Open

                $item['name'] = $result_array['title'];
    Severity: Minor
    Found in include/notification.inc.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 '$item' which will lead to PHP notices.
    Open

            $item['name'] = '';
    Severity: Minor
    Found in include/notification.inc.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 '$item' which will lead to PHP notices.
    Open

            return $item;
    Severity: Minor
    Found in include/notification.inc.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 '$item' which will lead to PHP notices.
    Open

            return $item;
    Severity: Minor
    Found in include/notification.inc.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 unused local variables such as '$module'.
    Open

        $module        = $moduleHandler->getByDirname($moduleDirName);
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

    The parameter $item_id is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseParameterName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name parameters.

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    Line exceeds 120 characters; contains 124 characters
    Open

            $sql = 'SELECT SQL_CACHE title  FROM ' . $xoopsDB->prefix('adslight_categories') . " WHERE cid ={$item_id} LIMIT 1";
    Severity: Minor
    Found in include/notification.inc.php by phpcodesniffer

    The variable $item_id is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $result_array is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $item_id is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $result_array is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $result_array is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $item_id is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $result_array is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $item_id is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $item_id is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $item_id is not named in camelCase.
    Open

    function adslight_notify_iteminfo(
        $category,
        $item_id
    ) {
        global $xoopsDB;
    Severity: Minor
    Found in include/notification.inc.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    There are no issues that match your filters.

    Category
    Status