Showing 8 of 8 total issues
Post
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Post extends HydratableModel
{
/**
* @var int
*/
ImageMeta
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ImageMeta extends HydratableModel
{
/**
* @var string
*/
Method getPosts
has 20 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
int $page = 1,
int $perPage = 10,
string $search = null,
string $context = null,
string $after = null,
File Post.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare(strict_types=1);
namespace Somecoding\WordpressApiWrapper\Model;
Method getPosts
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getPosts(
int $page = 1,
int $perPage = 10,
string $search = null,
string $context = null,
Method getHydratedApiPage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getHydratedApiPage(string $page, array $parameters = [])
{
$offset = 0;
Function getHydratedApiPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getHydratedApiPage(string $page, array $parameters = [])
{
$offset = 0;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Client $client,
HydratorInterface $hydrator,
Config $wordpressWrapperConfig,
string $siteUrl = null,
CacheInterface $simpleCacheAdapter = null