XoopsModules25x/about

View on GitHub
blocks/blocks.php

Summary

Maintainability
A
1 hr
Test Coverage

Method about_block_page_edit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function about_block_page_edit($options)
{
    $moduleDirName = basename(dirname(__DIR__));
    $helper       = Helper::getInstance();
    $options_page = [];
Severity: Minor
Found in blocks/blocks.php - About 1 hr to fix

    Missing class import via use statement (line '122', column '27').
    Open

        $form->addElement(new \XoopsFormRadioYN(_MB_ABOUT_DOTITLEIMAGE, 'options[3]', $options[3]));
    Severity: Minor
    Found in blocks/blocks.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

    Missing class import via use statement (line '116', column '24').
    Open

        $form        = new XoopsModules\About\BlockForm();
    Severity: Minor
    Found in blocks/blocks.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

    Missing class import via use statement (line '121', column '27').
    Open

        $form->addElement(new \XoopsFormText(_MB_ABOUT_VIEW_MORELINKTEXT, 'options[2]', 30, 50, $options[2]));
    Severity: Minor
    Found in blocks/blocks.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

    Missing class import via use statement (line '37', column '29').
    Open

        $menu_criteria->add(new \Criteria('page_status', Constants::PUBLISHED), 'AND');
    Severity: Minor
    Found in blocks/blocks.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

    Missing class import via use statement (line '102', column '24').
    Open

        $criteria    = new \CriteriaCompo();
    Severity: Minor
    Found in blocks/blocks.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

    Missing class import via use statement (line '103', column '24').
    Open

        $criteria->add(new \Criteria('page_status', Constants::PUBLISHED), 'AND');
    Severity: Minor
    Found in blocks/blocks.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

    Missing class import via use statement (line '104', column '24').
    Open

        $criteria->add(new \Criteria('page_type', Constants::PAGE_TYPE_PAGE));
    Severity: Minor
    Found in blocks/blocks.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

    Missing class import via use statement (line '120', column '27').
    Open

        $form->addElement(new \XoopsFormText(_MB_ABOUT_TEXT_LENGTH, 'options[1]', 5, 5, $options[1]));
    Severity: Minor
    Found in blocks/blocks.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

    Missing class import via use statement (line '36', column '26').
    Open

        $menu_criteria = new \CriteriaCompo();
    Severity: Minor
    Found in blocks/blocks.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

    Missing class import via use statement (line '117', column '24').
    Open

        $page_select = new \XoopsFormRadio(_MB_ABOUT_BLOCKPAGE, 'options[0]', $options[0], '<br>');
    Severity: Minor
    Found in blocks/blocks.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

    Missing class import via use statement (line '38', column '29').
    Open

        $menu_criteria->add(new \Criteria('page_menu_status', Constants::IN_MENU));
    Severity: Minor
    Found in blocks/blocks.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 using static access to class '\XoopsModules\About\Helper' in method 'about_block_page_show'.
    Open

        $helper = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 '\XoopsModules\About\Helper' in method 'about_block_menu_show'.
    Open

        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 '\MyTextSanitizer' in method 'about_block_page_show'.
    Open

        $myts        = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 '\XoopsModules\About\Helper' in method 'about_block_page_edit'.
    Open

        $helper       = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 unused local variables such as '$moduleDirName'.
    Open

        $moduleDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/blocks.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

    Avoid unused local variables such as '$moduleDirName'.
    Open

        $moduleDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/blocks.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

    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 30 and the first side effect is on line 26.
    Open

    <?php
    Severity: Minor
    Found in blocks/blocks.php by phpcodesniffer

    Line exceeds 120 characters; contains 132 characters
    Open

            $page_title       = '<a href="' . $helper->url("index.php?page_id={$k}") . '" target="_blank">' . $v['page_title'] . '</a>';
    Severity: Minor
    Found in blocks/blocks.php by phpcodesniffer

    Line exceeds 120 characters; contains 146 characters
    Open

            $options_page[$k] = empty($v['page_image']) ? $page_title : $page_title . '<img src="' . $helper->url('assets/images/picture.png') . '">';
    Severity: Minor
    Found in blocks/blocks.php by phpcodesniffer

    The variable $page_title is not named in camelCase.
    Open

    function about_block_page_edit($options)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $helper       = Helper::getInstance();
        $options_page = [];
    Severity: Minor
    Found in blocks/blocks.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 $menu_criteria is not named in camelCase.
    Open

    function about_block_menu_show()
    {
        $moduleDirName = basename(dirname(__DIR__));
    
        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 $page_select is not named in camelCase.
    Open

    function about_block_page_edit($options)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $helper       = Helper::getInstance();
        $options_page = [];
    Severity: Minor
    Found in blocks/blocks.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 $page_menu is not named in camelCase.
    Open

    function about_block_menu_show()
    {
        $moduleDirName = basename(dirname(__DIR__));
    
        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 $page_text is not named in camelCase.
    Open

    function about_block_page_show($options)
    {
        if (empty($options[0])) {
            return false;
        }
    Severity: Minor
    Found in blocks/blocks.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 $options_page is not named in camelCase.
    Open

    function about_block_page_edit($options)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $helper       = Helper::getInstance();
        $options_page = [];
    Severity: Minor
    Found in blocks/blocks.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 $menu_criteria is not named in camelCase.
    Open

    function about_block_menu_show()
    {
        $moduleDirName = basename(dirname(__DIR__));
    
        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 $page_menu is not named in camelCase.
    Open

    function about_block_menu_show()
    {
        $moduleDirName = basename(dirname(__DIR__));
    
        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 $page_text is not named in camelCase.
    Open

    function about_block_page_show($options)
    {
        if (empty($options[0])) {
            return false;
        }
    Severity: Minor
    Found in blocks/blocks.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 $options_page is not named in camelCase.
    Open

    function about_block_page_edit($options)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $helper       = Helper::getInstance();
        $options_page = [];
    Severity: Minor
    Found in blocks/blocks.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 $page_menu is not named in camelCase.
    Open

    function about_block_menu_show()
    {
        $moduleDirName = basename(dirname(__DIR__));
    
        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 $page_title is not named in camelCase.
    Open

    function about_block_page_edit($options)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $helper       = Helper::getInstance();
        $options_page = [];
    Severity: Minor
    Found in blocks/blocks.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 $options_page is not named in camelCase.
    Open

    function about_block_page_edit($options)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $helper       = Helper::getInstance();
        $options_page = [];
    Severity: Minor
    Found in blocks/blocks.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 $page_select is not named in camelCase.
    Open

    function about_block_page_edit($options)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $helper       = Helper::getInstance();
        $options_page = [];
    Severity: Minor
    Found in blocks/blocks.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 $menu_criteria is not named in camelCase.
    Open

    function about_block_menu_show()
    {
        $moduleDirName = basename(dirname(__DIR__));
    
        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 $page_select is not named in camelCase.
    Open

    function about_block_page_edit($options)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $helper       = Helper::getInstance();
        $options_page = [];
    Severity: Minor
    Found in blocks/blocks.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 $page_text is not named in camelCase.
    Open

    function about_block_page_show($options)
    {
        if (empty($options[0])) {
            return false;
        }
    Severity: Minor
    Found in blocks/blocks.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 $page_title is not named in camelCase.
    Open

    function about_block_page_edit($options)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $helper       = Helper::getInstance();
        $options_page = [];
    Severity: Minor
    Found in blocks/blocks.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 $menu_criteria is not named in camelCase.
    Open

    function about_block_menu_show()
    {
        $moduleDirName = basename(dirname(__DIR__));
    
        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 $menu_criteria is not named in camelCase.
    Open

    function about_block_menu_show()
    {
        $moduleDirName = basename(dirname(__DIR__));
    
        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 $menu_criteria is not named in camelCase.
    Open

    function about_block_menu_show()
    {
        $moduleDirName = basename(dirname(__DIR__));
    
        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 $page_menu is not named in camelCase.
    Open

    function about_block_menu_show()
    {
        $moduleDirName = basename(dirname(__DIR__));
    
        $helper        = Helper::getInstance();
    Severity: Minor
    Found in blocks/blocks.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 $page_text is not named in camelCase.
    Open

    function about_block_page_show($options)
    {
        if (empty($options[0])) {
            return false;
        }
    Severity: Minor
    Found in blocks/blocks.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 $page_title is not named in camelCase.
    Open

    function about_block_page_edit($options)
    {
        $moduleDirName = basename(dirname(__DIR__));
        $helper       = Helper::getInstance();
        $options_page = [];
    Severity: Minor
    Found in blocks/blocks.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