XoopsModules25x/xoopspoll

View on GitHub
class/plugin/userlog.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class 'XoopsRequest' in method 'item'.
Open

        $poll_id = XoopsRequest::getInt('poll_id', 0);
Severity: Minor
Found in class/plugin/userlog.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

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

class Userlog extends \Userlog_Module_Plugin_Abstract implements \UserlogPluginInterface
Severity: Minor
Found in class/plugin/userlog.php by phpcodesniffer

The parameter $subscribe_from is not named in camelCase.
Open

    public function item(string $subscribe_from)
    {
        xoops_load('XoopsRequest');
        $poll_id = XoopsRequest::getInt('poll_id', 0);
        switch ($subscribe_from) {
Severity: Minor
Found in class/plugin/userlog.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

The variable $poll_id is not named in camelCase.
Open

    public function item(string $subscribe_from)
    {
        xoops_load('XoopsRequest');
        $poll_id = XoopsRequest::getInt('poll_id', 0);
        switch ($subscribe_from) {
Severity: Minor
Found in class/plugin/userlog.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 $poll_id is not named in camelCase.
Open

    public function item(string $subscribe_from)
    {
        xoops_load('XoopsRequest');
        $poll_id = XoopsRequest::getInt('poll_id', 0);
        switch ($subscribe_from) {
Severity: Minor
Found in class/plugin/userlog.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 $subscribe_from is not named in camelCase.
Open

    public function item(string $subscribe_from)
    {
        xoops_load('XoopsRequest');
        $poll_id = XoopsRequest::getInt('poll_id', 0);
        switch ($subscribe_from) {
Severity: Minor
Found in class/plugin/userlog.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