Missing class import via use statement (line '54', column '22'). Open
$configData = (new \App\Db\Query())->select(['params'])->from('vtiger_links')->where(['linktype' => 'EDIT_VIEW_RECORD_COLLECTOR', 'linklabel' => $recordCollectorName])->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
Avoid using static access to class '\App\Language' in method 'getPageTitle'. Open
return \App\Language::translate($this->pageTitle, $moduleName) . ': ' . \App\Language::translate($instance->label, 'Other.RecordCollector');
- 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
Avoid using static access to class '\App\Language' in method 'getPageTitle'. Open
return \App\Language::translate($this->pageTitle, $moduleName) . ': ' . \App\Language::translate($instance->label, 'Other.RecordCollector');
- 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
Avoid using static access to class 'Settings_Vtiger_Field_Model' in method 'getFields'. Open
$fields[] = Settings_Vtiger_Field_Model::init($collectorInstance->moduleName, array_merge($defaultParams, $fieldParams));
- 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
Avoid using static access to class '\App\RecordCollector' in method 'getFields'. Open
$collectorInstance = \App\RecordCollector::getInstance("App\\RecordCollectors\\{$recordCollectorName}", 'Accounts');
- 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
Avoid using static access to class '\App\Json' in method 'getFields'. Open
$configData = $configData ? \App\Json::decode($configData) : [];
- 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
Call to undeclared method \Settings_RecordCollector_ConfigModal_View::getViewer
Open
$viewer = $this->getViewer($request);
- Exclude checks
Reference to undeclared property \Settings_RecordCollector_ConfigModal_View->modalIcon
Open
$this->modalIcon = $instance->icon;
- Exclude checks
Reference to instance property moduleName
from undeclared class \App\RecordCollectors\Base
Open
$fields[] = Settings_Vtiger_Field_Model::init($collectorInstance->moduleName, array_merge($defaultParams, $fieldParams));
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$configData = (new \App\Db\Query())->select(['params'])->from('vtiger_links')->where(['linktype' => 'EDIT_VIEW_RECORD_COLLECTOR', 'linklabel' => $recordCollectorName])->scalar();
- Exclude checks
Reference to instance property settingsFields
from undeclared class \App\RecordCollectors\Base
Open
foreach ($collectorInstance->settingsFields as $fieldName => $fieldParams) {
- Exclude checks
Avoid excessively long class names like Settings_RecordCollector_ConfigModal_View. Keep class name length under 40. Open
class Settings_RecordCollector_ConfigModal_View extends \App\Controller\ModalSettings
{
/** {@inheritdoc} */
protected $pageTitle = 'LBL_EDIT';
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}
Source https://phpmd.org/rules/naming.html#longclassname
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_RecordCollector_ConfigModal_View extends \App\Controller\ModalSettings
- Exclude checks
The class Settings_RecordCollector_ConfigModal_View is not named in CamelCase. Open
class Settings_RecordCollector_ConfigModal_View extends \App\Controller\ModalSettings
{
/** {@inheritdoc} */
protected $pageTitle = 'LBL_EDIT';
- 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
Spaces must be used to indent lines; tabs are not allowed Open
$this->modalIcon = $instance->icon;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams['name'] = $fieldName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($collectorInstance->settingsFields as $fieldName => $fieldParams) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $pageTitle = 'LBL_EDIT';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $recordCollectorName
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
$collectorInstance = \App\RecordCollector::getInstance("App\\RecordCollectors\\{$recordCollectorName}", 'Accounts');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer = $this->getViewer($request);
- Exclude checks
Line exceeds 120 characters; contains 148 characters Open
return \App\Language::translate($this->pageTitle, $moduleName) . ': ' . \App\Language::translate($instance->label, 'Other.RecordCollector');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function fetching fields from Record Collector and making Field Instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$collectorInstance = \App\RecordCollector::getInstance("App\\RecordCollectors\\{$recordCollectorName}", 'Accounts');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function process(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$qualifiedModuleName = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fields = [];
- Exclude checks
Line exceeds 120 characters; contains 174 characters Open
$defaultParams = ['uitype' => 1, 'value' => '', 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => '', 'isEditableReadOnly' => false, 'maximumlength' => '255'];
- Exclude checks
Line exceeds 120 characters; contains 186 characters Open
$configData = (new \App\Db\Query())->select(['params'])->from('vtiger_links')->where(['linktype' => 'EDIT_VIEW_RECORD_COLLECTOR', 'linklabel' => $recordCollectorName])->scalar();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$defaultParams = ['uitype' => 1, 'value' => '', 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => '', 'isEditableReadOnly' => false, 'maximumlength' => '255'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->view('ConfigModal.tpl', $qualifiedModuleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private function getFields(string $recordCollectorName): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordCollectorName = $request->getByType('recordCollectorName');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('FIELDS', $this->getFields($request->getByType('recordCollectorName')));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getPageTitle(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$configData = (new \App\Db\Query())->select(['params'])->from('vtiger_links')->where(['linktype' => 'EDIT_VIEW_RECORD_COLLECTOR', 'linklabel' => $recordCollectorName])->scalar();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams['column'] = $fieldName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance = Settings_RecordCollector_Module_Model::getInstance($moduleName)->getCollectors()[$recordCollectorName];
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
$instance = Settings_RecordCollector_Module_Model::getInstance($moduleName)->getCollectors()[$recordCollectorName];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\array_key_exists($fieldName, $configData)) {
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
$fields[] = Settings_Vtiger_Field_Model::init($collectorInstance->moduleName, array_merge($defaultParams, $fieldParams));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Language::translate($this->pageTitle, $moduleName) . ': ' . \App\Language::translate($instance->label, 'Other.RecordCollector');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fields[] = Settings_Vtiger_Field_Model::init($collectorInstance->moduleName, array_merge($defaultParams, $fieldParams));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $fields;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$configData = $configData ? \App\Json::decode($configData) : [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams['fieldvalue'] = $configData[$fieldName];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Class name "Settings_RecordCollector_ConfigModal_View" is not in camel caps format Open
class Settings_RecordCollector_ConfigModal_View extends \App\Controller\ModalSettings
- Exclude checks