Method getFields
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getFields(string $moduleName): array
{
$config = App\Config::module('MailIntegration', null, []);
$outlookUrls = $config['outlookUrls'] ?? [];
$fields = [
Avoid using static access to class 'App\Config' in method 'getFields'. Open
$config = App\Config::module('MailIntegration', null, []);
- 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\Module' in method 'getFields'. Open
'picklistValues' => \App\Module::getAllModuleNamesFilter(true, false, 0),
- 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 '\Vtiger_Field_Model' in method 'getFields'. Open
$fields[$key] = \Vtiger_Field_Model::init($moduleName, $value, $key);
- 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 excessively long class names like Settings_MailIntegration_ConfigForm_Model. Keep class name length under 40. Open
class Settings_MailIntegration_ConfigForm_Model
{
/**
* Get fields for config form.
*
- 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_MailIntegration_ConfigForm_Model
- Exclude checks
The class Settings_MailIntegration_ConfigForm_Model is not named in CamelCase. Open
class Settings_MailIntegration_ConfigForm_Model
{
/**
* Get fields for config form.
*
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$config = App\Config::module('MailIntegration', null, []);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'isArray' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'fieldvalue' => $config['modulesListQuickCreate'] ?? ''
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'labelDescArgs' => 'https://outlook.live.com, https://outlook.office365.com, https://outlook.office.com',
- 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
'purifyType' => 'Alnum',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($fields as $key => $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getFields(string $moduleName): array
- 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
* Get fields for config form.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'labelDesc' => 'LBL_QUICK_CREATE_MODULES_DESC',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'picklistValues' => \App\Module::getAllModuleNamesFilter(true, false, 0),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'fieldvalue' => $outlookUrls,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fields[$key] = \Vtiger_Field_Model::init($moduleName, $value, $key);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Field_Model[]
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
'labelDescArgs' => 'https://outlook.live.com, https://outlook.office365.com, https://outlook.office.com',
- 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
'modulesListQuickCreate' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'outlookUrls' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => 'LBL_OUTLOOK_ADDRESSES',
- 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
'isArray' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'uitype' => 33,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$outlookUrls = $config['outlookUrls'] ?? [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'uitype' => 33,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'labelDesc' => 'LBL_OUTLOOK_ADDRESSES_DESC',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fields = [
- 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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'purifyType' => 'url',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'dataSelect' => 'tags',
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => 'LBL_QUICK_CREATE_MODULES',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'picklistValues' => array_combine($outlookUrls, $outlookUrls),
- Exclude checks
Class name "Settings_MailIntegration_ConfigForm_Model" is not in camel caps format Open
class Settings_MailIntegration_ConfigForm_Model
- Exclude checks