eveseat/eveapi

View on GitHub
src/Commands/Seat/Admin/Diagnose.php

Summary

Maintainability
A
55 mins
Test Coverage

Function check_storage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function check_storage()
    {

        $this->line(' * Checking storage');

Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Avoid using static access to class '\Illuminate\Support\Facades\Redis' in method 'check_redis'.
Open

            Redis::expire($test_key, 10);
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Facades\Redis' in method 'check_redis'.
Open

            Redis::set($test_key, $test_value);
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Facades\File' in method 'check_storage'.
Open

        if (! File::isWritable(storage_path()))
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Facades\File' in method 'check_storage'.
Open

        if (! File::isWritable(storage_path(sprintf('logs/laravel-%s.log', carbon()->toDateString())))) {
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Facades\File' in method 'check_storage'.
Open

            if (File::isWritable(storage_path('logs')))
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Facades\Redis' in method 'check_redis'.
Open

            if (Redis::get($test_key) === $test_value)
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Facades\File' in method 'check_storage'.
Open

        if (! File::isWritable(storage_path('sde')))
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Illuminate\Support\Str' in method 'check_redis'.
Open

        $test_key = Str::random(64);
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

The method check_eseye is not named in camelCase.
Open

    public function check_eseye()
    {
        $this->line(' * Checking ESI Access');

        try {
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method environment_info is not named in camelCase.
Open

    public function environment_info()
    {

        $this->line(' * Getting environment information');

Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method check_storage is not named in camelCase.
Open

    public function check_storage()
    {

        $this->line(' * Checking storage');

Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method check_debug is not named in camelCase.
Open

    public function check_debug()
    {
        $this->line(' * Checking DEBUG mode');

        if (config('app.debug', false) == true)
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method check_database is not named in camelCase.
Open

    public function check_database()
    {
        $this->line(' * Checking Database');
        $this->table(['Setting', 'Value'], [
            ['Connection', config('database.default', 'mysql')],
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method check_redis is not named in camelCase.
Open

    public function check_redis()
    {
        $this->line(' * Checking Redis');
        $this->table(['Setting', 'Value'], [
            ['Host', config('database.redis.default.host')],
Severity: Minor
Found in src/Commands/Seat/Admin/Diagnose.php by phpmd

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status