gabrielbull/php-ups-api

View on GitHub

Showing 141 of 176 total issues

Function createConfirmRequest has a Cognitive Complexity of 118 (exceeds 5 allowed). Consider refactoring.
Open

    private function createConfirmRequest(
        $validation,
        Shipment $shipment,
        ShipmentRequestLabelSpecification $labelSpec = null,
        ShipmentRequestReceiptSpecification $receiptSpec = null
Severity: Minor
Found in src/Shipping.php - About 2 days 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 __construct has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($response = null)
    {
        $this->Shipper = new Shipper();
        $this->ReferenceNumber = new ReferenceNumber();
        $this->Service = new Service();
Severity: Minor
Found in src/Entity/Manifest.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

Method createConfirmRequest has 248 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function createConfirmRequest(
        $validation,
        Shipment $shipment,
        ShipmentRequestLabelSpecification $labelSpec = null,
        ShipmentRequestReceiptSpecification $receiptSpec = null
Severity: Major
Found in src/Shipping.php - About 1 day to fix

    File Shipping.php has 514 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Ups;
    
    use DOMDocument;
    Severity: Major
    Found in src/Shipping.php - About 1 day to fix

      Function __construct has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct($attributes = null)
          {
              if (null !== $attributes) {
                  if (isset($attributes->AddressLine1)) {
                      $this->setAddressLine1($attributes->AddressLine1);
      Severity: Minor
      Found in src/Entity/Address.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

      Shipment has 53 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Shipment
      {
          /**
           * @var PaymentInformation
           */
      Severity: Major
      Found in src/Entity/Shipment.php - About 7 hrs to fix

        Function __construct has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __construct(\stdClass $response = null)
            {
                $this->AddressExtendedInformation = [];
        
                if (null !== $response) {
        Severity: Minor
        Found in src/Entity/UpdatedAddress.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

        HazMat has 51 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class HazMat implements NodeInterface
        {
        
            /**
             * @var string
        Severity: Major
        Found in src/Entity/HazMat.php - About 7 hrs to fix

          Address has 48 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Address implements NodeInterface
          {
              /** @deprecated */
              public $AddressLine1;
              /** @deprecated */
          Severity: Minor
          Found in src/Entity/Address.php - About 6 hrs to fix

            Function __construct has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __construct($response = null)
                {
                    $this->Service = new Service();
                    $this->BillingWeight = new BillingWeight();
                    $this->TransportationCharges = new Charges();
            Severity: Minor
            Found in src/Entity/RatedShipment.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 __construct has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __construct($response = null)
                {
                    $this->ShipmentReferenceNumber = new ShipmentReferenceNumber();
                    $this->PackageReferenceNumber = new PackageReferenceNumber();
                    $this->Service = new Service();
            Severity: Minor
            Found in src/Entity/Generic.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 __construct has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __construct($response = null)
                {
                    $this->ShipmentReferenceNumber = new ShipmentReferenceNumber();
                    $this->PackageReferenceNumber = new PackageReferenceNumber();
                    $this->ActivityLocation = new ActivityLocation();
            Severity: Minor
            Found in src/Entity/Delivery.php - About 5 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 __construct has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __construct(\stdClass $response = null)
                {
                    $this->PackageReferenceNumber = [];
                    $this->ShipmentReferenceNumber = [];
                    $this->Resolution = new Resolution();
            Severity: Minor
            Found in src/Entity/Exception.php - About 5 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 __construct has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __construct($response = null)
                {
                    $this->PackageReferenceNumber = new PackageReferenceNumber();
                    $this->ShipmentReferenceNumber = new ShipmentReferenceNumber();
                    $this->ActivityLocation = new ActivityLocation();
            Severity: Minor
            Found in src/Entity/Origin.php - About 5 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

            File Address.php has 395 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            namespace Ups\Entity;
            
            use DOMDocument;
            Severity: Minor
            Found in src/Entity/Address.php - About 5 hrs to fix

              Method __construct has 120 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function __construct($response = null)
                  {
                      $this->Shipper = new Shipper();
                      $this->ReferenceNumber = new ReferenceNumber();
                      $this->Service = new Service();
              Severity: Major
              Found in src/Entity/Manifest.php - About 4 hrs to fix

                Function __construct has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function __construct($attributes = null)
                    {
                        $this->setPackagingType(
                            new PackagingType(
                                isset($attributes->PackagingType) ? $attributes->PackagingType : null
                Severity: Minor
                Found in src/Entity/Package.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

                InternationalForms has 33 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class InternationalForms implements NodeInterface
                {
                    /**
                     * @var array
                     */
                Severity: Minor
                Found in src/Entity/InternationalForms.php - About 4 hrs to fix

                  ShipmentServiceOptions has 32 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class ShipmentServiceOptions implements NodeInterface
                  {
                      /**
                       * @var
                       */
                  Severity: Minor
                  Found in src/Entity/ShipmentServiceOptions.php - About 4 hrs to fix

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

                        public function toNode(DOMDocument $document = null)
                        {
                            if (null === $document) {
                                $document = new DOMDocument();
                            }
                    Severity: Minor
                    Found in src/Entity/HazMat.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

                    Severity
                    Category
                    Status
                    Source
                    Language