XoopsModules25x/userlog

View on GitHub
class/plugin/newbb.php

Summary

Maintainability
A
1 hr
Test Coverage

Method item has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function item($subscribe_from)
    {
        if (empty($subscribe_from)) {
            $script_arr             = [];
            $script_arr['topic_id'] = ['viewtopic.php'];
Severity: Minor
Found in class/plugin/newbb.php - About 1 hr to fix

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

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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

    Avoid using static access to class '\Xmf\Request' in method 'item'.
    Open

                    $post_id      = Request::getInt('post_id',  0);
    Severity: Minor
    Found in class/plugin/newbb.php by phpmd

    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 '\Xmf\Request' in method 'item'.
    Open

                    $move         = Request::getString('move', '', 'GET') ;
    Severity: Minor
    Found in class/plugin/newbb.php by phpmd

    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 '\Xmf\Request' in method 'item'.
    Open

                    $forum_id = Request::getInt('forum', 0);
    Severity: Minor
    Found in class/plugin/newbb.php by phpmd

    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 '\Xmf\Request' in method 'item'.
    Open

                    $topic_id     = Request::getInt('topic_id',  0);
    Severity: Minor
    Found in class/plugin/newbb.php by phpmd

    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 '\Xmf\Request' in method 'item'.
    Open

                        $forum_id  = Request::getInt('forum_id',  0);
    Severity: Minor
    Found in class/plugin/newbb.php by phpmd

    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

    Each class must be in a namespace of at least one level (a top-level vendor name)
    Open

    class NewbbUserlogPlugin extends Userlog_Module_Plugin_Abstract implements UserlogPluginInterface
    Severity: Minor
    Found in class/plugin/newbb.php by phpcodesniffer

    The parameter $subscribe_from is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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

    A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 29 and the first side effect is on line 24.
    Open

    <?php
    Severity: Minor
    Found in class/plugin/newbb.php by phpcodesniffer

    Expected 1 space after comma in function call; 2 found
    Open

                    $topic_id     = Request::getInt('topic_id',  0);
    Severity: Minor
    Found in class/plugin/newbb.php by phpcodesniffer

    The CASE body must start on the line following the statement
    Open

                case 'viewtopic.php':
    Severity: Minor
    Found in class/plugin/newbb.php by phpcodesniffer

    Expected 1 space after comma in function call; 2 found
    Open

                    $post_id      = Request::getInt('post_id',  0);
    Severity: Minor
    Found in class/plugin/newbb.php by phpcodesniffer

    Expected 1 space after comma in function call; 2 found
    Open

                        $forum_id  = Request::getInt('forum_id',  0);
    Severity: Minor
    Found in class/plugin/newbb.php by phpcodesniffer

    Line exceeds 120 characters; contains 127 characters
    Open

         * @return array $script_arr["item_name"] name of the item = array("subscribe_from1", "subscribe_from2") Name of the script
    Severity: Minor
    Found in class/plugin/newbb.php by phpcodesniffer

    The variable $script_arr is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $topic_obj is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $topic_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $script_arr is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $topic_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $post_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $post_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $script_arr is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $topic_obj is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $script_arr is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $forum_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $topic_obj is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $topic_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $forum_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $topic_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $forum_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $forum_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $subscribe_from is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $post_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $subscribe_from is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $topic_id is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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 $topic_obj is not named in camelCase.
    Open

        public function item($subscribe_from)
        {
            if (empty($subscribe_from)) {
                $script_arr             = [];
                $script_arr['topic_id'] = ['viewtopic.php'];
    Severity: Minor
    Found in class/plugin/newbb.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