Define a constant instead of duplicating this literal "ProjectMilestone" 4 times. Open
'ProjectMilestone' => ['level' => 2, 'parentModule' => 'Project'],
- 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 "Vendors" 3 times. Open
'Vendors' => ['level' => 0],
- 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 "SSingleOrders" 3 times. Open
'SSingleOrders' => ['level' => 2, 'parentModule' => 'SSalesProcesses'],
- 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 "addresslevel5a" 4 times. Open
'addresslevel5a' => ['addresslevel5a'],
- 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 "salesprocessid" 7 times. Open
'salesprocessid' => ['SSalesProcesses' => ['accountid' => ['related_to']]],
- 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 "level" 23 times. Open
'Accounts' => ['level' => 0],
- 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 "addresslevel1a" 4 times. Open
'addresslevel1a' => ['addresslevel1a'],
- 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 "SSalesProcesses" 19 times. Open
'SSalesProcesses' => ['level' => 1],
- 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 "accountid" 18 times. Open
'salesprocessid' => ['SSalesProcesses' => ['accountid' => ['related_to']]],
- 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 "FBookkeeping" 3 times. Open
'FBookkeeping' => ['level' => 1],
- 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 "OSSEmployees" 4 times. Open
'OSSEmployees' => ['level' => 0],
- 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 "Leads" 7 times. Open
'Leads' => ['level' => 0],
- 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 "addresslevel7a" 4 times. Open
'addresslevel7a' => ['addresslevel7a'],
- 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 "Products" 3 times. Open
'pssold_id' => ['Assets' => ['product_id' => ['product', 'Products'], 'parent_id' => ['parent_id', 'Accounts']], 'OSSSoldServices' => ['product_id' => ['serviceid', 'Services']]],
- 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 "linktoaccountscontacts" 3 times. Open
'projectid' => ['Project' => ['parent_id' => ['linktoaccountscontacts']]],
- 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 "projectmilestoneid" 3 times. Open
'projectmilestoneid' => ['ProjectMilestone' => ['projectid' => ['projectid']]],
- 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 "ProjectTask" 4 times. Open
'ProjectTask' => ['level' => 3, 'parentModule' => 'ProjectMilestone'],
- 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 "related_to" 7 times. Open
'salesprocessid' => ['SSalesProcesses' => ['accountid' => ['related_to']]],
- 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 "FInvoice" 3 times. Open
'FInvoice' => ['level' => 2, 'parentModule' => 'FBookkeeping'],
- 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 "addresslevel8a" 4 times. Open
'addresslevel8a' => ['addresslevel8a'],
- 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 "Project" 10 times. Open
'Project' => ['level' => 1],
- 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 "crmid" 3 times. Open
'Documents' => ['table' => 'vtiger_senotesrel', 'rel' => 'crmid', 'base' => 'notesid'],
- 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 "addresslevel4a" 4 times. Open
'addresslevel4a' => ['addresslevel4a'],
- 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 "Assets" 3 times. Open
'pssold_id' => ['Assets' => ['product_id' => ['product', 'Products'], 'parent_id' => ['parent_id', 'Accounts']], 'OSSSoldServices' => ['product_id' => ['serviceid', 'Services']]],
- 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 "ServiceContracts" 5 times. Open
'ServiceContracts' => ['level' => 1],
- 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 "SQuotes" 5 times. Open
'SQuotes' => ['level' => 2, 'parentModule' => 'SSalesProcesses'],
- 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 "parentModule" 11 times. Open
'ProjectMilestone' => ['level' => 2, 'parentModule' => 'Project'],
- 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 "accountname" 3 times. Open
'accountid' => ['Accounts' => ['company' => ['accountname']]],
- 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 "storageid" 4 times. Open
'igrnid' => ['IGRN' => ['vendorid' => ['vendorid'], 'storageid' => ['storageid']]],
- 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 "Accounts" 22 times. Open
'Accounts' => ['level' => 0],
- 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 "addresslevel3a" 4 times. Open
'addresslevel3a' => ['addresslevel3a'],
- 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 "Campaigns" 3 times. Open
'Campaigns' => ['level' => 1],
- 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 "table" 3 times. Open
'Documents' => ['table' => 'vtiger_senotesrel', 'rel' => 'crmid', 'base' => 'notesid'],
- 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 "projectid" 6 times. Open
'projectmilestoneid' => ['ProjectMilestone' => ['projectid' => ['projectid']]],
- 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 "parent_id" 9 times. Open
'projectid' => ['Project' => ['parent_id' => ['linktoaccountscontacts']]],
- 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 "addresslevel6a" 4 times. Open
'addresslevel6a' => ['addresslevel6a'],
- 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 "HelpDesk" 7 times. Open
'HelpDesk' => ['level' => 2, 'parentModule' => 'ServiceContracts'],
- 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 "addresslevel2a" 4 times. Open
'addresslevel2a' => ['addresslevel2a'],
- 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 "Contacts" 5 times. Open
'Contacts' => ['level' => 4],
- 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 "SRecurringOrders" 3 times. Open
'SRecurringOrders' => ['level' => 2, 'parentModule' => 'SSalesProcesses'],
- 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
'ProjectTask' => ['level' => 3, 'parentModule' => 'ProjectMilestone'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel6a' => ['addresslevel6a'],
- 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
'addresslevel3a' => ['addresslevel3a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'HelpDesk' => ['Accounts', 'Vendors'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'OutsourcedProducts' => ['Accounts', 'Leads'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'FInvoice' => ['level' => 2, 'parentModule' => 'FBookkeeping'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SRequirementsCards' => ['level' => 2, 'parentModule' => 'SSalesProcesses'],
- Exclude checks
Line exceeds 120 characters; contains 191 characters Open
'pssold_id' => ['Assets' => ['product_id' => ['product', 'Products'], 'parent_id' => ['parent_id', 'Accounts']], 'OSSSoldServices' => ['product_id' => ['serviceid', 'Services']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vat_id_a' => ['vat_id'],
- 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
'Faq' => ['Products'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SQuoteEnquiries' => ['level' => 2, 'parentModule' => 'Campaigns'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'accountid' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel7a' => ['addresslevel7a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'projectid' => ['Project' => ['parent_id' => ['linktoaccountscontacts']]],
- 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
'projectid' => ['Project' => ['accountid' => ['linktoaccountscontacts']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'FInvoice' => ['Accounts'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SSingleOrders' => ['level' => 2, 'parentModule' => 'SSalesProcesses'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'contact_id' => ['Contacts' => ['parent_id' => ['parent_id']]],
- Exclude checks
Line exceeds 120 characters; contains 152 characters Open
'servicecontractsid' => ['ServiceContracts' => ['parent_id' => ['sc_related_to', 'Accounts'], 'ticketpriorities' => ['contract_priority']]],
- Exclude checks
Line exceeds 120 characters; contains 166 characters Open
'subprocess' => ['HelpDesk' => ['name' => ['ticket_title'], 'link' => ['parent_id'], 'process' => ['servicecontractsid'], 'linkextend' => ['contact_id']]]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'salesprocessid' => ['SSalesProcesses' => ['accountid' => ['related_to']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SCalculations' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Accounts' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel3a' => ['addresslevel3a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel2a' => ['addresslevel2a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ProjectMilestone' => ['Project'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SCalculations' => ['level' => 2, 'parentModule' => 'SSalesProcesses'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel2a' => ['addresslevel2a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'igrnid' => ['IGRN' => ['vendorid' => ['vendorid'], 'storageid' => ['storageid']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'igdnid' => ['IGDN' => ['storageid' => ['storageid'], 'accountid' => ['accountid']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SRecurringOrders' => ['SSalesProcesses', 'SQuotes'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Calendar' => ['Accounts', 'Contacts', 'OSSEmployees', 'Leads', 'Vendors', 'HelpDesk', 'Project', 'HelpDesk', 'ServiceContracts', 'Campaigns'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Documents' => ['table' => 'vtiger_senotesrel', 'rel' => 'crmid', 'base' => 'notesid'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ServiceContracts' => ['level' => 1],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'projectmilestoneid' => ['ProjectMilestone' => ['projectid' => ['projectid']]],
- 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
'salesprocessid' => ['SSalesProcesses' => ['accountid' => ['related_to']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'company_name_a' => ['accountname'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel5a' => ['addresslevel5a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Accounts' => [
- 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
'SQuotes' => ['SSalesProcesses'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Project' => ['Accounts'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Assets' => ['Accounts', 'Leads'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Partners' => ['level' => 0],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SSalesProcesses' => ['level' => 1],
- 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
'addresslevel1a' => ['addresslevel1a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'accountid' => ['Accounts' => ['company' => ['accountname']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'FCorectingInvoice' => [
- 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
'ServiceContracts' => ['Accounts'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modulesMapMMCustom' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modulesHierarchy' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Campaigns' => ['level' => 1],
- 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
'ProjectTask' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'accountid' => ['Accounts' => ['company' => ['accountname']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SRecurringOrders' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel4a' => ['addresslevel4a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel1a' => ['addresslevel1a'],
- 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
'modulesMap1M' => [// Base => Parent
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'OSSEmployees' => ['MultiCompany'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'OSSSoldServices' => ['Accounts', 'Leads'],
- 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
'Project' => ['level' => 1],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SQuotes' => ['level' => 2, 'parentModule' => 'SSalesProcesses'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modulesMapRelatedFields' => [//Map links between modules
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'parentid' => ['ProjectTask' => ['projectid' => ['projectid'], 'projectmilestoneid' => ['projectmilestoneid']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'HelpDesk' => [
- 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
'addresslevel8a' => ['addresslevel8a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel7a' => ['addresslevel7a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Assets' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'FBookkeeping' => ['Accounts'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'HolidaysEntitlement' => ['OSSEmployees'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'OSSOutsourcedServices' => ['Accounts', 'Leads'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Competition' => ['level' => 0],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SVendorEnquiries' => ['level' => 2, 'parentModule' => 'SSalesProcesses'],
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
'parentid' => ['ProjectTask' => ['projectid' => ['projectid'], 'projectmilestoneid' => ['projectmilestoneid']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SRequirementsCards' => [
- 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
'addresslevel8a' => ['addresslevel8a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel4a' => ['addresslevel4a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel5a' => ['addresslevel5a'],
- 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
'salesprocessid' => ['SSalesProcesses' => ['accountid' => ['related_to']]],
- 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
'finvoiceid' => ['FInvoice' => ['accountid' => ['accountid']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SSingleOrders' => ['SSalesProcesses'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Accounts' => ['level' => 0],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Leads' => ['level' => 0],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SRecurringOrders' => ['level' => 2, 'parentModule' => 'SSalesProcesses'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SVendorEnquiries' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SQuotes' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'salesprocessid' => ['SSalesProcesses' => ['accountid' => ['related_to']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'addresslevel6a' => ['addresslevel6a'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Products' => ['table' => 'vtiger_seproductsrel', 'rel' => 'crmid', 'base' => 'productid'],
- 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
'Vendors' => ['level' => 0],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'OSSEmployees' => ['level' => 0],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'HelpDesk' => ['level' => 2, 'parentModule' => 'ServiceContracts'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'subprocess' => ['HelpDesk' => ['name' => ['ticket_title'], 'link' => ['parent_id'], 'process' => ['servicecontractsid'], 'linkextend' => ['contact_id']]]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'salesprocessid' => ['SSalesProcesses' => ['accountid' => ['related_to']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SSingleOrders' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'accountid' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SSalesProcesses' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'IGDNC' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
'Calendar' => ['Accounts', 'Contacts', 'OSSEmployees', 'Leads', 'Vendors', 'HelpDesk', 'Project', 'HelpDesk', 'ServiceContracts', 'Campaigns'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modulesMapMMBase' => ['Services', 'Reservations'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ProjectMilestone' => ['level' => 2, 'parentModule' => 'Project'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'servicecontractsid' => ['ServiceContracts' => ['parent_id' => ['sc_related_to', 'Accounts'], 'ticketpriorities' => ['contract_priority']]],
- 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
'salesprocessid' => ['SSalesProcesses' => ['accountid' => ['related_to']]],
- 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
'SQuoteEnquiries' => [
- 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
'SSalesProcesses' => ['Accounts'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ProjectTask' => ['Project'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'OSSTimeControl' => ['Accounts', 'Project', 'HelpDesk', 'Leads'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'process' => ['Project' => ['link' => ['linktoaccountscontacts']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'salesprocessid' => ['SSalesProcesses' => ['accountid' => ['related_to']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'squotesid' => ['SQuotes' => ['accountid' => ['accountid']]],
- 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
'IGRNC' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'PaymentsIn' => ['Accounts'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'OSSMailView' => ['table' => 'vtiger_ossmailview_relation', 'rel' => 'crmid', 'base' => 'ossmailviewid'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'FBookkeeping' => ['level' => 1],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Contacts' => ['level' => 4],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'pssold_id' => ['Assets' => ['product_id' => ['product', 'Products'], 'parent_id' => ['parent_id', 'Accounts']], 'OSSSoldServices' => ['product_id' => ['serviceid', 'Services']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'OSSTimeControl' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'contactid' => ['Contacts' => ['parent_id' => ['parent_id']]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Contacts' => ['Accounts'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'PaymentsOut' => ['Accounts'],
- Exclude checks