brandon14/brand0n.gg

View on GitHub

Showing 1,121 of 1,121 total issues

Opening brace indented incorrectly; expected 4 spaces, found 11
Open

    : bool {

Expected 1 space after FUNCTION keyword; 0 found
Open

        $this->items->each(function($item, $key) {

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

Expected 1 space after FUNCTION keyword; 0 found
Open

            ->map(function($url) {

Avoid too many return statements within this method.
Open

        return [
            'random_quote_index' => $randomQuoteIndex,
        ];
Severity: Major
Found in app/ViewModels/RandomQuote.php - About 30 mins to fix

    Missing class import via use statement (line '65', column '37').
    Open

            $im->setBackgroundColor(new \ImagickPixel($background));
    Severity: Minor
    Found in app/Listeners/GenerateFavicons.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method setAddHeaders has a boolean flag argument $addHeaders, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function setAddHeaders(bool $addHeaders = true): self

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

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

    Missing class import via use statement (line '63', column '19').
    Open

            $im = new \Imagick();
    Severity: Minor
    Found in app/Listeners/GenerateFavicons.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method setAddTime has a boolean flag argument $addTime, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function setAddTime(bool $addTime = true): self

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

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

    Avoid using static access to class '\Brand0nGG\Contracts\Services\CacheException' in method 'saveArrayInCache'.
    Open

                throw CacheException::createFromException($exception);

    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 '\Brand0nGG\Contracts\Services\ProviderRegistrationException' in method 'resolveTimestamp'.
    Open

                throw ProviderRegistrationException::noProviderRegistered($providerName);

    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 '\Brand0nGG\Contracts\Services\ProviderRegistrationException' in method 'getStatusByArray'.
    Open

                throw ProviderRegistrationException::noProvidersSpecified();

    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 unused local variables such as '$image'.
    Open

                $image = Browsershot::url("{$app_url}/social-images/{$id}")
    Severity: Minor
    Found in app/Jobs/GenerateSocialImagesJob.php by phpmd

    UnusedLocalVariable

    Since: 0.2

    Detects when a local variable is declared and/or assigned, but not used.

    Example

    class Foo {
        public function doSomething()
        {
            $i = 5; // Unused
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

    Avoid using static access to class '\Illuminate\Support\Facades\Artisan' in method 'handle'.
    Open

            Artisan::call('cache:clear');
    Severity: Minor
    Found in app/Listeners/GenerateFavicons.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 unused parameters such as '$e'.
    Open

            $this->reportable(function (Throwable $e) {
    Severity: Minor
    Found in app/Exceptions/Handler.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

    Avoid using static access to class '\Illuminate\Support\Facades\Broadcast' in method 'boot'.
    Open

            Broadcast::routes();

    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 'definition'.
    Open

                'remember_token' => Str::random(10),
    Severity: Minor
    Found in database/factories/UserFactory.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 '\Brand0nGG\Contracts\Services\CacheException' in method 'saveIntInCache'.
    Open

                throw CacheException::createFromException($exception);

    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 '\Carbon\Carbon' in method 'getLastModifiedTimeByArray'.
    Open

            return Carbon::createFromTimestamp(
                $this->resolveProviderArray($providerNames, $this->cacheKey.'_'.implode('_', $providerNames))
            );

    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 '\Statamic\Statamic' in method 'boot'.
    Open

            Statamic::style('app', 'cp');
    Severity: Minor
    Found in app/Providers/AppServiceProvider.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

    Severity
    Category
    Status
    Source
    Language