pagseguro/pagseguro-php-sdk

View on GitHub

Showing 86 of 191 total issues

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

        $street = null,
        $number = null,
        $complement = null,
        $district = null,
        $postalCode = null,
Severity: Major
Found in source/Domains/Address.php - About 1 hr to fix

    Method withParameters has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $street,
            $number,
            $district,
            $postalCode,
            $city,
    Severity: Major
    Found in source/Resources/Factory/Shipping/Address.php - About 1 hr to fix

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

              $page = 1,
              $maxPageResults = 50,
              $initialDate,
              $finalDate = null,
              $status = null,
      Severity: Major
      Found in source/Domains/Requests/DirectPreApproval/QueryRequest.php - About 1 hr to fix

        Method withParameters has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $street,
                $number,
                $district,
                $postalCode,
                $city,
        Severity: Major
        Found in source/Domains/DirectPreApproval/Address.php - About 1 hr to fix

          Method withParameters has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $street,
                  $number,
                  $district,
                  $postalCode,
                  $city,
          Severity: Major
          Found in source/Resources/Factory/Sender/Address.php - About 1 hr to fix

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

                public static function getData(Requests $request, $properties)
                {
                    $data = [];
                    // sender
                    if (!is_null($request->getHolder())) {
            Severity: Minor
            Found in source/Parsers/DirectPayment/CreditCard/Holder.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 getData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function getData(Requests $request, $properties)
                {
                    $data = [];
                    // shipping
                    if (!is_null($request->getShipping())) {
            Severity: Minor
            Found in source/Parsers/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

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

                    $id,
                    $description,
                    $quantity,
                    $amount,
                    $weight = null,
            Severity: Minor
            Found in source/Resources/Factory/Item.php - About 45 mins to fix

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

                      $displayName = null,
                      $websiteURL = null,
                      Document $document = null,
                      Phone $phone = null,
                      Address $address = null,
              Severity: Minor
              Found in source/Domains/Authorization/Company.php - About 45 mins to fix

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

                    public function withParameters($id, $description, $quantity, $amount, $weight = null, $shippingCost = null)
                Severity: Minor
                Found in source/Domains/DirectPreApproval/Item.php - About 45 mins to fix

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

                      private static function address($request, $properties)
                      {
                          $data = [];
                  
                          if (!is_null($request->getStreet())) {
                  Severity: Minor
                  Found in source/Parsers/DirectPayment/CreditCard/Billing.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 address has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static function address($request, $properties)
                      {
                          $data = [];
                          if (!is_null($request->getShipping()->getAddress()->getStreet())) {
                              $data[$properties::SHIPPING_ADDRESS_STREET] = $request->getShipping()->getAddress()->getStreet();
                  Severity: Minor
                  Found in source/Parsers/Shipping.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 withParameters has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          $name,
                          $email,
                          Phone $phone,
                          Document $document,
                          $ip
                  Severity: Minor
                  Found in source/Resources/Factory/Request/DirectPayment/Sender.php - About 35 mins to fix

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

                            $name = null,
                            \DateTime $birthDate = null,
                            Document $document = null,
                            Phone $phone = null,
                            Address $address = null
                    Severity: Minor
                    Found in source/Domains/Authorization/Seller.php - About 35 mins to fix

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

                              $reference,
                              $permissions,
                              $redirectURL,
                              $notificationURL,
                              Account $account = null
                      Severity: Minor
                      Found in source/Domains/Authorization.php - About 35 mins to fix

                        Method curlConnection has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            private function curlConnection($method, $url, $timeout, $charset, $data = null)
                        Severity: Minor
                        Found in source/Resources/Http.php - About 35 mins to fix

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

                                  $name = null,
                                  \DateTime $birthDate = null,
                                  Document $document = null,
                                  Phone $phone = null,
                                  Address $address = null
                          Severity: Minor
                          Found in source/Domains/Authorization/Personal.php - About 35 mins to fix

                            Method toHash has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                private static function toHash($subject, $rule, $pattern, $mask, $options = ["prefix" => false])
                            Severity: Minor
                            Found in source/Helpers/Mask.php - About 35 mins to fix

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

                                  public function setPreApprovals($preApprovals)
                                  {
                                      if ($preApprovals) {
                                          if (is_object($preApprovals)) {
                                              self::addPreApproval($preApprovals);
                              Severity: Minor
                              Found in source/Parsers/PreApproval/Search/Result.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 setTransactions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function setTransactions($transactions)
                                  {
                                      if ($transactions) {
                                          if (is_object($transactions)) {
                                              self::addTransaction($transactions);
                              Severity: Minor
                              Found in source/Parsers/Transaction/Search/Abandoned/Response.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

                              Severity
                              Category
                              Status
                              Source
                              Language