skqr/hateoas

View on GitHub

Showing 662 of 662 total issues

There must be one USE keyword per declaration
Open

use Symfony\Component\HttpFoundation\Request,

Space found after opening bracket of FOREACH loop
Open

        foreach (

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

        $collection = NULL;

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

    public function serialize(Document $document)
    {
        $json = [];

        if (!empty($document->pagination)) {
Severity: Minor
Found in JsonApi/Serializer/PaginationMetadataSerializer.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

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

    protected function parseDeleteAction(Params $params, $relation)
    {
        $ids = NULL;

        if (!empty($params->relationshipIds)) {
Severity: Minor
Found in JsonApi/Request/UnlinkBodyParser.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

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

        \Exception $previous = NULL

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

    private function mineMetadata(array $entities)
    {
        $metadata = NULL;

        if (0 < count($entities)) {
Severity: Minor
Found in JsonApi/ResourceCollectionFactory.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

There must be one USE keyword per declaration
Open

use GoIntegro\Hateoas\JsonApi\ResourceEntityInterface,

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

        EntityResource $resource, $relationshipName

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

        return $page <= $this->getLast($document) ? $page : NULL;

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

        EntityResource $resource, array $resourceObject

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

    {

Blank line found at start of control structure
Open

            if (!empty($docTranslations)) {

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

            : NULL;

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

    {

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

    public function clean(array $blacklist, $linkOnly)
    {
        $blacklist = array_flip($blacklist);

        // Se usa "kind" y no "type" para no confundir con sus otros usos.
Severity: Minor
Found in Metadata/Resource/ResourceRelationships.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

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

        return json_decode(json_encode($array), FALSE);
Severity: Minor
Found in Util/ArrayHelper.php by phpcodesniffer

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

        EntityResource $resource, ResourceRelationship $relationship

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

        return 0 < $page ? $page : NULL;
Severity
Category
Status
Source
Language