Call to method naturalNumber
from undeclared class \App\Validator
(Did you mean class \Tests\App\Validator) Open
return $arg && \App\Validator::naturalNumber($arg);
- Exclude checks
Define a constant instead of duplicating this literal "validation" 3 times. Open
'validation' => function () {
- 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" 4 times. Open
'description' => 'Default view for record detail view. Values: LBL_RECORD_DETAILS or LBL_RECORD_SUMMARY',
- 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
'default' => 'LBL_RECORD_PREVIEW',
- 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' => 'KnowledgeBase',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 'List' === $arg || 'ListPreview' === $arg || 'DashBoard' === $arg || 'KnowledgeBase' === $arg;
- 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
'description' => 'Article limit in the knowledge base window',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $arg && \App\Validator::naturalNumber($arg);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'validation' => function () {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \in_array($arg, ['LBL_RECORD_PREVIEW', 'LBL_RECORD_SUMMARY', 'LBL_RECORD_DETAILS']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arg = func_get_arg(0);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Default view for record detail view. Values: LBL_RECORD_DETAILS or LBL_RECORD_SUMMARY',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arg = func_get_arg(0);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'rename' => [
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'If 1 and filename exists, RENAME file, adding "_NR" to the end of filename (name_1.ext, name_2.ext, ..) If 0, will OVERWRITE the existing file',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'validation' => function () {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'knowledgeBaseArticleLimit' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
'description' => 'Default module view. Values: KnowledgeBase, List, ListPreview or DashBoard, refresh menu files after you change this value',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 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
'default' => 50,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arg = func_get_arg(0);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'Default module view. Values: KnowledgeBase, List, ListPreview or DashBoard, refresh menu files after you change this value',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'validation' => function () {
- Exclude checks
Line exceeds 120 characters; contains 170 characters Open
'description' => 'If 1 and filename exists, RENAME file, adding "_NR" to the end of filename (name_1.ext, name_2.ext, ..) If 0, will OVERWRITE the existing file',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'DEFAULT_VIEW_RECORD' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'defaultViewName' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'default' => 'LBL_RECORD_PREVIEW',
- Exclude checks