moip/moip-sdk-php

View on GitHub

Showing 29 of 40 total issues

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

    public function setCreditCard($expirationMonth, $expirationYear, $number, $cvc, Holder $holder, $store = true)
Severity: Minor
Found in src/Resource/Payment.php - About 45 mins to fix

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

        public function generateListPath(Pagination $pagination = null, Filters $filters = null, $params = [])
        {
            $queryParams = [];
    
            if (!is_null($pagination)) {
    Severity: Minor
    Found in src/Resource/MoipResource.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 setTransfers has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $amount,
            $bankNumber,
            $agencyNumber,
            $agencyCheckNumber,
            $accountNumber,
    Severity: Minor
    Found in src/Resource/Transfers.php - About 45 mins to fix

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

          public function before_request(&$url, &$headers, &$data, &$type, &$options)
      Severity: Minor
      Found in src/Auth/BasicAuth.php - About 35 mins to fix

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

            public function addReceiver($moipAccount, $type, $fixed = null, $percentual = null, $feePayor = false)
        Severity: Minor
        Found in src/Resource/Orders.php - About 35 mins to fix

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

              public function addItem($product, $quantity, $detail, $price, $category = 'OTHER_CATEGORIES')
          Severity: Minor
          Found in src/Resource/Orders.php - About 35 mins to fix

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

                public function before_request(&$url, &$headers, &$data, &$type, &$options)
            Severity: Minor
            Found in src/Auth/OAuth.php - About 35 mins to fix

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

                  public function setCreditCard($expirationMonth, $expirationYear, $number, $cvc, Holder $holder = null)
              Severity: Minor
              Found in src/Resource/Customer.php - About 35 mins to fix

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

                    public function setDeviceFingerprint($ip, $latitude, $longitude, $userAgent, $fingerprint)
                Severity: Minor
                Found in src/Resource/Payment.php - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language