modules/OSSSoldServices/ConfigTemplate.php
Define a constant instead of duplicating this literal "description" 4 times. Open
Open
'description' => 'How long before the renewal date should the status be changed. Ex. 2 month, 1 day https://secure.php.net/manual/en/datetime.formats.php',
- 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" 4 times. Open
Open
'default' => '2 month',
- 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
'default' => '2 month',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'default' => ['relationField' => 'parent_id', 'module' => 'Accounts', 'relatedModule' => ['FInvoice', 'ModComments', 'Calendar', 'Documents']],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'description' => 'Show relations in the modal'
- 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
'RENEWAL_TIME' => [
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
Open
'default' => ['relationField' => 'parent_id', 'module' => 'Accounts', 'relatedModule' => ['FInvoice', 'ModComments', 'Calendar', 'Documents']],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'description' => 'How long before the renewal date should the status be changed. Ex. 2 month, 1 day https://secure.php.net/manual/en/datetime.formats.php',
- Exclude checks
Line exceeds 120 characters; contains 163 characters Open
Open
'description' => 'How long before the renewal date should the status be changed. Ex. 2 month, 1 day https://secure.php.net/manual/en/datetime.formats.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'type' => '["class" => "", "method" => "", "hierarchy" => ""]',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'validation' => '\App\Validator::standard'
- 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
'SHOW_RELATION_IN_MODAL' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'type' => 'false, [] - inherit fields, [ label => column name, .. ]',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'description' => 'Show hierarchy in modal'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'default' => [],
- 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
'SHOW_HIERARCHY_IN_MODAL' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'RENEWAL_CUSTOMER_FUNCTION' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'default' => [],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'description' => 'Renewing the customer function'
- Exclude checks