mambax7/publisher

View on GitHub
class/Ratings.php

Summary

Maintainability
A
0 mins
Test Coverage

getNewInsertedIdRatings accesses the super-global variable $GLOBALS.
Open

    public function getNewInsertedIdRatings()
    {
        $newInsertedId = $GLOBALS['xoopsDB']->getInsertId();

        return $newInsertedId;
Severity: Minor
Found in class/Ratings.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 using static access to class '\XoopsUser' in method 'getValuesRatings'.
Open

        $ret['uid']      = \XoopsUser::getUnameFromId($this->getVar('rate_uid'));
Severity: Minor
Found in class/Ratings.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

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

<?php declare(strict_types=1);
Severity: Minor
Found in class/Ratings.php by phpcodesniffer

There are no issues that match your filters.

Category
Status