seregazhuk/php-pinterest-bot

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

Summary

Maintainability
A
1 hr
Test Coverage

The class Pins has 17 public methods. Consider refactoring Pins to keep number of public methods under 10.
Open

class Pins extends EntityProvider
{
    use Searchable,
        CanBeDeleted,
        SendsMessages,
Severity: Minor
Found in src/Api/Providers/Pins.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

Method edit has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function edit($pindId, $description = '', $link = '', $boardId = null, $title = '', $sectionId = null)
Severity: Minor
Found in src/Api/Providers/Pins.php - About 45 mins to fix

    Method create has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function create($imageUrl, $boardId, $description = '', $link = '', $title = '', $sectionId = null)
    Severity: Minor
    Found in src/Api/Providers/Pins.php - About 45 mins to fix

      Avoid using static access to class '\seregazhuk\PinterestBot\Helpers\FileHelper' in method 'saveOriginalImage'.
      Open

              FileHelper::saveTo($originalUrl, $destination);
      Severity: Minor
      Found in src/Api/Providers/Pins.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

      Arguments with default values must be at the end of the argument list
      Open

          protected function getAggregatedActivity($pinId, $additionalData = [], $limit)
      Severity: Minor
      Found in src/Api/Providers/Pins.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status