src/Api/Providers/Pins.php
The class Pins has 17 public methods. Consider refactoring Pins to keep number of public methods under 10. Open
Open
class Pins extends EntityProvider
{
use Searchable,
CanBeDeleted,
SendsMessages,
- Read upRead up
- Exclude checks
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
Open
public function edit($pindId, $description = '', $link = '', $boardId = null, $title = '', $sectionId = null)
Method create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function create($imageUrl, $boardId, $description = '', $link = '', $title = '', $sectionId = null)
Avoid using static access to class '\seregazhuk\PinterestBot\Helpers\FileHelper' in method 'saveOriginalImage'. Open
Open
FileHelper::saveTo($originalUrl, $destination);
- Read upRead up
- Exclude checks
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
Open
protected function getAggregatedActivity($pinId, $additionalData = [], $limit)
- Exclude checks