GoIntegro/hateoas

View on GitHub

Showing 64 of 64 total issues

Method findPaginated has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $entityClass,
        array $criteria,
        $sorting = [],
        $offset = Request\Params::DEFAULT_PAGE_OFFSET,
        $limit = Request\Params::DEFAULT_PAGE_SIZE,
Severity: Minor
Found in Util/RepositoryHelper.php - About 45 mins to fix

    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $class, $type, $subtype, $kind, $name, $mappingField
    Severity: Minor
    Found in Metadata/Resource/ResourceRelationship.php - About 45 mins to fix

      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(
      Severity: Minor
      Found in JsonApi/Request/LinkBodyParser.php - About 45 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 getSortOrder has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getSortOrder($field, $relationship = NULL)
          {
              $sortedByRelationship = NULL;
      
              if (empty($relationship)) {
      Severity: Minor
      Found in JsonApi/Request/Params.php - About 45 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 processToOneRelationship has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private function processToOneRelationship(
              ResourceCollectionInterface $resources,
              $relationshipName,
              array &$linkedResources,
              LinkedResourcesSerialization $resourcesSerialization
      Severity: Minor
      Found in JsonApi/Serializer/LinkedResourcesSerializer.php - About 45 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 create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function create()
          {
              $include = NULL;
              $fields = NULL;
      
      
      Severity: Minor
      Found in JsonApi/DocumentFactory.php - About 45 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

      Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $type,
              $subtype,
              \ReflectionClass $resourceClass,
              ResourceFields $fields,
              ResourceRelationships $relationships,
      Severity: Minor
      Found in Metadata/Resource/ResourceMetadata.php - About 45 mins to fix

        Method update has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                Params $params,
                ResourceEntityInterface $entity,
                array $fields,
                array $relationships = [],
                array $metadata = []
        Severity: Minor
        Found in Entity/Mutator.php - About 35 mins to fix

          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  EntityManagerInterface $em,
                  MetadataCache $metadataCache,
                  DocNavigator $docNavigator,
                  ResourceEntityMapCache $mapCache,
                  ResourcesConfigInterface $resourcesConfig
          Severity: Minor
          Found in Config/ResourceEntityMapper.php - About 35 mins to fix

            Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $field,
                    $resource,
                    $message = "",
                    $code = 0,
                    \Exception $previous = NULL
            Severity: Minor
            Found in JsonApi/Serializer/InvalidFieldException.php - About 35 mins to fix

              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

              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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function create()
                  {
                      $include = NULL;
                      $fields = NULL;
              
              
              Severity: Minor
              Found in JsonApi/SerializerFactory.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 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

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

                  public function parse(Request $request, Params $params, array $body)
                  {
                      $entity = $params->entities->primary->first();
                      $ids = NULL;
              
              
              Severity: Minor
              Found in JsonApi/Request/LinkBodyParser.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

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

                  public function serialize(Document $document)
                  {
                      $json = [];
                      $pagination = $document->pagination;
              
              
              Severity: Minor
              Found in JsonApi/Serializer/TopLevelPaginationLinksSerializer.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 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

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

                  private function getQueryBuilder(
                      $entityClass,
                      array $criteria,
                      $sorting = [],
                      $translatable = false
              Severity: Minor
              Found in Util/RepositoryHelper.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 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

              Severity
              Category
              Status
              Source
              Language