YetiForceCompany/YetiForceCRM

View on GitHub
api/webservice/Core/Containers.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Define a constant instead of duplicating this literal "WebservicePremium" 3 times.
Open

        'WebserviceStandard', 'WebservicePremium', 'ManageConsents', 'SMS',
Severity: Critical
Found in api/webservice/Core/Containers.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 "WebserviceStandard" 3 times.
Open

        'WebserviceStandard', 'WebservicePremium', 'ManageConsents', 'SMS',
Severity: Critical
Found in api/webservice/Core/Containers.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 "ManageConsents" 3 times.
Open

        'WebserviceStandard', 'WebservicePremium', 'ManageConsents', 'SMS',
Severity: Critical
Found in api/webservice/Core/Containers.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

    /** @var string[] List of GUI tabs */

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

    ];

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

    public static $listTables = [

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

        'WebserviceStandard', 'WebservicePremium', 'ManageConsents', 'SMS',

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

            'user' => 'w_#__api_user',

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

    /** @var string[] List of available API containers */

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

        'WebserviceStandard', 'WebservicePremium', 'ManageConsents', 'SMS',

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

        ],

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

            'user' => 'w_#__manage_consents_user',

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

    /** @var array List of db tables */

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

    public static $listTab = [

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

        'SMS' => [

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

            'loginHistory' => 'l_#__portal_login_history',

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

            'user' => 'w_#__sms_user',

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

            'loginHistory' => 'l_#__api_login_history',

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

        'ManageConsents' => [

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

    ];

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

        'WebserviceStandard' => [

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

        ],

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

    public static $list = [

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

    ];

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

            'session' => 'w_#__api_session',

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

        'WebservicePremium' => [

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

            'user' => 'w_#__portal_user',

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

            'session' => 'w_#__portal_session',

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

        ],

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

        ],

There are no issues that match your filters.

Category
Status