YetiForceCompany/YetiForceCRM

View on GitHub
modules/OSSSoldServices/ConfigTemplate.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Define a constant instead of duplicating this literal "description" 4 times.
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',

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' => '2 month',

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' => '2 month',

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

        'default' => ['relationField' => 'parent_id', 'module' => 'Accounts', 'relatedModule' => ['FInvoice', 'ModComments', 'Calendar', 'Documents']],

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

        'description' => 'Show relations in the modal'

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

    'RENEWAL_TIME' => [

Line exceeds 120 characters; contains 151 characters
Open

        'default' => ['relationField' => 'parent_id', 'module' => 'Accounts', 'relatedModule' => ['FInvoice', 'ModComments', 'Calendar', 'Documents']],

Spaces must be used to indent lines; tabs are not allowed
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',

Line exceeds 120 characters; contains 163 characters
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',

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

        'type' => '["class" => "", "method" => "", "hierarchy" => ""]',

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

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

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

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

        'type' => 'false, [] - inherit fields, [ label => column name, .. ]',

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

        'description' => 'Show hierarchy in modal'

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

    ],

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

    'SHOW_HIERARCHY_IN_MODAL' => [

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

    'RENEWAL_CUSTOMER_FUNCTION' => [

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' => 'Renewing the customer function'

There are no issues that match your filters.

Category
Status