YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/CRMEntity.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class 'vtlib\Deprecated' in method '__construct'.
Open

        $this->column_fields = vtlib\Deprecated::getColumnFields(static::class);
Severity: Minor
Found in modules/Vtiger/CRMEntity.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 Vtiger_CRMEntity extends CRMEntity
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

The class Vtiger_CRMEntity is not named in CamelCase.
Open

class Vtiger_CRMEntity extends CRMEntity
{
    public $db; // Used in class functions of CRMEntity
    public $column_fields = [];

Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

The property $column_fields is not named in camelCase.
Open

class Vtiger_CRMEntity extends CRMEntity
{
    public $db; // Used in class functions of CRMEntity
    public $column_fields = [];

Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpmd

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

class Vtiger_CRMEntity extends CRMEntity
{
    public $db; // Used in class functions of CRMEntity
    public $column_fields = [];

Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

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

    public $db; // Used in class functions of CRMEntity
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpmd

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

Spaces must be used to indent lines; tabs are not allowed
Open

    /** Indicator if this is a custom module or standard module */
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->column_fields = vtlib\Deprecated::getColumnFields(static::class);
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function __construct()
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $column_fields = [];
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $special_functions = ['set_import_assigned_user'];
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $IsCustomModule = true;
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $db; // Used in class functions of CRMEntity
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    // Callback function list during Importing
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

Class name "Vtiger_CRMEntity" is not in camel caps format
Open

class Vtiger_CRMEntity extends CRMEntity
Severity: Minor
Found in modules/Vtiger/CRMEntity.php by phpcodesniffer

There are no issues that match your filters.

Category
Status