amtgard/ORK3

View on GitHub
system/lib/nusoap/class.soap_server.php

Summary

Maintainability
F
1 mo
Test Coverage

File class.soap_server.php has 707 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php




Severity: Major
Found in system/lib/nusoap/class.soap_server.php - About 1 day to fix

    Function parse_http_headers has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
    Open

        function parse_http_headers() {
            global $HTTP_SERVER_VARS;
    
            $this->request = '';
            $this->SOAPAction = '';
    Severity: Minor
    Found in system/lib/nusoap/class.soap_server.php - About 1 day 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 invoke_method has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

        function invoke_method() {
            $this->debug('in invoke_method, methodname=' . $this->methodname . ' methodURI=' . $this->methodURI . ' SOAPAction=' . $this->SOAPAction);
    
            //
            // if you are debugging in this area of the code, your service uses a class to implement methods,
    Severity: Minor
    Found in system/lib/nusoap/class.soap_server.php - About 7 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

    Function serialize_return has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

        function serialize_return() {
            $this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
            // if fault
            if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
                $this->debug('got a fault object from method');
    Severity: Minor
    Found in system/lib/nusoap/class.soap_server.php - About 6 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

    Function send_response has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        function send_response() {
            $this->debug('Enter send_response');
            if ($this->fault) {
                $payload = $this->fault->serialize();
                $this->outgoing_headers[] = "HTTP/1.0 500 Internal Server Error";
    Severity: Minor
    Found in system/lib/nusoap/class.soap_server.php - About 4 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 invoke_method has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function invoke_method() {
            $this->debug('in invoke_method, methodname=' . $this->methodname . ' methodURI=' . $this->methodURI . ' SOAPAction=' . $this->SOAPAction);
    
            //
            // if you are debugging in this area of the code, your service uses a class to implement methods,
    Severity: Major
    Found in system/lib/nusoap/class.soap_server.php - About 4 hrs to fix

      Function service has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          function service($data){
              global $HTTP_SERVER_VARS;
      
              if (isset($_SERVER['REQUEST_METHOD'])) {
                  $rm = $_SERVER['REQUEST_METHOD'];
      Severity: Minor
      Found in system/lib/nusoap/class.soap_server.php - About 4 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 parse_http_headers has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function parse_http_headers() {
              global $HTTP_SERVER_VARS;
      
              $this->request = '';
              $this->SOAPAction = '';
      Severity: Major
      Found in system/lib/nusoap/class.soap_server.php - About 3 hrs to fix

        Function nusoap_server has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            function nusoap_server($wsdl=false){
                parent::nusoap_base();
                // turn on debugging?
                global $debug;
                global $HTTP_SERVER_VARS;
        Severity: Minor
        Found in system/lib/nusoap/class.soap_server.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 serialize_return has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function serialize_return() {
                $this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
                // if fault
                if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
                    $this->debug('got a fault object from method');
        Severity: Major
        Found in system/lib/nusoap/class.soap_server.php - About 3 hrs to fix

          Method service has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function service($data){
                  global $HTTP_SERVER_VARS;
          
                  if (isset($_SERVER['REQUEST_METHOD'])) {
                      $rm = $_SERVER['REQUEST_METHOD'];
          Severity: Major
          Found in system/lib/nusoap/class.soap_server.php - About 2 hrs to fix

            Function register has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

                function register($name,$in=array(),$out=array(),$namespace=false,$soapaction=false,$style=false,$use=false,$documentation='',$encodingStyle=''){
                    global $HTTP_SERVER_VARS;
            
                    if($this->externalWSDLURL){
                        die('You cannot bind to an external WSDL file, and register methods outside of it! Please choose either WSDL or no WSDL.');
            Severity: Minor
            Found in system/lib/nusoap/class.soap_server.php - About 2 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 configureWSDL has 62 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function configureWSDL($serviceName,$namespace = false,$endpoint = false,$style='rpc', $transport = 'http://schemas.xmlsoap.org/soap/http', $schemaTargetNamespace = false)
                {
                    global $HTTP_SERVER_VARS;
            
                    if (isset($_SERVER)) {
            Severity: Major
            Found in system/lib/nusoap/class.soap_server.php - About 2 hrs to fix

              Method register has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function register($name,$in=array(),$out=array(),$namespace=false,$soapaction=false,$style=false,$use=false,$documentation='',$encodingStyle=''){
                      global $HTTP_SERVER_VARS;
              
                      if($this->externalWSDLURL){
                          die('You cannot bind to an external WSDL file, and register methods outside of it! Please choose either WSDL or no WSDL.');
              Severity: Major
              Found in system/lib/nusoap/class.soap_server.php - About 2 hrs to fix

                Function parse_request has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                    function parse_request($data='') {
                        $this->debug('entering parse_request()');
                        $this->parse_http_headers();
                        $this->debug('got character encoding: '.$this->xml_encoding);
                        // uncompress if necessary
                Severity: Minor
                Found in system/lib/nusoap/class.soap_server.php - About 2 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 send_response has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function send_response() {
                        $this->debug('Enter send_response');
                        if ($this->fault) {
                            $payload = $this->fault->serialize();
                            $this->outgoing_headers[] = "HTTP/1.0 500 Internal Server Error";
                Severity: Major
                Found in system/lib/nusoap/class.soap_server.php - About 2 hrs to fix

                  Method nusoap_server has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function nusoap_server($wsdl=false){
                          parent::nusoap_base();
                          // turn on debugging?
                          global $debug;
                          global $HTTP_SERVER_VARS;
                  Severity: Minor
                  Found in system/lib/nusoap/class.soap_server.php - About 1 hr to fix

                    Function configureWSDL has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function configureWSDL($serviceName,$namespace = false,$endpoint = false,$style='rpc', $transport = 'http://schemas.xmlsoap.org/soap/http', $schemaTargetNamespace = false)
                        {
                            global $HTTP_SERVER_VARS;
                    
                            if (isset($_SERVER)) {
                    Severity: Minor
                    Found in system/lib/nusoap/class.soap_server.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 parseRequest has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function parseRequest($headers, $data) {
                            $this->debug('Entering parseRequest() for data of length ' . strlen($data) . ' headers:');
                            $this->appendDebug($this->varDump($headers));
                            if (!isset($headers['content-type'])) {
                                $this->setError('Request not of type text/xml (no content-type header)');
                    Severity: Minor
                    Found in system/lib/nusoap/class.soap_server.php - About 1 hr to fix

                      Method register has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          function register($name,$in=array(),$out=array(),$namespace=false,$soapaction=false,$style=false,$use=false,$documentation='',$encodingStyle=''){
                      Severity: Major
                      Found in system/lib/nusoap/class.soap_server.php - About 1 hr to fix

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

                            function parseRequest($headers, $data) {
                                $this->debug('Entering parseRequest() for data of length ' . strlen($data) . ' headers:');
                                $this->appendDebug($this->varDump($headers));
                                if (!isset($headers['content-type'])) {
                                    $this->setError('Request not of type text/xml (no content-type header)');
                        Severity: Minor
                        Found in system/lib/nusoap/class.soap_server.php - About 55 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 configureWSDL has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            function configureWSDL($serviceName,$namespace = false,$endpoint = false,$style='rpc', $transport = 'http://schemas.xmlsoap.org/soap/http', $schemaTargetNamespace = false)
                        Severity: Minor
                        Found in system/lib/nusoap/class.soap_server.php - About 45 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                                  return;
                          Severity: Major
                          Found in system/lib/nusoap/class.soap_server.php - About 30 mins to fix

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                            class nusoap_server extends nusoap_base {
                                /**
                                 * HTTP headers of request
                                 * @var array
                                 * @access private
                            Severity: Major
                            Found in system/lib/nusoap/class.soap_server.php and 1 other location - About 1 mo to fix
                            system/lib/nusoap/nusoap.php on lines 3474..4576

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 7482.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            There are no issues that match your filters.

                            Category
                            Status