bcit-ci/CodeIgniter

View on GitHub
system/libraries/Xmlrpcs.php

Summary

Maintainability
D
2 days
Test Coverage

File Xmlrpcs.php has 335 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP
Severity: Minor
Found in system/libraries/Xmlrpcs.php - About 4 hrs to fix

    Function _execute has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _execute($m)
        {
            $methName = $m->method_name;
    
            // Check to see if it is a system call
    Severity: Minor
    Found in system/libraries/Xmlrpcs.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 _execute has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function _execute($m)
        {
            $methName = $m->method_name;
    
            // Check to see if it is a system call
    Severity: Major
    Found in system/libraries/Xmlrpcs.php - About 2 hrs to fix

      Method parseRequest has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function parseRequest($data = '')
          {
              //-------------------------------------
              //  Get Data
              //-------------------------------------
      Severity: Major
      Found in system/libraries/Xmlrpcs.php - About 2 hrs to fix

        Function parseRequest has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            public function parseRequest($data = '')
            {
                //-------------------------------------
                //  Get Data
                //-------------------------------------
        Severity: Minor
        Found in system/libraries/Xmlrpcs.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

        Method do_multicall has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function do_multicall($call)
            {
                if ($call->kindOf() !== 'struct')
                {
                    return $this->multicall_error('notstruct');
        Severity: Minor
        Found in system/libraries/Xmlrpcs.php - About 1 hr to fix

          Function methodSignature has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function methodSignature($m)
              {
                  $parameters = $m->output_parameters();
                  $method_name = $parameters[0];
          
          
          Severity: Minor
          Found in system/libraries/Xmlrpcs.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 do_multicall has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function do_multicall($call)
              {
                  if ($call->kindOf() !== 'struct')
                  {
                      return $this->multicall_error('notstruct');
          Severity: Minor
          Found in system/libraries/Xmlrpcs.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 deeply nested control flow statements.
          Open

                                  if ($pt !== $current_sig[$n+1])
                                  {
                                      $pno = $n+1;
                                      $wanted = $current_sig[$n+1];
          
          
          Severity: Major
          Found in system/libraries/Xmlrpcs.php - About 45 mins to fix

            Avoid too many return statements within this method.
            Open

                            return call_user_func(array($this, $method_parts[1]), $m);
            Severity: Major
            Found in system/libraries/Xmlrpcs.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return call_user_func($this->methods[$methName]['function'], $m);
              Severity: Major
              Found in system/libraries/Xmlrpcs.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return $this->multicall_error('noparams');
                Severity: Major
                Found in system/libraries/Xmlrpcs.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return get_instance()->{$method_parts[1]}($m);
                  Severity: Major
                  Found in system/libraries/Xmlrpcs.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return new XML_RPC_Values(array($result->value()), 'array');
                    Severity: Major
                    Found in system/libraries/Xmlrpcs.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return $this->multicall_error($result);
                      Severity: Major
                      Found in system/libraries/Xmlrpcs.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return $this->object->{$method_parts[1]}($m);
                        Severity: Major
                        Found in system/libraries/Xmlrpcs.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return $this->multicall_error('notarray');
                          Severity: Major
                          Found in system/libraries/Xmlrpcs.php - About 30 mins to fix

                            There are no issues that match your filters.

                            Category
                            Status