orca-services/nova-api-php

View on GitHub

Showing 19 of 86 total issues

Method createRequestBody has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function createRequestBody(NovaCreateOffersParameter $parameter): string
    {
        $dom = new DOMDocument('1.0', 'utf-8');
        $dom->formatOutput = true;

Severity: Major
Found in src/Method/NovaCreateOffersMethod.php - About 2 hrs to fix

    Method createPartner has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function createPartner(DOMElement $partnerNode, XmlDocument $xml): NovaPartner
        {
            $partner = new NovaPartner();
    
            $partner->tkId = $xml->getAttributeValue('@tkid', $partnerNode);
    Severity: Major
    Found in src/Method/NovaSearchPartnerMethod.php - About 2 hrs to fix

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

          private function createRequestBody(NovaCreateServicesParameter $parameter): string
          {
              $dom = new DOMDocument('1.0', 'utf-8');
              $dom->formatOutput = true;
      
      
      Severity: Major
      Found in src/Method/NovaCreateServicesMethod.php - About 2 hrs to fix

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

            private function appendNovaMessages(XmlDocument $xml, array $namespace, array $messages): array
            {
                $ns1 = $namespace[0];
                $ns2 = $namespace[1];
        
        
        Severity: Minor
        Found in src/Parser/NovaMessageParser.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 getSoapErrors has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getSoapErrors(XmlDocument $xml, NovaApiErrorList $errors): NovaApiErrorList
            {
                $xml = $xml->withoutNamespaces();
                $xmlContent = $xml->getXml();
        
        
        Severity: Minor
        Found in src/Parser/NovaApiSoapErrorParser.php - About 1 hr to fix

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

              private function createResult(XmlDocument $xml): NovaCreateOffersResult
              {
                  $result = new NovaCreateOffersResult();
          
                  $xml = $xml->withoutNamespaces();
          Severity: Minor
          Found in src/Method/NovaCreateOffersMethod.php - About 1 hr to fix

            Method appendNovaMessages has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function appendNovaMessages(XmlDocument $xml, array $namespace, array $messages): array
                {
                    $ns1 = $namespace[0];
                    $ns2 = $namespace[1];
            
            
            Severity: Minor
            Found in src/Parser/NovaMessageParser.php - About 1 hr to fix

              Method createRequestBody has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function createRequestBody(NovaSearchServicesParameter $parameter): string
                  {
                      $dom = new DOMDocument('1.0', 'utf-8');
                      $dom->formatOutput = true;
              
              
              Severity: Minor
              Found in src/Method/NovaSearchServicesMethod.php - About 1 hr to fix

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

                    private function createRequestBody(NovaSearchPartnerParameter $parameter): string
                    {
                        $dom = new DOMDocument('1.0', 'utf-8');
                        $dom->formatOutput = true;
                
                
                Severity: Minor
                Found in src/Method/NovaSearchPartnerMethod.php - About 1 hr to fix

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

                      private function createPartner(DOMElement $partnerNode, XmlDocument $xml): NovaPartner
                      {
                          $partner = new NovaPartner();
                  
                          $partner->tkId = $xml->getAttributeValue('@tkid', $partnerNode);
                  Severity: Minor
                  Found in src/Method/NovaSearchPartnerMethod.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 login has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function login(string $clientId, string $clientSecret): string
                      {
                          $options = [
                              'body' => http_build_query(
                                  [
                  Severity: Minor
                  Found in src/Method/NovaLoginMethod.php - About 1 hr to fix

                    Method createRequestBody has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function createRequestBody(NovaPurchaseServicesParameter $parameter): string
                        {
                            $dom = new DOMDocument('1.0', 'utf-8');
                            $dom->formatOutput = true;
                    
                    
                    Severity: Minor
                    Found in src/Method/NovaPurchaseServicesMethod.php - About 1 hr to fix

                      Method appendMethodNamespaces has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function appendMethodNamespaces(DOMElement $method)
                          {
                              $method->setAttribute('xmlns:ns22', 'http://nova.voev.ch/services/internal/leistungnotification');
                              $method->setAttribute('xmlns:ns21', $this->novaSoapAction->getServiceNamespace('vertrieb'));
                              $method->setAttribute('xmlns:nova-leistungnotiz', $this->novaSoapAction->getServiceNamespace('leistungnotiz'));
                      Severity: Minor
                      Found in src/Method/NovaSavCreateOffersMethod.php - About 1 hr to fix

                        Method appendMethodNamespaces has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function appendMethodNamespaces(DOMElement $method)
                            {
                                $method->setAttribute('xmlns:ns20', 'http://nova.voev.ch/services/internal/leistungnotification');
                                $method->setAttribute('xmlns:ns19', $this->getServiceNamespace('inkasso'));
                                $method->setAttribute('xmlns:ns18', $this->getServiceNamespace('vertrieb'));
                        Severity: Minor
                        Found in src/Soap/NovaApiSoapAction.php - About 1 hr to fix

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

                              private function createRequestBody(NovaSearchServicesParameter $parameter): string
                              {
                                  $dom = new DOMDocument('1.0', 'utf-8');
                                  $dom->formatOutput = true;
                          
                          
                          Severity: Minor
                          Found in src/Method/NovaSearchServicesMethod.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 __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  NovaSearchPartnerMethod $novaSearchPartnerMethod,
                                  CheckSwissPassValidityMethod $checkSwissPassValidityMethod,
                                  NovaCreateOffersMethod $novaCreateOffersMethod,
                                  NovaCreateServicesMethod $novaCreateServicesMethod,
                                  NovaPurchaseServicesMethod $novaPurchaseServicesMethod,
                          Severity: Major
                          Found in src/Client/NovaApiClient.php - About 1 hr to fix

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

                                private function createRequestBody(NovaCreateOffersParameter $parameter): string
                                {
                                    $dom = new DOMDocument('1.0', 'utf-8');
                                    $dom->formatOutput = true;
                            
                            
                            Severity: Minor
                            Found in src/Method/NovaCreateOffersMethod.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 withoutNamespaces has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function withoutNamespaces(): self
                                {
                                    $dom = new DOMDocument();
                                    $dom->formatOutput = true;
                            
                            
                            Severity: Minor
                            Found in src/Xml/XmlDocument.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 getExceptionMessage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getExceptionMessage(Exception $exception): string
                                {
                                    $errors = new NovaApiErrorList();
                            
                                    if ($exception instanceof ClientException) {
                            Severity: Minor
                            Found in src/Parser/NovaApiErrorParser.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