eveseat/eveapi

View on GitHub
src/database/seeders/ScheduleSeeder.php

Summary

Maintainability
B
4 hrs
Test Coverage

Method getSchedules has 110 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getSchedules(): array
    {
        $schedules = [
            [   // ESI Status | Every Minute
                'command' => 'esi:update:status',
Severity: Major
Found in src/database/seeders/ScheduleSeeder.php - About 4 hrs to fix

    The method getSchedules() has 120 lines of code. Current threshold is set to 100. Avoid really long methods.
    Open

        public function getSchedules(): array
        {
            $schedules = [
                [   // ESI Status | Every Minute
                    'command' => 'esi:update:status',

    Avoid using static access to class '\Illuminate\Support\Arr' in method 'seedRandomize'.
    Open

                        $schedules[$key]['expression'] = sprintf('%d %d * * *', rand(0, 59), Arr::random($hours));

    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

    There are no issues that match your filters.

    Category
    Status