seregazhuk/php-pinterest-bot

View on GitHub
src/Api/Providers/Pinners.php

Summary

Maintainability
A
0 mins
Test Coverage

The class Pinners has 11 public methods. Consider refactoring Pinners to keep number of public methods under 10.
Open

class Pinners extends FollowableProvider
{
    use Searchable, ResolvesCurrentUser;

    /**
Severity: Minor
Found in src/Api/Providers/Pinners.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

Avoid using static access to class '\seregazhuk\PinterestBot\Helpers\UrlBuilder' in method 'following'.
Open

        $followingUrl = UrlBuilder::getFollowingUrlByType($type);
Severity: Minor
Found in src/Api/Providers/Pinners.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

Only one argument is allowed per line in a multi-line function call
Open

            UrlBuilder::RESOURCE_BLOCK_USER, ['blocked_user_id' => $userId]

Only one argument is allowed per line in a multi-line function call
Open

            $username, UrlBuilder::RESOURCE_USER_PINS, $limit

Only one argument is allowed per line in a multi-line function call
Open

            $username, UrlBuilder::RESOURCE_USER_LIKES, $limit

Only one argument is allowed per line in a multi-line function call
Open

            $username, UrlBuilder::RESOURCE_USER_PINS, $limit

Only one argument is allowed per line in a multi-line function call
Open

            $username, UrlBuilder::RESOURCE_USER_LIKES, $limit

There are no issues that match your filters.

Category
Status