XoopsModules25x/xoopspartners

View on GitHub
include/action.module.php

Summary

Maintainability
A
0 mins
Test Coverage

xoops_module_install_xoopspartners accesses the super-global variable $GLOBALS.
Open

function xoops_module_install_xoopspartners(\XoopsModule $module)
{
    $indexFile = $GLOBALS['xoops']->path('/modules/' . $module->dirname() . '/include/index.html');

    //Create the "uploads" directory for the module
Severity: Minor
Found in include/action.module.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_install_xoopspartners accesses the super-global variable $GLOBALS.
Open

function xoops_module_install_xoopspartners(\XoopsModule $module)
{
    $indexFile = $GLOBALS['xoops']->path('/modules/' . $module->dirname() . '/include/index.html');

    //Create the "uploads" directory for the module
Severity: Minor
Found in include/action.module.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_install_xoopspartners accesses the super-global variable $GLOBALS.
Open

function xoops_module_install_xoopspartners(\XoopsModule $module)
{
    $indexFile = $GLOBALS['xoops']->path('/modules/' . $module->dirname() . '/include/index.html');

    //Create the "uploads" directory for the module
Severity: Minor
Found in include/action.module.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

Missing class import via use statement (line '72', column '23').
Open

            throw new \RuntimeException(sprintf('Directory "%s" was not created', $module_uploads));
Severity: Minor
Found in include/action.module.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\Xoopspartners\Helper' in method 'xoops_module_pre_update_xoopspartners'.
Open

    $helper        = Helper::getInstance();
Severity: Minor
Found in include/action.module.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\Xoopspartners\Utility' in method 'xoops_module_pre_install_xoopspartners'.
Open

    if (!Utility::checkVerXoops($module)) {
Severity: Minor
Found in include/action.module.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\Xoopspartners\Utility' in method 'xoops_module_pre_install_xoopspartners'.
Open

    if (!Utility::checkVerPhp($module)) {
Severity: Minor
Found in include/action.module.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 include/action.module.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_pre_uninstall_xoopspartners(\XoopsModule $module)
Severity: Minor
Found in include/action.module.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 '$curr_version'.
Open

function xoops_module_update_xoopspartners(\XoopsModule $module, $curr_version = null)
Severity: Minor
Found in include/action.module.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 '$module'.
Open

function xoops_module_update_xoopspartners(\XoopsModule $module, $curr_version = null)
Severity: Minor
Found in include/action.module.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 '$module'.
Open

function xoops_module_uninstall_xoopspartners(\XoopsModule $module)
Severity: Minor
Found in include/action.module.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 '$helper'.
Open

    $helper        = Helper::getInstance();
Severity: Minor
Found in include/action.module.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

The parameter $curr_version is not named in camelCase.
Open

function xoops_module_update_xoopspartners(\XoopsModule $module, $curr_version = null)
{
    return true;
}
Severity: Minor
Found in include/action.module.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

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

<?php
Severity: Minor
Found in include/action.module.php by phpcodesniffer

The variable $module_uploads is not named in camelCase.
Open

function xoops_module_install_xoopspartners(\XoopsModule $module)
{
    $indexFile = $GLOBALS['xoops']->path('/modules/' . $module->dirname() . '/include/index.html');

    //Create the "uploads" directory for the module
Severity: Minor
Found in include/action.module.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_uploads is not named in camelCase.
Open

function xoops_module_install_xoopspartners(\XoopsModule $module)
{
    $indexFile = $GLOBALS['xoops']->path('/modules/' . $module->dirname() . '/include/index.html');

    //Create the "uploads" directory for the module
Severity: Minor
Found in include/action.module.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_uploads is not named in camelCase.
Open

function xoops_module_install_xoopspartners(\XoopsModule $module)
{
    $indexFile = $GLOBALS['xoops']->path('/modules/' . $module->dirname() . '/include/index.html');

    //Create the "uploads" directory for the module
Severity: Minor
Found in include/action.module.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_uploads is not named in camelCase.
Open

function xoops_module_install_xoopspartners(\XoopsModule $module)
{
    $indexFile = $GLOBALS['xoops']->path('/modules/' . $module->dirname() . '/include/index.html');

    //Create the "uploads" directory for the module
Severity: Minor
Found in include/action.module.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_uploads is not named in camelCase.
Open

function xoops_module_install_xoopspartners(\XoopsModule $module)
{
    $indexFile = $GLOBALS['xoops']->path('/modules/' . $module->dirname() . '/include/index.html');

    //Create the "uploads" directory for the module
Severity: Minor
Found in include/action.module.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_uploads is not named in camelCase.
Open

function xoops_module_install_xoopspartners(\XoopsModule $module)
{
    $indexFile = $GLOBALS['xoops']->path('/modules/' . $module->dirname() . '/include/index.html');

    //Create the "uploads" directory for the module
Severity: Minor
Found in include/action.module.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