XoopsModules25x/xoopsinfo

View on GitHub
phpsysinfo/includes/to/device/class.HWDevice.inc.php

Summary

Maintainability
A
0 mins
Test Coverage

The method equals uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            return false;
        }

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

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

class HWDevice

The property $_serial is not named in camelCase.
Open

class HWDevice
{
    /**
     * name of the device
     *

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $_manufacturer is not named in camelCase.
Open

class HWDevice
{
    /**
     * name of the device
     *

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $_product is not named in camelCase.
Open

class HWDevice
{
    /**
     * name of the device
     *

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $_name is not named in camelCase.
Open

class HWDevice
{
    /**
     * name of the device
     *

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $_capacity is not named in camelCase.
Open

class HWDevice
{
    /**
     * name of the device
     *

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $_count is not named in camelCase.
Open

class HWDevice
{
    /**
     * name of the device
     *

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

Property name "$_product" should not be prefixed with an underscore to indicate visibility
Open

    private $_product = null;

Property name "$_count" should not be prefixed with an underscore to indicate visibility
Open

    private $_count = 1;

Property name "$_capacity" should not be prefixed with an underscore to indicate visibility
Open

    private $_capacity = null;

Property name "$_serial" should not be prefixed with an underscore to indicate visibility
Open

    private $_serial = null;

Property name "$_manufacturer" should not be prefixed with an underscore to indicate visibility
Open

    private $_manufacturer = null;

Property name "$_name" should not be prefixed with an underscore to indicate visibility
Open

    private $_name = "";

Line exceeds 120 characters; contains 132 characters
Open

 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version

Line exceeds 120 characters; contains 132 characters
Open

 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version

There are no issues that match your filters.

Category
Status