Define a constant instead of duplicating this literal "WebservicePremium" 3 times. Open
'WebserviceStandard', 'WebservicePremium', 'ManageConsents', 'SMS',
- 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 "WebserviceStandard" 3 times. Open
'WebserviceStandard', 'WebservicePremium', 'ManageConsents', 'SMS',
- 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 "ManageConsents" 3 times. Open
'WebserviceStandard', 'WebservicePremium', 'ManageConsents', 'SMS',
- 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
/** @var string[] List of GUI tabs */
- 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 static $listTables = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'WebserviceStandard', 'WebservicePremium', 'ManageConsents', 'SMS',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'user' => 'w_#__api_user',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string[] List of available API containers */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'WebserviceStandard', 'WebservicePremium', 'ManageConsents', 'SMS',
- 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
'user' => 'w_#__manage_consents_user',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array List of db tables */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static $listTab = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SMS' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'loginHistory' => 'l_#__portal_login_history',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'user' => 'w_#__sms_user',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'loginHistory' => 'l_#__api_login_history',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ManageConsents' => [
- 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
'WebserviceStandard' => [
- 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 static $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
'session' => 'w_#__api_session',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'WebservicePremium' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'user' => 'w_#__portal_user',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'session' => 'w_#__portal_session',
- 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