Define a constant instead of duplicating this literal "sanitization" 4 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 "\App\Purifier::bool" 4 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 "description" 9 times. Open
'description' => 'Number of recent chat entries',
- 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' => 20,
- 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::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" 9 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 "\App\Validator::bool" 4 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.
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 20,
- 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 recent chat entries',
- 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
'REFRESH_ROOM_TIME' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 100000,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Default sound notification.',
- 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' => 'True - user rooms can be pinned/unpinned, false - all user rooms are pinned.',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 2000,
- 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' => 'What time to update the new message, number of milliseconds. Default: 2000',
- 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
'userRoomPin' => [
- 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
'sanitization' => '\App\Purifier::bool'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'dynamicAddingRooms' => [
- 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
'validation' => '\App\Validator::bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'REFRESH_TIME_GLOBAL' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'DEFAULT_SOUND_NOTIFICATION' => [
- 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
'sanitization' => '\App\Purifier::bool'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'What time to update the rooms, number of milliseconds. Default: 10000',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Show the number of new messages.',
- 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
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SHOW_NUMBER_OF_NEW_MESSAGES' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'CHAT_ROWS_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' => '\App\Validator::naturalNumber'
- Exclude checks
Line exceeds 120 characters; contains 238 characters Open
'description' => 'The maximum length of the message, If you want to increase the number of characters, you must also change it in the database (u_yf_chat_messages_crm, u_yf_chat_messages_group, u_yf_chat_messages_global, etc.,).',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Refresh time for global timer.',
- 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
'default' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Show add button in left panel favorites rooms.',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 2000,
- 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' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'REFRESH_MESSAGE_TIME' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'MAX_LENGTH_MESSAGE' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'The maximum length of the message, If you want to increase the number of characters, you must also change it in the database (u_yf_chat_messages_crm, u_yf_chat_messages_group, u_yf_chat_messages_global, etc.,).',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 5000,
- 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
],
- Exclude checks