YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/actions/List.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

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

            throw new \App\Exceptions\NotAllowedMethod('LBL_PERMISSION_DENIED', 406);
Severity: Minor
Found in modules/Vtiger/actions/List.php by phpmd

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

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

            throw new \App\Exceptions\Security('ERR_NO_ACCESS_TO_THE_FIELD', 403);
Severity: Minor
Found in modules/Vtiger/actions/List.php by phpmd

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

Missing class import via use statement (line '56', column '19').
Open

        $response = new Vtiger_Response();
Severity: Minor
Found in modules/Vtiger/actions/List.php by phpmd

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

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

            throw new \App\Exceptions\Security('LBL_NOT_SUPPORTED_FIELD', 406);
Severity: Minor
Found in modules/Vtiger/actions/List.php by phpmd

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

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

            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 403);
Severity: Minor
Found in modules/Vtiger/actions/List.php by phpmd

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

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

        } else {
            throw new \App\Exceptions\NotAllowedMethod('LBL_PERMISSION_DENIED', 406);
        }
Severity: Minor
Found in modules/Vtiger/actions/List.php by phpmd

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

Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

            $value = $queryGenerator->createQuery()->sum($columnName);
Severity: Critical
Found in modules/Vtiger/actions/List.php by phan

Argument 1 (mixed) is string but \Users_Privileges_Model::hasModulePermission() takes int defined at /code/modules/Users/models/Privileges.php:101
Open

        if (!Users_Privileges_Model::getCurrentUserPrivilegesModel()->hasModulePermission($request->getModule())) {
Severity: Minor
Found in modules/Vtiger/actions/List.php by phan

Call to method getQueryField from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

        $fieldQueryModel = $queryGenerator->getQueryField($request->getByType('fieldName', 2));
Severity: Critical
Found in modules/Vtiger/actions/List.php by phan

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

class Vtiger_List_Action extends Vtiger_Mass_Action

The class Vtiger_List_Action is not named in CamelCase.
Open

class Vtiger_List_Action extends Vtiger_Mass_Action
{
    use \App\Controller\ExposeMethod;

    /** {@inheritdoc} */
Severity: Minor
Found in modules/Vtiger/actions/List.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

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

    {

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

        if (!Users_Privileges_Model::getCurrentUserPrivilegesModel()->hasModulePermission($request->getModule())) {

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

        $fieldModel = $fieldQueryModel->getField();

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

     * @throws \App\Exceptions\NoPermittedToRecord

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

        $response = new Vtiger_Response();

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

    }

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

            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 403);

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

     */

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

        $queryGenerator = self::getQuery($request);

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

     *

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

        if ('sum' === $request->getByType('calculateType')) {

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

        $response->emit();

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

            $value = $queryGenerator->createQuery()->sum($columnName);

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

    {

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

    public function checkPermission(App\Request $request)

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

     * Function for calculating values for a list of records.

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

    public function __construct()

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

        }

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

        $response->setResult($fieldModel->getDisplayValue($value));

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

        $fieldQueryModel = $queryGenerator->getQueryField($request->getByType('fieldName', 2));

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

    use \App\Controller\ExposeMethod;

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_NO_ACCESS_TO_THE_FIELD', 403);

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

        }

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

        parent::__construct();

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

        $columnName = $fieldQueryModel->getColumnName();

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

    }

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

        $this->exposeMethod('calculate');

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

     * @throws \App\Exceptions\Security

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

        if (!$fieldModel->isViewable()) {

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

        if (!$fieldModel->isCalculateField()) {

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

            throw new \App\Exceptions\NotAllowedMethod('LBL_PERMISSION_DENIED', 406);

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

    public function calculate(App\Request $request)

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

            throw new \App\Exceptions\Security('LBL_NOT_SUPPORTED_FIELD', 406);

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

        } else {

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

     * @param \App\Request $request

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

class Vtiger_List_Action extends Vtiger_Mass_Action

There are no issues that match your filters.

Category
Status