neneaX/multi-routing

View on GitHub

Showing 12 of 12 total issues

Function parseNode has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    protected function parseNode(\DOMElement $node)
    {
        // @todo improve array type check
        $isArray = $node->hasAttribute('arrayType');
        $hasHref = $node->hasAttribute('href');
Severity: Minor
Found in src/Adapters/Soap/Request/Parsers/Parser.php - About 3 hrs 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 runController has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function runController()
    {
        list($class, $method) = explode('@', $this->action['uses']);

        $parameters = $this->resolveClassMethodDependencies(
Severity: Major
Found in src/Adapters/JsonRpc/Route.php - About 2 hrs to fix

    Method runController has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function runController()
        {
            list($class, $method) = explode('@', $this->action['uses']);
    
            $parameters = $this->resolveClassMethodDependencies(
    Severity: Minor
    Found in src/Adapters/Soap/Route.php - About 1 hr to fix

      Method parseNode has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function parseNode(\DOMElement $node)
          {
              // @todo improve array type check
              $isArray = $node->hasAttribute('arrayType');
              $hasHref = $node->hasAttribute('href');
      Severity: Minor
      Found in src/Adapters/Soap/Request/Parsers/Parser.php - About 1 hr to fix

        Function getRawContentParams has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getRawContentParams()
            {
                if (null === $this->rawContent) {
                    return [];
                }
        Severity: Minor
        Found in src/Adapters/Soap/Request/Parsers/Parser.php - About 1 hr 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 getNodeValueById has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            private function getNodeValueById($id, \DOMElement $node)
            {
                if (false === ($node->childNodes instanceof \DOMNodeList)) {
                    return null;
                }
        Severity: Minor
        Found in src/Adapters/Soap/Request/Parsers/Parser.php - About 1 hr 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 runController has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function runController()
            {
                list($class, $method) = explode('@', $this->action['uses']);
        
                $parameters = $this->resolveClassMethodDependencies(
        Severity: Minor
        Found in src/Adapters/JsonRpc/Route.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

        Avoid too many return statements within this method.
        Open

                return new Response($responseContent);
        Severity: Major
        Found in src/Adapters/JsonRpc/Route.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return null;
          Severity: Major
          Found in src/Adapters/Soap/Request/Parsers/Parser.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return new Response($responseContent);
            Severity: Major
            Found in src/Adapters/JsonRpc/Route.php - About 30 mins to fix

              Function validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function validate()
                  {
                      try {
                          $this->validateContent();
                      } catch (\Exception $e) {
              Severity: Minor
              Found in src/Adapters/JsonRpc/Request/Parsers/Parser.php - About 25 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 runController has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function runController()
                  {
                      list($class, $method) = explode('@', $this->action['uses']);
              
                      $parameters = $this->resolveClassMethodDependencies(
              Severity: Minor
              Found in src/Adapters/Soap/Route.php - About 25 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