PromisePay/promisepay-php

View on GitHub

Showing 33 of 72 total issues

Request has 77 functions (exceeds 20 allowed). Consider refactoring.
Open

class Request
{

    // Option constants
    const SERIALIZE_PAYLOAD_NEVER   = 0;
Severity: Major
Found in lib/Vendors/Httpful/Request.php - About 1 day to fix

    File Request.php has 583 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Httpful;
    
    use Httpful\Exception\ConnectionErrorException;
    Severity: Major
    Found in lib/Vendors/Httpful/Request.php - About 1 day to fix

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

      class Widget
      {
      
          private $_itemName;
      
      
      Severity: Major
      Found in lib/DataObjects/Widget.php - About 7 hrs to fix

        File ItemRepository.php has 412 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        namespace PromisePay;
        
        use PromisePay\DataObjects\BPayDetails;
        use PromisePay\DataObjects\Fee;
        Severity: Minor
        Found in lib/ItemRepository.php - About 5 hrs to fix

          Item has 37 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Item extends Object
          {
              /**
               * @var
               */
          Severity: Minor
          Found in lib/DataObjects/Item.php - About 4 hrs to fix

            Token has 33 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Token
            {
                /**
                 * @var
                 */
            Severity: Minor
            Found in lib/DataObjects/Token.php - About 4 hrs to fix

              Function _curlPrep has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function _curlPrep()
                  {
                      // Check for required stuff
                      if (!isset($this->uri))
                          throw new \Exception('Attempting to send a request before defining a URI endpoint.');
              Severity: Minor
              Found in lib/Vendors/Httpful/Request.php - About 4 hrs 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

              User has 31 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class User extends Object
              {
                  /**
                   * @var
                   */
              Severity: Minor
              Found in lib/DataObjects/User.php - About 3 hrs to fix

                Method _curlPrep has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _curlPrep()
                    {
                        // Check for required stuff
                        if (!isset($this->uri))
                            throw new \Exception('Attempting to send a request before defining a URI endpoint.');
                Severity: Major
                Found in lib/Vendors/Httpful/Request.php - About 3 hrs to fix

                  File UserRepository.php has 301 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  namespace PromisePay;
                  
                  use PromisePay\DataObjects\BankAccount;
                  use PromisePay\DataObjects\CardAccount;
                  Severity: Minor
                  Found in lib/UserRepository.php - About 3 hrs to fix

                    WireDetails has 25 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class WireDetails
                    {
                        private $_beneficiary;
                        private $_addressLine1;
                        private $_city;
                    Severity: Minor
                    Found in lib/DataObjects/WireDetails.php - About 2 hrs to fix

                      File Widget.php has 280 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      namespace PromisePay\DataObjects;
                      
                      /**
                       * Class Widget
                      Severity: Minor
                      Found in lib/DataObjects/Widget.php - About 2 hrs to fix

                        Company has 23 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Company extends Object
                        {
                            /**
                             * @var
                             */
                        Severity: Minor
                        Found in lib/DataObjects/Company.php - About 2 hrs to fix

                          ItemRepository has 22 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class ItemRepository extends ApiAbstract
                          {
                              public function getListOfItems($limit = 20, $offset = 0)
                              {
                                  $this->paramsListCorrect($limit,$offset);
                          Severity: Minor
                          Found in lib/ItemRepository.php - About 2 hrs to fix

                            Function _future_serializeAsXml has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function _future_serializeAsXml($value, $node = null, $dom = null)
                                {
                                    if (!$dom) {
                                        $dom = new \DOMDocument;
                                    }
                            Severity: Minor
                            Found in lib/Vendors/Httpful/Handlers/XmlHandler.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 isCorrectCountryCode has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function isCorrectCountryCode($Country)
                                {
                                    $allowedCountryCode = array(
                                        "AFG", "ALA", "ALB", "DZA", "ASM", "AND", "AGO", "AIA", "ATA",
                                        "ATG", "ARG", "ARM", "ABW", "AUS", "AUT", "AZE", "BHS", "BHR",
                            Severity: Minor
                            Found in lib/UserRepository.php - About 1 hr to fix

                              Method updateUser has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function updateUser(User $user)
                                  {
                                      $this->validateUser($user);
                              
                                      $payload = '';
                              Severity: Minor
                              Found in lib/UserRepository.php - About 1 hr to fix

                                Method createUser has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function createUser(User $user)
                                    {
                                        $this->validateUser($user);
                                        $payload = '';
                                        $preparePayload = array(
                                Severity: Minor
                                Found in lib/UserRepository.php - About 1 hr to fix

                                  Method updateItem has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function updateItem(Item $item, $user = null, $account = null, $releaseAmount = null)
                                      {
                                          $payload = '';
                                          $preparePayload = array(
                                             'id'=>$item->getId(),
                                  Severity: Minor
                                  Found in lib/ItemRepository.php - About 1 hr to fix

                                    Method createFee has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function createFee(Fee $fee)
                                        {
                                            $this->ValidateFee($fee);
                                            $payload = '';
                                            $preparePayload = array(
                                    Severity: Minor
                                    Found in lib/FeeRepository.php - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language