modules/Vtiger/CRMEntity.php
Avoid using static access to class 'vtlib\Deprecated' in method '__construct'. Open
Open
$this->column_fields = vtlib\Deprecated::getColumnFields(static::class);
- Read upRead up
- Exclude checks
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
Open
class Vtiger_CRMEntity extends CRMEntity
- Exclude checks
The class Vtiger_CRMEntity is not named in CamelCase. Open
Open
class Vtiger_CRMEntity extends CRMEntity
{
public $db; // Used in class functions of CRMEntity
public $column_fields = [];
- Read upRead up
- Exclude checks
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
Open
class Vtiger_CRMEntity extends CRMEntity
{
public $db; // Used in class functions of CRMEntity
public $column_fields = [];
- Read upRead up
- Exclude checks
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
Open
class Vtiger_CRMEntity extends CRMEntity
{
public $db; // Used in class functions of CRMEntity
public $column_fields = [];
- Read upRead up
- Exclude checks
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
Open
public $db; // Used in class functions of CRMEntity
- Read upRead up
- Exclude checks
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
Open
/** Indicator if this is a custom module or standard module */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->column_fields = vtlib\Deprecated::getColumnFields(static::class);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function __construct()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $column_fields = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $special_functions = ['set_import_assigned_user'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $IsCustomModule = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $db; // Used in class functions of CRMEntity
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
// Callback function list during Importing
- Exclude checks
Class name "Vtiger_CRMEntity" is not in camel caps format Open
Open
class Vtiger_CRMEntity extends CRMEntity
- Exclude checks