mambax7/adslight

View on GitHub
blocks/maps.php

Summary

Maintainability
A
0 mins
Test Coverage

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

    $helper = Helper::getInstance();
Severity: Minor
Found in blocks/maps.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 '$maps_name'.
Open

    $maps_name = $xoopsConfig['language'];
Severity: Minor
Found in blocks/maps.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 '$options'.
Open

function adslight_maps_show($options)
Severity: Minor
Found in blocks/maps.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 '$myts'.
Open

    $myts      = \MyTextSanitizer::getInstance();
Severity: Minor
Found in blocks/maps.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\Adslight\Helper' in method 'adslight_maps_show'.
Open

    $helper = Helper::getInstance();
Severity: Minor
Found in blocks/maps.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 'adslight_maps_show'.
Open

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

Line exceeds 120 characters; contains 167 characters
Open

    $form .= '&nbsp;' . constant("{$block_lang}_DISP") . "&nbsp;<input type='text' name='options[]' value='{$options[1]}'>&nbsp;" . constant("{$block_lang}_LISTINGS");
Severity: Minor
Found in blocks/maps.php by phpcodesniffer

Line exceeds 120 characters; contains 279 characters
Open

    $block['imgmapsurl'] = '<a title="Recherche dans votre region" href="' . XOOPS_URL . '/modules/adslight/maps.php"><img src="' . XOOPS_URL . '/modules/adslight/maps/' . $xoopsConfig['language'] . '/assets/images/map.png" alt="Recherche dans votre region" border="0"></a><br>';
Severity: Minor
Found in blocks/maps.php by phpcodesniffer

Line exceeds 120 characters; contains 187 characters
Open

    $form .= '&nbsp;<br><br>' . constant("{$block_lang}_CHARS") . "&nbsp;<input type='text' name='options[]' value='{$options[2]}'>&nbsp;" . constant("{$block_lang}_LENGTH") . '<br><br>';
Severity: Minor
Found in blocks/maps.php by phpcodesniffer

Line exceeds 120 characters; contains 134 characters
Open

    $block['add']  = '<a href="' . XOOPS_URL . "/modules/{$moduleDirName}/\"><b>" . constant("{$block_lang}_ADDNOW") . '</b></a><br>';
Severity: Minor
Found in blocks/maps.php by phpcodesniffer

Line exceeds 120 characters; contains 140 characters
Open

    $block['link'] = '<a href="' . XOOPS_URL . "/modules/{$moduleDirName}/\"><b>" . constant("{$block_lang}_ALL_LISTINGS") . '</b></a><br>';
Severity: Minor
Found in blocks/maps.php by phpcodesniffer

The variable $maps_name is not named in camelCase.
Open

function adslight_maps_show($options)
{
    if (!class_exists(Helper::class)) {
        return [];
    }
Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_show($options)
{
    if (!class_exists(Helper::class)) {
        return [];
    }
Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_edit($options): string
{
    $moduleDirName = \basename(\dirname(__DIR__));
    $block_lang    = '_MB_' . mb_strtoupper($moduleDirName);

Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_show($options)
{
    if (!class_exists(Helper::class)) {
        return [];
    }
Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_edit($options): string
{
    $moduleDirName = \basename(\dirname(__DIR__));
    $block_lang    = '_MB_' . mb_strtoupper($moduleDirName);

Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_show($options)
{
    if (!class_exists(Helper::class)) {
        return [];
    }
Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_edit($options): string
{
    $moduleDirName = \basename(\dirname(__DIR__));
    $block_lang    = '_MB_' . mb_strtoupper($moduleDirName);

Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_edit($options): string
{
    $moduleDirName = \basename(\dirname(__DIR__));
    $block_lang    = '_MB_' . mb_strtoupper($moduleDirName);

Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_show($options)
{
    if (!class_exists(Helper::class)) {
        return [];
    }
Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_edit($options): string
{
    $moduleDirName = \basename(\dirname(__DIR__));
    $block_lang    = '_MB_' . mb_strtoupper($moduleDirName);

Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_show($options)
{
    if (!class_exists(Helper::class)) {
        return [];
    }
Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_edit($options): string
{
    $moduleDirName = \basename(\dirname(__DIR__));
    $block_lang    = '_MB_' . mb_strtoupper($moduleDirName);

Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_edit($options): string
{
    $moduleDirName = \basename(\dirname(__DIR__));
    $block_lang    = '_MB_' . mb_strtoupper($moduleDirName);

Severity: Minor
Found in blocks/maps.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_lang is not named in camelCase.
Open

function adslight_maps_edit($options): string
{
    $moduleDirName = \basename(\dirname(__DIR__));
    $block_lang    = '_MB_' . mb_strtoupper($moduleDirName);

Severity: Minor
Found in blocks/maps.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