YetiForceCompany/YetiForceCRM

View on GitHub
modules/HelpDesk/ConfigTemplate.php

Summary

Maintainability
A
0 mins
Test Coverage
D
66%

Define a constant instead of duplicating this literal "sanitization" 8 times.
Open

        'sanitization' => '\App\Purifier::bool'
Severity: Critical
Found in modules/HelpDesk/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 "\App\Validator::bool" 7 times.
Open

        'validation' => '\App\Validator::bool',
Severity: Critical
Found in modules/HelpDesk/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 "\App\Purifier::bool" 7 times.
Open

        'sanitization' => '\App\Purifier::bool'
Severity: Critical
Found in modules/HelpDesk/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' => true,
Severity: Critical
Found in modules/HelpDesk/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' => '\App\Validator::bool',
Severity: Critical
Found in modules/HelpDesk/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' => 'Check if account exists',
Severity: Critical
Found in modules/HelpDesk/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

    ],

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::bool',

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

    'CHECK_ACCOUNT_EXISTS' => [

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

        'description' => 'Columns visible in HelpDesk hierarchy [$label => $columnName]'

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

        'description' => 'Max depth of hierarchy',

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

        'description' => 'Check if service contracts exists',

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

            'Status' => 'ticketstatus',

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

        'default' => true,

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

            'Priority' => 'ticketpriorities',

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

        'sanitization' => function () {

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

        'description' => 'When closing the ticket, check if related tickets are closed',

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

    ],

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

    ],

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

    'SHOW_SUMMARY_PRODUCTS_SERVICES' => [

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

        'description' => 'Show summary products and services',

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' => [

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

            'Assigned To' => 'assigned_user_id',

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

        'description' => 'Count HelpDesk records in hierarchy',

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

        'default' => true,

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

    'CHECK_SERVICE_CONTRACTS_EXISTS' => [

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

    ],

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

    'COUNT_IN_HIERARCHY' => [

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

    'COLUMNS_IN_HIERARCHY' => [

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

            'Ticket No' => 'ticket_no',

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

    'CHECK_IF_RELATED_TICKETS_ARE_CLOSED' => [

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

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

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

        'description' => 'Check if account exists',

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

    'CONTACTS_CHECK_EMAIL_OPTOUT' => [

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

            'FL_TOTAL_TIME_H' => 'sum_time',

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

    'MAX_HIERARCHY_DEPTH' => [

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

            'Subject' => 'ticket_title',

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

    'CHECK_IF_RECORDS_HAS_TIME_CONTROL' => [

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

        'description' => 'When closing the ticket, check if has time control',

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

    ],

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

            return (int) func_get_arg(0);

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

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

        'description' => 'Check email opt-out',

There are no issues that match your filters.

Category
Status