mambax7/adslight

View on GitHub
plugins/plugin_for_rssfit/rssfit.adslight.php

Summary

Maintainability
A
0 mins
Test Coverage

loadModule accesses the super-global variable $GLOBALS.
Open

    public function loadModule(): bool
    {
        $mod = &$GLOBALS['module_handler']->getByDirname($this->dirname);
        if (!$mod || !$mod->getVar('isactive')) {
            return false;

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 using static access to class '\MyTextSanitizer' in method 'grabEntries'.
Open

        $myts = \MyTextSanitizer::getInstance();

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 '$myts'.
Open

        $myts = \MyTextSanitizer::getInstance();

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 '$obj'.
Open

    public function &grabEntries($obj)

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

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class RssfitAdslight

Avoid variables with short names like $i. Configured minimum length is 3.
Open

        $i    = 0;

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

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

<?php declare(strict_types=1);

Line exceeds 120 characters; contains 167 characters
Open

        $sql    = 'SELECT lid, title, status, desctext, date_created from ' . $xoopsDB->prefix('adslight_listing') . " WHERE valid = 'Yes' ORDER BY date_created DESC";

There are no issues that match your filters.

Category
Status