brandon14/ebay-sdk-php

View on GitHub
src/Sell/Logistics/V1/Api/ShipmentApi.php

Summary

Maintainability
F
6 days
Test Coverage

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

<?php

/**
 * This file is part of the trollandtoad/ebay-sdk-php package.
 *
Severity: Major
Found in src/Sell/Logistics/V1/Api/ShipmentApi.php - About 1 day to fix

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

        public function createFromShippingQuoteRequest($create_shipment_from_quote_request)
        {
            // Verify the required parameter 'create_shipment_from_quote_request' is set.
            if ($create_shipment_from_quote_request === null || (\is_array($create_shipment_from_quote_request) && count($create_shipment_from_quote_request) === 0)) {
                throw new \InvalidArgumentException('Missing the required parameter $create_shipment_from_quote_request when calling createFromShippingQuote');
    Severity: Minor
    Found in src/Sell/Logistics/V1/Api/ShipmentApi.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

    ShipmentApi has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ShipmentApi
    {
        /**
         * @var ClientInterface
         */
    Severity: Minor
    Found in src/Sell/Logistics/V1/Api/ShipmentApi.php - About 2 hrs to fix

      Function downloadLabelFileRequest has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function downloadLabelFileRequest($shipment_id)
          {
              // Verify the required parameter 'shipment_id' is set.
              if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling downloadLabelFile');
      Severity: Minor
      Found in src/Sell/Logistics/V1/Api/ShipmentApi.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

      Function getShipmentRequest has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getShipmentRequest($shipment_id)
          {
              // Verify the required parameter 'shipment_id' is set.
              if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling getShipment');
      Severity: Minor
      Found in src/Sell/Logistics/V1/Api/ShipmentApi.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

      Function cancelShipmentRequest has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function cancelShipmentRequest($shipment_id)
          {
              // Verify the required parameter 'shipment_id' is set.
              if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling cancelShipment');
      Severity: Minor
      Found in src/Sell/Logistics/V1/Api/ShipmentApi.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 downloadLabelFileRequest has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function downloadLabelFileRequest($shipment_id)
          {
              // Verify the required parameter 'shipment_id' is set.
              if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
                  throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling downloadLabelFile');
      Severity: Major
      Found in src/Sell/Logistics/V1/Api/ShipmentApi.php - About 2 hrs to fix

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

            public function cancelShipmentRequest($shipment_id)
            {
                // Verify the required parameter 'shipment_id' is set.
                if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
                    throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling cancelShipment');
        Severity: Major
        Found in src/Sell/Logistics/V1/Api/ShipmentApi.php - About 2 hrs to fix

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

              public function getShipmentRequest($shipment_id)
              {
                  // Verify the required parameter 'shipment_id' is set.
                  if ($shipment_id === null || (\is_array($shipment_id) && count($shipment_id) === 0)) {
                      throw new \InvalidArgumentException('Missing the required parameter $shipment_id when calling getShipment');
          Severity: Major
          Found in src/Sell/Logistics/V1/Api/ShipmentApi.php - About 2 hrs to fix

            Method createFromShippingQuoteRequest has 63 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function createFromShippingQuoteRequest($create_shipment_from_quote_request)
                {
                    // Verify the required parameter 'create_shipment_from_quote_request' is set.
                    if ($create_shipment_from_quote_request === null || (\is_array($create_shipment_from_quote_request) && count($create_shipment_from_quote_request) === 0)) {
                        throw new \InvalidArgumentException('Missing the required parameter $create_shipment_from_quote_request when calling createFromShippingQuote');
            Severity: Major
            Found in src/Sell/Logistics/V1/Api/ShipmentApi.php - About 2 hrs to fix

              Method downloadLabelFileWithHttpInfo has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function downloadLabelFileWithHttpInfo($shipment_id)
                  {
                      $request = $this->downloadLabelFileRequest($shipment_id);
              
                      try {
              Severity: Major
              Found in src/Sell/Logistics/V1/Api/ShipmentApi.php - About 2 hrs to fix

                Method getShipmentWithHttpInfo has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getShipmentWithHttpInfo($shipment_id)
                    {
                        $request = $this->getShipmentRequest($shipment_id);
                
                        try {
                Severity: Major
                Found in src/Sell/Logistics/V1/Api/ShipmentApi.php - About 2 hrs to fix

                  Method createFromShippingQuoteWithHttpInfo has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function createFromShippingQuoteWithHttpInfo($create_shipment_from_quote_request)
                      {
                          $request = $this->createFromShippingQuoteRequest($create_shipment_from_quote_request);
                  
                          try {
                  Severity: Major
                  Found in src/Sell/Logistics/V1/Api/ShipmentApi.php - About 2 hrs to fix

                    Method cancelShipmentWithHttpInfo has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function cancelShipmentWithHttpInfo($shipment_id)
                        {
                            $request = $this->cancelShipmentRequest($shipment_id);
                    
                            try {
                    Severity: Major
                    Found in src/Sell/Logistics/V1/Api/ShipmentApi.php - About 2 hrs to fix

                      Function downloadLabelFileWithHttpInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function downloadLabelFileWithHttpInfo($shipment_id)
                          {
                              $request = $this->downloadLabelFileRequest($shipment_id);
                      
                              try {
                      Severity: Minor
                      Found in src/Sell/Logistics/V1/Api/ShipmentApi.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 createFromShippingQuoteWithHttpInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function createFromShippingQuoteWithHttpInfo($create_shipment_from_quote_request)
                          {
                              $request = $this->createFromShippingQuoteRequest($create_shipment_from_quote_request);
                      
                              try {
                      Severity: Minor
                      Found in src/Sell/Logistics/V1/Api/ShipmentApi.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 getShipmentWithHttpInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getShipmentWithHttpInfo($shipment_id)
                          {
                              $request = $this->getShipmentRequest($shipment_id);
                      
                              try {
                      Severity: Minor
                      Found in src/Sell/Logistics/V1/Api/ShipmentApi.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 cancelShipmentWithHttpInfo has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function cancelShipmentWithHttpInfo($shipment_id)
                          {
                              $request = $this->cancelShipmentRequest($shipment_id);
                      
                              try {
                      Severity: Minor
                      Found in src/Sell/Logistics/V1/Api/ShipmentApi.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

                      There are no issues that match your filters.

                      Category
                      Status