XoopsModules25x/contact

View on GitHub
blocks/block_contact_form_map.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method contactGetElements has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function contactGetElements(&$block)
{
    $helper = Contact\Helper::getInstance();

    xoops_loadLanguage('main', 'contact');
Severity: Minor
Found in blocks/block_contact_form_map.php - About 2 hrs to fix

    Avoid unused parameters such as '$options'.
    Open

    function block_contact_map_show($options)
    Severity: Minor
    Found in blocks/block_contact_form_map.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

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

    Avoid unused parameters such as '$options'.
    Open

    function block_contact_form_show($options)
    Severity: Minor
    Found in blocks/block_contact_form_map.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

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

    Avoid unused parameters such as '$options'.
    Open

    function block_contact_form_map_show($options)
    Severity: Minor
    Found in blocks/block_contact_form_map.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

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

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

                [$name, $email] = explode(',', $val, 2); //split the name and email
    Severity: Minor
    Found in blocks/block_contact_form_map.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 using static access to class '\XoopsModules\Contact\Helper' in method 'contactGetElements'.
    Open

        $helper = Contact\Helper::getInstance();
    Severity: Minor
    Found in blocks/block_contact_form_map.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

    There are no issues that match your filters.

    Category
    Status