vtlib/Vtiger/Menu.php
Missing class import via use statement (line '45', column '14'). Open
Open
$id = (new \App\Db\Query())->select(['id'])->from('yetiforce_menu')->where(['module' => $moduleInstance->id])->scalar();
- Read upRead up
- Exclude checks
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
Open
$menuRecordModel = new \Settings_Menu_Record_Model();
- Read upRead up
- Exclude checks
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
Open
$id = (new \App\Db\Query())->select(['id'])->from('yetiforce_menu')->where(['module' => $moduleInstance->id])->scalar();
- Exclude checks
Reference to undeclared constant \visible
(Did you mean $this->visible) Open
Open
$this->visible = $valuemap[visible];
- Exclude checks
Reference to undeclared constant \sequence
(Did you mean $this->sequence) Open
Open
$this->sequence = $valuemap[sequence];
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
Open
\App\Db::getInstance()->createCommand()->delete('yetiforce_menu', ['module' => $moduleInstance->id])->execute();
- Exclude checks
Reference to undeclared constant \parenttabid
Open
Open
$this->id = $valuemap[parenttabid];
- Exclude checks
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
Open
* @param array Map
- Exclude checks
Reference to undeclared constant \parenttab_label
Open
Open
$this->label = $valuemap[parenttab_label];
- Exclude checks
Avoid variables with short names like $id. Configured minimum length is 3. Open
Open
public $id = false;
- 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
Avoid variables with short names like $id. Configured minimum length is 3. Open
Open
$id = (new \App\Db\Query())->select(['id'])->from('yetiforce_menu')->where(['module' => $moduleInstance->id])->scalar();
- 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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Initialize this instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$menuRecordModel = new \Settings_Menu_Record_Model();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$id = (new \App\Db\Query())->select(['id'])->from('yetiforce_menu')->where(['module' => $moduleInstance->id])->scalar();
- 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
* @param ModuleBasic $moduleInstance
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
Open
$id = (new \App\Db\Query())->select(['id'])->from('yetiforce_menu')->where(['module' => $moduleInstance->id])->scalar();
- 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
* @param array Map
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
Open
\App\Db::getInstance()->createCommand()->delete('yetiforce_menu', ['module' => $moduleInstance->id])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->id = $valuemap[parenttabid];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $id = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $sequence = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $label = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param mixed $valuemap
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function initialize($valuemap)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->label = $valuemap[parenttab_label];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Delete all menus associated with module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$menuRecordModel->refreshMenuFiles();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** ID of this menu instance */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->visible = $valuemap[visible];
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $visible = 0;
- 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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->sequence = $valuemap[sequence];
- 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
if ($id) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
\App\Db::getInstance()->createCommand()->delete('yetiforce_menu', ['module' => $moduleInstance->id])->execute();
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public static function deleteForModule(ModuleBasic $moduleInstance)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks