gabrielbull/php-ups-api

View on GitHub

Showing 141 of 176 total issues

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

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

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

    public function __construct(\stdClass $response = null)
    {
        $this->SubscriptionStatus = new SubscriptionStatus();
        $this->DateRange = new DateRange();

Severity: Minor
Found in src/Entity/SubscriptionEvents.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

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

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

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

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

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

    private function createRecoverLabelRequest($trackingData, $labelSpecificationOpts = null, $labelDeliveryOpts = null, $translateOpts = null)
    {
        $xml = new DOMDocument();
        $xml->formatOutput = true;

Severity: Minor
Found in src/Shipping.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

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

    private function createRequest()
    {
        $xml = new DOMDocument();
        $xml->formatOutput = true;

Severity: Minor
Found in src/SimpleAddressValidation.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

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

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

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

    public function __construct(\stdClass $response = null)
    {
        $this->AddressArtifactFormat = new AddressArtifactFormat();

        if (null !== $response) {
Severity: Minor
Found in src/Entity/DeliveryLocation.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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct($accessKey = null, $userId = null, $password = null, $useIntegration = false, RequestInterface $request = null, LoggerInterface $logger = null)
Severity: Minor
Found in src/QuantumView.php - About 45 mins to fix

    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $accessKey = null,
            $userId = null,
            $password = null,
            $useIntegration = false,
            RequestInterface $request = null,
    Severity: Minor
    Found in src/AddressValidation.php - About 45 mins to fix

      Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $accessKey = null,
              $userId = null,
              $password = null,
              $useIntegration = false,
              RequestInterface $request = null,
      Severity: Minor
      Found in src/SimpleAddressValidation.php - About 45 mins to fix

        Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $accessKey = null,
                $userId = null,
                $password = null,
                $useIntegration = false,
                RequestInterface $request = null,
        Severity: Minor
        Found in src/Tradeability.php - About 45 mins to fix

          Function addPackages has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function addPackages(stdClass $shipment, DOMNode $node)
              {
                  foreach ($shipment->Package as $package) {
                      $packageNode = $node->appendChild($node->ownerDocument->createElement('Package'));
          
          
          Severity: Minor
          Found in src/Utilities.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

          Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function __construct($accessKey = null, $userId = null, $password = null, $useIntegration = false, RequestInterface $request = null, LoggerInterface $logger = null)
          Severity: Minor
          Found in src/TimeInTransit.php - About 45 mins to fix

            Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function __construct($accessKey = null, $userId = null, $password = null, $useIntegration = false, RequestInterface $request = null, LoggerInterface $logger = null)
            Severity: Minor
            Found in src/Locator.php - About 45 mins to fix

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

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

              Function createRequest has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function createRequest()
                  {
                      $xml = new DOMDocument();
                      $xml->formatOutput = true;
              
              
              Severity: Minor
              Found in src/QuantumView.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

              Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function __construct($accessKey = null, $userId = null, $password = null, $useIntegration = false, RequestInterface $request = null, LoggerInterface $logger = null)
              Severity: Minor
              Found in src/Shipping.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if ($rec->getBillShipper()->getCreditCard()->getAddress()) {
                                            $ccNode->appendChild($rec->getBillShipper()->getCreditCard()->getAddress()->toNode($xml));
                                        }
                Severity: Major
                Found in src/Shipping.php - About 45 mins to fix

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

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

                  Severity
                  Category
                  Status
                  Source
                  Language