YetiForceCompany/YetiForceCRM

View on GitHub
modules/Users/ConfigTemplate.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Define a constant instead of duplicating this literal "description" 6 times.
Open

        'description' => 'Show information about logged user in footer',
Severity: Critical
Found in modules/Users/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" 5 times.
Open

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

        'default' => false,
Severity: Critical
Found in modules/Users/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" 5 times.
Open

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

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

        'sanitization' => '\App\Purifier::bool'
Severity: Critical
Found in modules/Users/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

        '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

        'default' => false,

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' => 'Show role name',

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

    ],

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

    'FAVORITE_OWNERS' => [

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

        'default' => false,

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

    'USER_NAME_IS_EDITABLE' => [

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

    'pwnedPasswordProvider' => [

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

    'CHECK_LAST_USERNAME' => [

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

        'description' => 'Show information about logged user in footer',

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

    'SHOW_ROLE_NAME' => [

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

        '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

        'description' => 'Activation of favorite owners',

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

        'default' => 'YetiForce',

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

        'description' => 'Provider to the check password is in the stolen passwords database',

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

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

        'description' => 'Is it possible to edit usernames?',

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' => 'Verify previously used usernames',

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

    'IS_VISIBLE_USER_INFO_FOOTER' => [

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

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

    ],

There are no issues that match your filters.

Category
Status