YetiForceCompany/YetiForceCRM

View on GitHub
app/Debug/DebugBarDatabase.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Class extends undeclared class \DebugBar\DataCollector\DataCollector
Open

class DebugBarDatabase extends DataCollector implements Renderable
Severity: Critical
Found in app/Debug/DebugBarDatabase.php by phan

Class implements undeclared interface \DebugBar\DataCollector\Renderable
Open

class DebugBarDatabase extends DataCollector implements Renderable
Severity: Critical
Found in app/Debug/DebugBarDatabase.php by phan

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

        return 'Database';
Severity: Critical
Found in app/Debug/DebugBarDatabase.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

     */

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

     */

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

            '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

        ];

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

     * @return array

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

    public function getName()

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

                'icon' => 'tags',

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

            'Database:badge' => [

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

    {

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

                'map' => 'Database.count',

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

                'default' => 1,

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

    }

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

     * @return string

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

        return [

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

                'widget' => 'PhpDebugBar.Widgets.VariableListWidget',

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 array

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

    }

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

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

        return '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

    public function getWidgets()

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 function collect()

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

        return [

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

                'default' => '{}',

There are no issues that match your filters.

Category
Status