Showing 662 of 662 total issues
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(
DocumentResource $documentResource,
ResourceCache $resourceCache,
array $include = [],
array $sparseFields = [],
- 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
Function create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function create()
{
$include = NULL;
$fields = NULL;
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
DocumentResource $documentResource,
ResourceCache $resourceCache,
array $include = [],
array $sparseFields = [],
DocumentPagination $pagination = NULL,
Function selectRelationshipEntities
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function selectRelationshipEntities(
Params $params, array $entities
)
{
$selected = [];
- 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
Function getSortOrder
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getSortOrder($field, $relationship = NULL)
{
$sortedByRelationship = NULL;
if (empty($relationship)) {
- 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
Function parseCreateAction
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function parseCreateAction($ids, array $relation)
{
if (is_array($ids)) {
if (!is_array($relation)) {
throw new ParseException(
- 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
The class Parser has a coupling between objects value of 30. Consider to reduce the number of dependencies under 13. Open
class Parser
{
const HTTP_OPTIONS = 'OPTIONS',
HTTP_HEAD = 'HEAD',
HTTP_GET = 'GET',
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
The class BodyParser has a coupling between objects value of 24. Consider to reduce the number of dependencies under 13. Open
class BodyParser
{
const ERROR_PRIMARY_TYPE_KEY = "The resource type key is missing from the body.",
ERROR_MISSING_SCHEMA = "A RAML schema was expected for the current action upon the resource \"%s\".",
ERROR_MALFORMED_SCHEMA = "The RAML schema for the current action is missing the primary type key, \"%s\".",
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
The class ParamEntityFinder has a coupling between objects value of 17. Consider to reduce the number of dependencies under 13. Open
class ParamEntityFinder
{
const ACCESS_VIEW = 'view',
ACCESS_EDIT = 'edit',
ACCESS_DELETE = 'delete';
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
The class ResourceCollectionFactory has a coupling between objects value of 17. Consider to reduce the number of dependencies under 13. Open
class ResourceCollectionFactory implements Factory
{
/**
* @var ResourceManager
*/
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Method update
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Params $params,
ResourceEntityInterface $entity,
array $fields,
array $relationships = [],
array $metadata = []
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$field,
$resource,
$message = "",
$code = 0,
\Exception $previous = NULL
There must be one USE keyword per declaration Open
use GoIntegro\Hateoas\JsonApi\ResourceEntityInterface,
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL" Open
: NULL;
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
{
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
{
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
{
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL" Open
public static function getStringId(ResourceEntityInterface $entity = NULL)
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL" Open
Exception $previous = NULL
- Exclude checks
The implements keyword must be on the same line as the class name Open
implements Paginated
- Exclude checks