pagseguro/pagseguro-php-sdk

View on GitHub

Showing 191 of 191 total issues

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      <?php
      /**
       * 2007-2016 [PagSeguro Internet Ltda.]
       *
       * NOTICE OF LICENSE
      Severity: Minor
      Found in source/Resources/Factory/Shipping/AddressRequired.php and 1 other location - About 50 mins to fix
      source/Resources/Factory/Shipping/Type.php on lines 1..63

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      <?php
      /**
       * 2007-2016 [PagSeguro Internet Ltda.]
       *
       * NOTICE OF LICENSE
      Severity: Minor
      Found in source/Resources/Factory/Shipping/Type.php and 1 other location - About 50 mins to fix
      source/Resources/Factory/Shipping/AddressRequired.php on lines 1..64

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      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

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            <?php
            /**
             * 2007-2016 [PagSeguro Internet Ltda.]
             *
             * NOTICE OF LICENSE
            Severity: Major
            Found in public/Authorization/Search/searchAuthorizationByDate.php and 3 other locations - About 40 mins to fix
            public/PreApproval/Search/searchPreApprovalByDate.php on lines 1..46
            public/Transactions/Search/searchTransactionByDate.php on lines 1..46
            public/Transactions/Search/searchTransactionsAbandoned.php on lines 1..46

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 93.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            <?php
            /**
             * 2007-2016 [PagSeguro Internet Ltda.]
             *
             * NOTICE OF LICENSE
            Severity: Major
            Found in public/Transactions/Search/searchTransactionsAbandoned.php and 3 other locations - About 40 mins to fix
            public/Authorization/Search/searchAuthorizationByDate.php on lines 1..46
            public/PreApproval/Search/searchPreApprovalByDate.php on lines 1..46
            public/Transactions/Search/searchTransactionByDate.php on lines 1..46

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 93.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            <?php
            /**
             * 2007-2016 [PagSeguro Internet Ltda.]
             *
             * NOTICE OF LICENSE
            Severity: Major
            Found in public/Transactions/Search/searchTransactionByDate.php and 3 other locations - About 40 mins to fix
            public/Authorization/Search/searchAuthorizationByDate.php on lines 1..46
            public/PreApproval/Search/searchPreApprovalByDate.php on lines 1..46
            public/Transactions/Search/searchTransactionsAbandoned.php on lines 1..46

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 93.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 4 locations. Consider refactoring.
            Open

            <?php
            /**
             * 2007-2016 [PagSeguro Internet Ltda.]
             *
             * NOTICE OF LICENSE
            Severity: Major
            Found in public/PreApproval/Search/searchPreApprovalByDate.php and 3 other locations - About 40 mins to fix
            public/Authorization/Search/searchAuthorizationByDate.php on lines 1..46
            public/Transactions/Search/searchTransactionByDate.php on lines 1..46
            public/Transactions/Search/searchTransactionsAbandoned.php on lines 1..46

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 93.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            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
                      Severity
                      Category
                      Status
                      Source
                      Language