YetiForceCompany/YetiForceCRM

View on GitHub
vtlib/Vtiger/Menu.php

Summary

Maintainability
A
0 mins
Test Coverage
F
27%

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

        $id = (new \App\Db\Query())->select(['id'])->from('yetiforce_menu')->where(['module' => $moduleInstance->id])->scalar();
Severity: Minor
Found in vtlib/Vtiger/Menu.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 '27').
Open

            $menuRecordModel = new \Settings_Menu_Record_Model();
Severity: Minor
Found in vtlib/Vtiger/Menu.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

Call to undeclared method \App\Db\Query::select
Open

        $id = (new \App\Db\Query())->select(['id'])->from('yetiforce_menu')->where(['module' => $moduleInstance->id])->scalar();
Severity: Critical
Found in vtlib/Vtiger/Menu.php by phan

Reference to undeclared constant \visible (Did you mean $this->visible)
Open

        $this->visible = $valuemap[visible];
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phan

Reference to undeclared constant \sequence (Did you mean $this->sequence)
Open

        $this->sequence = $valuemap[sequence];
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phan

Call to undeclared method \App\Db::createCommand
Open

            \App\Db::getInstance()->createCommand()->delete('yetiforce_menu', ['module' => $moduleInstance->id])->execute();
Severity: Critical
Found in vtlib/Vtiger/Menu.php by phan

Reference to undeclared constant \parenttabid
Open

        $this->id = $valuemap[parenttabid];
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phan

Saw possibly unextractable annotation for a fragment of comment '* @param array Map': after array, did not see an element name (will guess based on comment order)
Open

     * @param array Map
Severity: Info
Found in vtlib/Vtiger/Menu.php by phan

Reference to undeclared constant \parenttab_label
Open

        $this->label = $valuemap[parenttab_label];
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phan

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

    public $id = false;
Severity: Minor
Found in vtlib/Vtiger/Menu.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

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

        $id = (new \App\Db\Query())->select(['id'])->from('yetiforce_menu')->where(['module' => $moduleInstance->id])->scalar();
Severity: Minor
Found in vtlib/Vtiger/Menu.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

     *
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

     * Initialize this instance.
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

            $menuRecordModel = new \Settings_Menu_Record_Model();
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

        $id = (new \App\Db\Query())->select(['id'])->from('yetiforce_menu')->where(['module' => $moduleInstance->id])->scalar();
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    /**
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

     * @param ModuleBasic $moduleInstance
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

Line exceeds 120 characters; contains 128 characters
Open

        $id = (new \App\Db\Query())->select(['id'])->from('yetiforce_menu')->where(['module' => $moduleInstance->id])->scalar();
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    /**
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

     * @param array Map
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

Line exceeds 120 characters; contains 124 characters
Open

            \App\Db::getInstance()->createCommand()->delete('yetiforce_menu', ['module' => $moduleInstance->id])->execute();
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

        $this->id = $valuemap[parenttabid];
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    public $id = false;
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    public $sequence = false;
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    public $label = false;
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

     * @param mixed $valuemap
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    public function initialize($valuemap)
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

        $this->label = $valuemap[parenttab_label];
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

     * Delete all menus associated with module.
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

            $menuRecordModel->refreshMenuFiles();
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    /** ID of this menu instance */
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

        $this->visible = $valuemap[visible];
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    public $visible = 0;
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

        $this->sequence = $valuemap[sequence];
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

     */
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

        if ($id) {
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

            \App\Db::getInstance()->createCommand()->delete('yetiforce_menu', ['module' => $moduleInstance->id])->execute();
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

     */
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

    public static function deleteForModule(ModuleBasic $moduleInstance)
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Menu.php by phpcodesniffer

There are no issues that match your filters.

Category
Status