skqr/hateoas

View on GitHub

Showing 662 of 662 total issues

There must be one USE keyword per declaration
Open

use GoIntegro\Hateoas\JsonApi\JsonApiSpec,

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

    public function getSortOrder($field, $relationship = NULL)
Severity: Minor
Found in JsonApi/Request/Params.php by phpcodesniffer

Space found before closing bracket of FOREACH loop
Open

        foreach (

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

    {

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 "true" but found "TRUE"
Open

        $camelized = Inflector::camelize($field, TRUE);
Severity: Minor
Found in JsonApi/EntityResource.php by phpcodesniffer

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

        Params $params, RequestAction $action

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

        $ids = NULL;

Expected 1 space after FUNCTION keyword; 0 found
Open

            $callback = function($entity) {

There must be one USE keyword per declaration
Open

use Symfony\Component\HttpFoundation\Request,

Expected 1 space after FUNCTION keyword; 0 found
Open

            $callback = function($pair) {

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

    public function parse(Request $request, Params $params)
    {
        $filters = [];

        if (empty($params->primaryClass)) return $filters;
Severity: Minor
Found in JsonApi/Request/FilterParser.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

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

The implements keyword must be on the same line as the class name
Open

    implements Paginated

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

            ) ? EntityResource::getStringId($entity) : NULL;

Expected 1 space after FUNCTION keyword; 0 found
Open

            $walk = function($relationship) use (&$json, $resource) {

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

        $query, Result $result, array $facets, array $entities
Severity: Minor
Found in Search/SolrSearchResult.php by phpcodesniffer
Severity
Category
Status
Source
Language