XoopsModules25x/tag

View on GitHub
include/oninstall.php

Summary

Maintainability
A
0 mins
Test Coverage

xoops_module_pre_install_tag accesses the super-global variable $GLOBALS.
Open

function xoops_module_pre_install_tag(\XoopsModule $module): bool
{
    $moduleDirName = \basename(\dirname(__DIR__));
    $utility       = new Tag\Utility();
    //check for minimum XOOPS version
Severity: Minor
Found in include/oninstall.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

xoops_module_pre_install_tag accesses the super-global variable $GLOBALS.
Open

function xoops_module_pre_install_tag(\XoopsModule $module): bool
{
    $moduleDirName = \basename(\dirname(__DIR__));
    $utility       = new Tag\Utility();
    //check for minimum XOOPS version
Severity: Minor
Found in include/oninstall.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

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

    $moduleDirName = \basename(\dirname(__DIR__));
Severity: Minor
Found in include/oninstall.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 parameters such as '$module'.
Open

function xoops_module_install_tag(\XoopsModule $module): bool
Severity: Minor
Found in include/oninstall.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

There are no issues that match your filters.

Category
Status