Define a constant instead of duplicating this literal "description" 6 times. Open
'description' => 'Show information about logged user in footer',
- 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 "\App\Validator::bool" 5 times. Open
'validation' => '\App\Validator::bool',
- 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" 6 times. Open
'default' => false,
- 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 "\App\Purifier::bool" 5 times. Open
'sanitization' => '\App\Purifier::bool'
- 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" 6 times. Open
'validation' => '\App\Validator::bool',
- 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 "sanitization" 5 times. Open
'sanitization' => '\App\Purifier::bool'
- 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
'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
'default' => false,
- 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
'description' => 'Show role name',
- 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
'FAVORITE_OWNERS' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => false,
- 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
'USER_NAME_IS_EDITABLE' => [
- 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
'pwnedPasswordProvider' => [
- 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
'CHECK_LAST_USERNAME' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Show information about logged user in footer',
- 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' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SHOW_ROLE_NAME' => [
- 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
'sanitization' => '\App\Purifier::bool'
- 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
'default' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Activation of favorite owners',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 'YetiForce',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Provider to the check password is in the stolen passwords database',
- 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::text',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Is it possible to edit usernames?',
- 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' => 'Verify previously used usernames',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'IS_VISIBLE_USER_INFO_FOOTER' => [
- 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' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks