modules/Import/ConfigTemplate.php
Define a constant instead of duplicating this literal "description" 5 times. Open
Open
'description' => 'Threshold record limit for immediate import. If record count is more than this, then the import is scheduled through cron job'
- 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" 5 times. Open
Open
'default' => 1000,
- 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
Open
'IMMEDIATE_IMPORT_LIMIT' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'CREATE_REFERENCE_RECORD' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'default' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'default' => 1000,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'description' => 'Threshold record limit for immediate import. If record count is more than this, then the import is scheduled through cron job'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'description' => 'Individual batch limit - Specified number of records will be imported at one shot and the cycle will repeat till all records are imported'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'SAVE_BY_HANDLERS' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'ADD_PICKLIST_VALUE' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'description' => 'Missing picklist values are added'
- Exclude checks
Line exceeds 120 characters; contains 152 characters Open
Open
'description' => 'Threshold record limit for immediate import. If record count is more than this, then the import is scheduled through cron job'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'description' => 'Save record including handlers'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'BATCH_LIMIT' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'default' => false,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'description' => 'Records for reference fields modules are created while importing, when record is not found.'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'default' => false,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'default' => 250,
- Exclude checks
Line exceeds 120 characters; contains 164 characters Open
Open
'description' => 'Individual batch limit - Specified number of records will be imported at one shot and the cycle will repeat till all records are imported'
- Exclude checks