YetiForceCompany/YetiForceCRM

View on GitHub
modules/ModTracker/ConfigTemplate.php

Summary

Maintainability
A
0 mins
Test Coverage
F
33%

Define a constant instead of duplicating this literal "\App\Validator::naturalNumber" 5 times.
Open

        'validation' => '\App\Validator::naturalNumber'
Severity: Critical
Found in modules/ModTracker/ConfigTemplate.php by sonar-php

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 "validation" 8 times.
Open

        'validation' => function () {
Severity: Critical
Found in modules/ModTracker/ConfigTemplate.php by sonar-php

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" 9 times.
Open

        'default' => 'TimeLine',
Severity: Critical
Found in modules/ModTracker/ConfigTemplate.php by sonar-php

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" 9 times.
Open

        'description' => 'default view in History (Timeline/List)',
Severity: Critical
Found in modules/ModTracker/ConfigTemplate.php by sonar-php

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' => true,

Spaces must be used to indent lines; tabs are not allowed
Open

        'default' => 50,

Spaces must be used to indent lines; tabs are not allowed
Open

        'validation' => '\App\Validator::naturalNumber'

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => 'Number of records on one page',

Line exceeds 120 characters; contains 156 characters
Open

        'description' => 'Enable sending notifications for all actions available in changes history. Tracking requires enabling module or record tracking.',

Spaces must be used to indent lines; tabs are not allowed
Open

    ],

Spaces must be used to indent lines; tabs are not allowed
Open

    'REVIEW_CHANGES_LIMIT' => [

Spaces must be used to indent lines; tabs are not allowed
Open

        'default' => 5,

Spaces must be used to indent lines; tabs are not allowed
Open

    'WATCHDOG' => [

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => 'Max number to update records',

Spaces must be used to indent lines; tabs are not allowed
Open

        'default' => 1000,

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => 'Max number to update records by cron',

Spaces must be used to indent lines; tabs are not allowed
Open

    ],

Spaces must be used to indent lines; tabs are not allowed
Open

        'sanitization' => '\App\Purifier::bool'

Spaces must be used to indent lines; tabs are not allowed
Open

    ],

Spaces must be used to indent lines; tabs are not allowed
Open

    'REVIEWED_SCHEDULE_LIMIT' => [

Spaces must be used to indent lines; tabs are not allowed
Open

    ],

Spaces must be used to indent lines; tabs are not allowed
Open

        'validation' => function () {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        'validation' => '\App\Validator::bool',

Spaces must be used to indent lines; tabs are not allowed
Open

    'DEFAULT_VIEW' => [

Spaces must be used to indent lines; tabs are not allowed
Open

    'UNREVIEWED_COUNT' => [

Spaces must be used to indent lines; tabs are not allowed
Open

    ],

Spaces must be used to indent lines; tabs are not allowed
Open

        'default' => [],

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => 'default view in History (Timeline/List)',

Spaces must be used to indent lines; tabs are not allowed
Open

        'sanitization' => '\App\Purifier::bool'

Spaces must be used to indent lines; tabs are not allowed
Open

        'validation' => '\App\Validator::naturalNumber',

Spaces must be used to indent lines; tabs are not allowed
Open

        'default' => 50,

Spaces must be used to indent lines; tabs are not allowed
Open

            return \in_array($arg, ['Timeline', 'List']);

Spaces must be used to indent lines; tabs are not allowed
Open

        'default' => 100,

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => 'Maximum length of text, only applies to text fields',

Spaces must be used to indent lines; tabs are not allowed
Open

        'default' => 'TimeLine',

Spaces must be used to indent lines; tabs are not allowed
Open

        'default' => true,

Spaces must be used to indent lines; tabs are not allowed
Open

    ],

Spaces must be used to indent lines; tabs are not allowed
Open

    'TIMELINE_IN_LISTVIEW_LIMIT' => [

Spaces must be used to indent lines; tabs are not allowed
Open

    'SHOW_TIMELINE_IN_LISTVIEW' => [

Spaces must be used to indent lines; tabs are not allowed
Open

            $arg = func_get_arg(0);

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => 'Displays the number of unreviewed changes in record.',

Spaces must be used to indent lines; tabs are not allowed
Open

    ],

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => 'Show timeline in list view [module name, ...]'

Spaces must be used to indent lines; tabs are not allowed
Open

        'validation' => '\App\Validator::naturalNumber'

Spaces must be used to indent lines; tabs are not allowed
Open

        'validation' => '\App\Validator::bool',

Spaces must be used to indent lines; tabs are not allowed
Open

    ],

Spaces must be used to indent lines; tabs are not allowed
Open

    'TEASER_TEXT_LENGTH' => [

Spaces must be used to indent lines; tabs are not allowed
Open

    ],

Spaces must be used to indent lines; tabs are not allowed
Open

        'validation' => '\App\Validator::naturalNumber'

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => 'Limit of records displayed in timeline popup',

Spaces must be used to indent lines; tabs are not allowed
Open

        'validation' => '\App\Validator::naturalNumber'

Spaces must be used to indent lines; tabs are not allowed
Open

    'NUMBER_RECORDS_ON_PAGE' => [

Spaces must be used to indent lines; tabs are not allowed
Open

        'description' => 'Enable sending notifications for all actions available in changes history. Tracking requires enabling module or record tracking.',

There are no issues that match your filters.

Category
Status