Define a constant instead of duplicating this literal "maximumlength" 4 times. Open
'url' => ['required' => 1, 'purifyType' => \App\Purifier::URL, 'label' => 'FL_URL', 'maximumlength' => '255'],
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "purifyType" 4 times. Open
'url' => ['required' => 1, 'purifyType' => \App\Purifier::URL, 'label' => 'FL_URL', 'maximumlength' => '255'],
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "label" 4 times. Open
'url' => ['required' => 1, 'purifyType' => \App\Purifier::URL, 'label' => 'FL_URL', 'maximumlength' => '255'],
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "required" 4 times. Open
'url' => ['required' => 1, 'purifyType' => \App\Purifier::URL, 'label' => 'FL_URL', 'maximumlength' => '255'],
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_MeetingServices_Module_Model extends Settings_Vtiger_Module_Model
- Exclude checks
The class Settings_MeetingServices_Module_Model is not named in CamelCase. Open
class Settings_MeetingServices_Module_Model extends Settings_Vtiger_Module_Model
{
/** {@inheritdoc} */
public $name = 'MeetingServices';
- 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
public $baseTable = \App\MeetingService::TABLE_NAME;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $listFields = [
- 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
/** {@inheritdoc} */
- 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
'url' => ['required' => 1, 'purifyType' => \App\Purifier::URL, 'label' => 'FL_URL', 'maximumlength' => '255'],
- 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 array
- 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
Line exceeds 120 characters; contains 146 characters Open
'secret' => ['required' => 1, 'default' => '', 'purifyType' => \APP\Purifier::TEXT, 'label' => 'FL_SECRET_KEY', 'maximumlength' => '100'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'url' => 'FL_URL',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'status' => 'FL_STATUS',
- 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
* Return list fields in form.
- 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
public static $formFields = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'secret' => ['required' => 1, 'default' => '', 'purifyType' => \APP\Purifier::TEXT, 'label' => 'FL_SECRET_KEY', 'maximumlength' => '100'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Field form array.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'key' => ['required' => 1, 'default' => '', 'purifyType' => \APP\Purifier::TEXT, 'label' => 'FL_APP_ID', 'maximumlength' => '64'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return "index.php?parent=Settings&module={$this->getName()}&view=Edit";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFormFields(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getCreateRecordUrl()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $baseIndex = 'id';
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
'key' => ['required' => 1, 'default' => '', 'purifyType' => \APP\Purifier::TEXT, 'label' => 'FL_APP_ID', 'maximumlength' => '64'],
- 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
public $name = 'MeetingServices';
- 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
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getDefaultUrl()
- Exclude checks
Line exceeds 120 characters; contains 123 characters Open
'status' => ['required' => 0, 'purifyType' => \App\Purifier::BOOL, 'label' => 'FL_STATUS', 'maximumlength' => '2'],
- 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
'status' => ['required' => 0, 'purifyType' => \App\Purifier::BOOL, 'label' => 'FL_STATUS', 'maximumlength' => '2'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return static::$formFields;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return "index.php?parent=Settings&module={$this->getName()}&view=List";
- 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
Class name "Settings_MeetingServices_Module_Model" is not in camel caps format Open
class Settings_MeetingServices_Module_Model extends Settings_Vtiger_Module_Model
- Exclude checks