skqr/hateoas

View on GitHub

Showing 662 of 662 total issues

Multi-line function declarations must define one parameter per line
Open

        Params $params, array $entities

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Open

    {

TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL"
Open

        $relation = NULL;

Function getFields has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getFields(
        $entityClassName,
        ResourceRelationships $relationships
    )
    {
Severity: Minor
Found in Metadata/Resource/MiningTools.php - About 35 mins to fix

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 closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Open

    {

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Open

    {

Space found after opening bracket of FOREACH loop
Open

        foreach (

Space found before closing bracket of FOREACH loop
Open

                    foreach (

There must be one USE keyword per declaration
Open

use GoIntegro\Hateoas\JsonApi\ResourceEntityInterface,

There must be one USE keyword per declaration
Open

use Countable, IteratorAggregate;

There must be one USE keyword per declaration
Open

use GoIntegro\Hateoas\JsonApi\Document,

Space found after opening bracket of FOREACH loop
Open

                    foreach (

Multi-line function declarations must define one parameter per line
Open

        $class, $type, $subtype, $kind, $name, $mappingField

Expected 1 space after FUNCTION keyword; 0 found
Open

        array_walk($entities, function(ResourceEntityInterface $entity) {

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Open

    {
Severity: Minor
Found in Entity/Builder.php by phpcodesniffer

There must be one USE keyword per declaration
Open

use GoIntegro\Hateoas\Metadata\Entity\MetadataCache,

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Open

    {

There must be one USE keyword per declaration
Open

use Symfony\Component\Validator\ValidatorInterface,
Severity: Minor
Found in Entity/DefaultBuilder.php by phpcodesniffer

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Open

    {
Severity: Minor
Found in JsonApi/EntityResource.php by phpcodesniffer

The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Open

    {
Severity: Minor
Found in Entity/DefaultBuilder.php by phpcodesniffer
Severity
Category
Status
Source
Language