hipay/hipay-wallet-cashout-mirakl-library

View on GitHub

Showing 83 of 101 total issues

File Processor.php has 815 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace HiPay\Wallet\Mirakl\Vendor;

use DateTime;
Severity: Major
Found in src/Vendor/Processor.php - About 1 day to fix

    File HiPay.php has 679 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace HiPay\Wallet\Mirakl\Api;
    
    use DateTime;
    Severity: Major
    Found in src/Api/HiPay.php - About 1 day to fix

      UserAccount has 58 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class UserAccount extends ModelAbstract
      {
          //Non mandatory properties
          /**
           * @var string
      Severity: Major
      Found in src/Api/HiPay/Model/Rest/UserAccount.php - About 1 day to fix

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

        class UserAccountDetails extends ModelAbstract
        {
            //Non mandatory properties
        
            /** @var int
        Severity: Major
        Found in src/Api/HiPay/Model/Soap/UserAccountDetails.php - About 7 hrs to fix

          Method transferFiles has 160 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function transferFiles(array $shopIds, $tmpFilePath)
              {
                  if (count($shopIds) > 0) {
                      // Fetches all Mirakl file names
                      $allMiraklFiles = array();
          Severity: Major
          Found in src/Vendor/Processor.php - About 6 hrs to fix

            Function transferFiles has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

                public function transferFiles(array $shopIds, $tmpFilePath)
                {
                    if (count($shopIds) > 0) {
                        // Fetches all Mirakl file names
                        $allMiraklFiles = array();
            Severity: Minor
            Found in src/Vendor/Processor.php - About 5 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

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

            class HiPay implements ApiInterface
            {
                /** @var  string the hipay webservice login */
                protected $login;
            
            
            Severity: Minor
            Found in src/Api/HiPay.php - About 4 hrs to fix

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

              class Processor extends AbstractApiProcessor
              {
                  /** @var VendorManagerInterface */
                  protected $vendorManager;
              
              
              Severity: Minor
              Found in src/Vendor/Processor.php - About 4 hrs to fix

                Method registerWallets has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function registerWallets($miraklData)
                    {
                        $vendorCollection = array();
                
                        foreach ($miraklData as $vendorData) {
                Severity: Major
                Found in src/Vendor/Processor.php - About 4 hrs to fix

                  Method withdraw has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function withdraw(OperationInterface $operation)
                      {
                          try {
                              $vendor = $this->getVendor($operation);
                  
                  
                  Severity: Major
                  Found in src/Cashout/Withdraw.php - About 3 hrs to fix

                    File Handler.php has 321 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    namespace HiPay\Wallet\Mirakl\Notification;
                    
                    use DateTime;
                    Severity: Minor
                    Found in src/Notification/Handler.php - About 3 hrs to fix

                      File UserAccount.php has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      namespace HiPay\Wallet\Mirakl\Api\HiPay\Model\Rest;
                      
                      use HiPay\Wallet\Mirakl\Service\Country;
                      Severity: Minor
                      Found in src/Api/HiPay/Model/Rest/UserAccount.php - About 3 hrs to fix

                        Method transfer has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function transfer(OperationInterface $operation)
                            {
                                try {
                                    $vendor = $this->getVendor($operation);
                        
                        
                        Severity: Major
                        Found in src/Cashout/Transfer.php - About 3 hrs to fix

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

                          <?php
                          
                          namespace HiPay\Wallet\Mirakl\Cashout;
                          
                          use DateTime;
                          Severity: Minor
                          Found in src/Cashout/Initializer.php - About 3 hrs to fix

                            Method handleHiPayNotification has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function handleHiPayNotification($xml)
                                {
                                    if (!$xml) {
                                        return;
                                    }
                            Severity: Major
                            Found in src/Notification/Handler.php - About 2 hrs to fix

                              File UserAccountDetails.php has 272 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              
                              namespace HiPay\Wallet\Mirakl\Api\HiPay\Model\Soap;
                              
                              use HiPay\Wallet\Mirakl\Service\Country;
                              Severity: Minor
                              Found in src/Api/HiPay/Model/Soap/UserAccountDetails.php - About 2 hrs to fix

                                Method handleBankInfo has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function handleBankInfo($vendorCollection, $miraklDataCollection, $tmpFilePath)
                                    {
                                        //Index mirakl Data
                                        $miraklDataCollection = $this->indexMiraklData($miraklDataCollection);
                                
                                
                                Severity: Major
                                Found in src/Vendor/Processor.php - About 2 hrs to fix

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

                                  class BankInfo extends ModelAbstract
                                  {
                                      /**
                                       * @var string
                                       *
                                  Severity: Minor
                                  Found in src/Api/HiPay/Model/Soap/BankInfo.php - About 2 hrs to fix

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

                                    class BankInfo extends ModelAbstract
                                    {
                                        /**
                                         * @var string
                                         *
                                    Severity: Minor
                                    Found in src/Api/HiPay/Model/Rest/BankInfo.php - About 2 hrs to fix

                                      Function registerWallets has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          public function registerWallets($miraklData)
                                          {
                                              $vendorCollection = array();
                                      
                                              foreach ($miraklData as $vendorData) {
                                      Severity: Minor
                                      Found in src/Vendor/Processor.php - About 2 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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language