YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/inventoryfields/ItemNumber.php

Summary

Maintainability
A
0 mins
Test Coverage
F
57%

Missing class import via use statement (line '30', column '14').
Open

            throw new \App\Exceptions\Security('ERR_ILLEGAL_FIELD_VALUE||' . $columnName . '||' . $this->getModuleName() . '||' . $value, 406);

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

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

class Vtiger_ItemNumber_InventoryField extends Vtiger_Basic_InventoryField

The class Vtiger_ItemNumber_InventoryField is not named in CamelCase.
Open

class Vtiger_ItemNumber_InventoryField extends Vtiger_Basic_InventoryField
{
    protected $type = 'ItemNumber';
    protected $defaultLabel = 'LBL_ITEM_NUMBER';
    protected $columnName = 'seq';

CamelCaseClassName

Since: 0.2

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

Example

class class_name {
}

Source

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

    }

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

        }

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

    }

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

    protected $columnName = 'seq';

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

        return (int) $value;

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

    public function getDBValue($value, ?string $name = '')

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

    public function validate($value, string $columnName, bool $isUserFormat, $originalValue = null)

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

    {

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

    {

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

    protected $type = 'ItemNumber';

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

    protected $defaultLabel = 'LBL_ITEM_NUMBER';

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

        if ($value && (!is_numeric($value) || (string) $value !== (string) filter_var($value, FILTER_VALIDATE_INT))) {

Line exceeds 120 characters; contains 143 characters
Open

            throw new \App\Exceptions\Security('ERR_ILLEGAL_FIELD_VALUE||' . $columnName . '||' . $this->getModuleName() . '||' . $value, 406);

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

    /** {@inheritdoc} */

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

    protected $purifyType = \App\Purifier::INTEGER;

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

    /** {@inheritdoc} */

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

            throw new \App\Exceptions\Security('ERR_ILLEGAL_FIELD_VALUE||' . $columnName . '||' . $this->getModuleName() . '||' . $value, 406);

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

class Vtiger_ItemNumber_InventoryField extends Vtiger_Basic_InventoryField

There are no issues that match your filters.

Category
Status