XoopsModules25x/xoopsinfo

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

Summary

Maintainability
B
4 hrs
Test Coverage

UPSDevice has 32 functions (exceeds 20 allowed). Consider refactoring.
Open

class UPSDevice
{
    /**
     * name of the ups
     *
Severity: Minor
Found in phpsysinfo/includes/to/device/class.UPSDevice.inc.php - About 4 hrs to fix

    The class UPSDevice has 16 fields. Consider redesigning UPSDevice to keep the number of fields under 15.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    TooManyFields

    Since: 0.1

    Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

    Example

    class Person {
       protected $one;
       private $two;
       private $three;
       [... many more fields ...]
    }

    Source https://phpmd.org/rules/codesize.html#toomanyfields

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

    class UPSDevice

    The property $_status is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_lineVoltage is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_temperatur is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_load is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_batterCharge is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_mode is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_lastOutageFinish is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_model is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_startTime is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_batteryVoltage is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_timeLeft is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_outages is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_lastOutage is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_lineFrequency is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 $_batteryDate is not named in camelCase.
    Open

    class UPSDevice
    {
        /**
         * name of the ups
         *

    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 "$_model" should not be prefixed with an underscore to indicate visibility
    Open

        private $_model = "";

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

        private $_lastOutageFinish = null;

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

        private $_outages = null;

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

        private $_lineVoltage = null;

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

        private $_lineFrequency = null;

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

        private $_batteryDate = null;

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

        private $_batteryVoltage = null;

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

        private $_lastOutage = null;

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

        private $_startTime = "";

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

        private $_name = "";

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

        private $_mode = "";

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

        private $_temperatur = null;

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

        private $_timeLeft = null;

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

        private $_batterCharge = null;

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

        private $_status = "";

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

        private $_load = null;

    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