Define a constant instead of duplicating this literal "\App\Validator::naturalNumber" 5 times. Open
'validation' => '\App\Validator::naturalNumber'
- 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 "validation" 8 times. Open
'validation' => function () {
- 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 "default" 9 times. Open
'default' => 'TimeLine',
- 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 "description" 9 times. Open
'description' => 'default view in History (Timeline/List)',
- 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.
Spaces must be used to indent lines; tabs are not allowed Open
'default' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 50,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'validation' => '\App\Validator::naturalNumber'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Number of records on one page',
- Exclude checks
Line exceeds 120 characters; contains 156 characters Open
'description' => 'Enable sending notifications for all actions available in changes history. Tracking requires enabling module or record tracking.',
- 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
'REVIEW_CHANGES_LIMIT' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 5,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'WATCHDOG' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Max number to update records',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 1000,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Max number to update records by cron',
- 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
'sanitization' => '\App\Purifier::bool'
- 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
'REVIEWED_SCHEDULE_LIMIT' => [
- 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
'validation' => function () {
- 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
'validation' => '\App\Validator::bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'DEFAULT_VIEW' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'UNREVIEWED_COUNT' => [
- 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
'default' => [],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'default view in History (Timeline/List)',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'sanitization' => '\App\Purifier::bool'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'validation' => '\App\Validator::naturalNumber',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 50,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \in_array($arg, ['Timeline', 'List']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 100,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Maximum length of text, only applies to text fields',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 'TimeLine',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => true,
- 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
'TIMELINE_IN_LISTVIEW_LIMIT' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SHOW_TIMELINE_IN_LISTVIEW' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arg = func_get_arg(0);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Displays the number of unreviewed changes in record.',
- 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
'description' => 'Show timeline in list view [module name, ...]'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'validation' => '\App\Validator::naturalNumber'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'validation' => '\App\Validator::bool',
- 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
'TEASER_TEXT_LENGTH' => [
- 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
'validation' => '\App\Validator::naturalNumber'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Limit of records displayed in timeline popup',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'validation' => '\App\Validator::naturalNumber'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'NUMBER_RECORDS_ON_PAGE' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Enable sending notifications for all actions available in changes history. Tracking requires enabling module or record tracking.',
- Exclude checks