YetiForceCompany/YetiForceCRM

View on GitHub
modules/Chat/ConfigTemplate.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

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

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

        'sanitization' => '\App\Purifier::bool'
Severity: Critical
Found in modules/Chat/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' => 'Number of recent chat entries',
Severity: Critical
Found in modules/Chat/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' => 20,
Severity: Critical
Found in modules/Chat/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::naturalNumber" 5 times.
Open

        'validation' => '\App\Validator::naturalNumber'
Severity: Critical
Found in modules/Chat/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" 9 times.
Open

        'validation' => '\App\Validator::naturalNumber'
Severity: Critical
Found in modules/Chat/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" 4 times.
Open

        'validation' => '\App\Validator::bool',
Severity: Critical
Found in modules/Chat/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' => 20,

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 recent chat entries',

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

    ],

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

    'REFRESH_ROOM_TIME' => [

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

        'default' => 100000,

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

        'description' => 'Default sound notification.',

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' => 'True - user rooms can be pinned/unpinned, false - all user rooms are pinned.',

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

        'default' => 2000,

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' => 'What time to update the new message, number of milliseconds. Default: 2000',

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

    'userRoomPin' => [

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

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

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

    'dynamicAddingRooms' => [

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

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

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

    'REFRESH_TIME_GLOBAL' => [

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

    'DEFAULT_SOUND_NOTIFICATION' => [

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

        'description' => 'What time to update the rooms, number of milliseconds. Default: 10000',

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

        'description' => 'Show the number of new messages.',

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

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

    'CHAT_ROWS_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' => '\App\Validator::naturalNumber'

Line exceeds 120 characters; contains 238 characters
Open

        'description' => 'The maximum length of the message, If you want to increase the number of characters, you must also change it in the database (u_yf_chat_messages_crm, u_yf_chat_messages_group, u_yf_chat_messages_global, etc.,).',

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

        'description' => 'Refresh time for global timer.',

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

        'default' => true,

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

        'description' => 'Show add button in left panel favorites rooms.',

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

        'default' => 2000,

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

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

    'REFRESH_MESSAGE_TIME' => [

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

    'MAX_LENGTH_MESSAGE' => [

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

        'description' => 'The maximum length of the message, If you want to increase the number of characters, you must also change it in the database (u_yf_chat_messages_crm, u_yf_chat_messages_group, u_yf_chat_messages_global, etc.,).',

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

        'default' => 5000,

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

    ],

There are no issues that match your filters.

Category
Status