mambax7/gbook

View on GitHub
include/oninstall.php

Summary

Maintainability
A
0 mins
Test Coverage

xoops_module_pre_install_gbook accesses the super-global variable $GLOBALS.
Open

function xoops_module_pre_install_gbook(\XoopsModule $module)
{
    $utility = new Gbook\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_gbook accesses the super-global variable $GLOBALS.
Open

function xoops_module_pre_install_gbook(\XoopsModule $module)
{
    $utility = new Gbook\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 parameters such as '$module'.
Open

function xoops_module_install_gbook(\XoopsModule $module)
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

The variable $mod_tables is not named in camelCase.
Open

function xoops_module_pre_install_gbook(\XoopsModule $module)
{
    $utility = new Gbook\Utility();

    //check for minimum XOOPS version
Severity: Minor
Found in include/oninstall.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 $mod_tables is not named in camelCase.
Open

function xoops_module_pre_install_gbook(\XoopsModule $module)
{
    $utility = new Gbook\Utility();

    //check for minimum XOOPS version
Severity: Minor
Found in include/oninstall.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