moip/moip-sdk-php

View on GitHub

Showing 29 of 40 total issues

Account has 55 functions (exceeds 20 allowed). Consider refactoring.
Open

class Account extends MoipResource
{
    /**
     * Path accounts API.
     *
Severity: Major
Found in src/Resource/Account.php - About 7 hrs to fix

    Orders has 54 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Orders extends MoipResource
    {
        /**
         * @const string
         */
    Severity: Major
    Found in src/Resource/Orders.php - About 7 hrs to fix

      Payment has 42 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Payment extends MoipResource
      {
          /**
           * @const string
           */
      Severity: Minor
      Found in src/Resource/Payment.php - About 5 hrs to fix

        File Account.php has 366 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        namespace Moip\Resource;
        
        use Moip\Exceptions\ValidationException;
        Severity: Minor
        Found in src/Resource/Account.php - About 4 hrs to fix

          File Orders.php has 326 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace Moip\Resource;
          
          use ArrayIterator;
          Severity: Minor
          Found in src/Resource/Orders.php - About 3 hrs to fix

            File Payment.php has 313 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            namespace Moip\Resource;
            
            use Requests;
            Severity: Minor
            Found in src/Resource/Payment.php - About 3 hrs to fix

              BankAccount has 24 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class BankAccount extends MoipResource
              {
                  /**
                   * Path bank accounts API.
                   *
              Severity: Minor
              Found in src/Resource/BankAccount.php - About 2 hrs to fix

                Customer has 24 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Customer extends MoipResource
                {
                    /**
                     * Path customers API.
                     *
                Severity: Minor
                Found in src/Resource/Customer.php - About 2 hrs to fix

                  Connect has 24 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Connect implements Authentication, JsonSerializable
                  {
                      /**
                       * @const string
                       */
                  Severity: Minor
                  Found in src/Auth/Connect.php - About 2 hrs to fix

                    Method populate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function populate(stdClass $response)
                        {
                            $account = clone $this;
                            $account->data->email = new stdClass();
                    
                    
                    Severity: Minor
                    Found in src/Resource/Account.php - About 1 hr to fix

                      Method populate has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function populate(stdClass $response)
                          {
                              $refund = clone $this;
                      
                              $refund->data->id = $this->getIfSet('id', $response);
                      Severity: Minor
                      Found in src/Resource/Refund.php - About 1 hr to fix

                        Method setAddress has 9 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public function setAddress($type, $street, $number, $district, $city, $state, $zip, $complement = null, $country = self::ADDRESS_COUNTRY)
                        Severity: Major
                        Found in src/Resource/Holder.php - About 1 hr to fix

                          Method addAddress has 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function addAddress($type, $street, $number, $district, $city, $state, $zip, $complement = null, $country = self::ADDRESS_COUNTRY)
                          Severity: Major
                          Found in src/Resource/Customer.php - About 1 hr to fix

                            Function httpRequest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function httpRequest($path, $method, $payload = null, $headers = [])
                                {
                                    $http_sess = $this->moip->getSession();
                                    $body = null;
                                    if ($payload !== null) {
                            Severity: Minor
                            Found in src/Resource/MoipResource.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

                            Method httpRequest has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function httpRequest($path, $method, $payload = null, $headers = [])
                                {
                                    $http_sess = $this->moip->getSession();
                                    $body = null;
                                    if ($payload !== null) {
                            Severity: Minor
                            Found in src/Resource/MoipResource.php - About 1 hr to fix

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

                                  public function addAddress($street, $number, $district, $city, $state, $zip, $complement = null, $country = self::ADDRESS_COUNTRY)
                              Severity: Major
                              Found in src/Resource/Account.php - About 1 hr to fix

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

                                    public function bankAccountPartial($amount, $type, $bankNumber, $agencyNumber, $agencyCheckNumber, $accountNumber, $accountCheckNumber, Customer $holder)
                                Severity: Major
                                Found in src/Resource/Refund.php - About 1 hr to fix

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

                                      public function setCompanyAddress($street, $number, $district, $city, $state, $zip, $complement = null, $country = self::ADDRESS_COUNTRY)
                                  Severity: Major
                                  Found in src/Resource/Account.php - About 1 hr to fix

                                    Method bankAccountDataCustomer has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        private function bankAccountDataCustomer($type, $bankNumber, $agencyNumber, $agencyCheckNumber, $accountNumber, $accountCheckNumber, Customer $holder)
                                    Severity: Major
                                    Found in src/Resource/Refund.php - About 50 mins to fix

                                      Method bankAccountFull has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          public function bankAccountFull($type, $bankNumber, $agencyNumber, $agencyCheckNumber, $accountNumber, $accountCheckNumber, Customer $holder)
                                      Severity: Major
                                      Found in src/Resource/Refund.php - About 50 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language