mambax7/alumni-26x

View on GitHub
blocks/alumni.php

Summary

Maintainability
A
1 hr
Test Coverage

Method alumni_show has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function alumni_show($options)
{
    $block        = [];
    $myts         = MyTextSanitizer::getInstance();
    $blockDirName = basename(dirname(__DIR__));
Severity: Minor
Found in blocks/alumni.php - About 1 hr to fix

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

        $criteria->add(new Criteria('valid', 1, '='));
    Severity: Minor
    Found in blocks/alumni.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 '46', column '24').
    Open

        $criteria->add(new Criteria('cid', '(' . $all_ids . ')', 'IN'));
    Severity: Minor
    Found in blocks/alumni.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 '44', column '21').
    Open

        $criteria = new CriteriaCompo();
    Severity: Minor
    Found in blocks/alumni.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 'Xoops' in method 'alumni_show'.
    Open

        $helper         = Xoops::getModuleHelper('alumni');
    Severity: Minor
    Found in blocks/alumni.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 'alumni_show'.
    Open

        $myts         = MyTextSanitizer::getInstance();
    Severity: Minor
    Found in blocks/alumni.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 'Xoops' in method 'alumni_show'.
    Open

        $xoops          = Xoops::getInstance();
    Severity: Minor
    Found in blocks/alumni.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 '$view'.
    Open

            $view   = $block_listings[$i]->getVar('view');
    Severity: Minor
    Found in blocks/alumni.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 '$myts'.
    Open

        $myts         = MyTextSanitizer::getInstance();
    Severity: Minor
    Found in blocks/alumni.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 21.
    Open

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

    Line exceeds 120 characters; contains 207 characters
    Open

            $a_item['link']   = '<a href="' . XOOPS_URL . "/modules/{$blockDirName}/listing.php?lid=" . addslashes($block_listings[$i]->getVar('lid')) . "\"><b>$year&nbsp;-&nbsp;$name $mname $lname</b><br></a>";
    Severity: Minor
    Found in blocks/alumni.php by phpcodesniffer

    Line exceeds 120 characters; contains 167 characters
    Open

        $form .= '&nbsp;' . AlumniLocale::BLOCKS_DISPLAY . "&nbsp;<input type='text' name='options[]' value='" . $options[1] . "'/>&nbsp;" . AlumniLocale::BLOCKS_LISTINGS;
    Severity: Minor
    Found in blocks/alumni.php by phpcodesniffer

    Line exceeds 120 characters; contains 151 characters
    Open

        $block['link']       = '<a href="' . XOOPS_URL . "/modules/{$blockDirName}/index.php\"><b>" . AlumniLocale::BLOCKS_ALL_LISTINGS . '</b></a></div>';
    Severity: Minor
    Found in blocks/alumni.php by phpcodesniffer

    Line exceeds 120 characters; contains 184 characters
    Open

        $form .= '&nbsp;<br><br>' . AlumniLocale::BLOCKS_LENGTH . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'/>&nbsp;" . AlumniLocale::BLOCKS_CHARS . '<br><br>';
    Severity: Minor
    Found in blocks/alumni.php by phpcodesniffer

    The variable $a_item is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $alumni_ids is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $all_ids is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $block_listings is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $alumni_ids is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $block_listings is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $block_listings is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $block_listings is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $all_ids is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $block_listings is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $module_id is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $block_listings is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $a_item is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $block_listings is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $a_item is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $block_listings is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $block_listings is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $a_item is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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 $module_id is not named in camelCase.
    Open

    function alumni_show($options)
    {
        $block        = [];
        $myts         = MyTextSanitizer::getInstance();
        $blockDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in blocks/alumni.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