hipay/hipay-wallet-cashout-mirakl-library

View on GitHub

Showing 83 of 101 total issues

Method createOperationsFromInvoice has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function createOperationsFromInvoice(array $invoice, VendorInterface $vendor, DateTime $cycleDate)
    {

        $operations = array();

Severity: Major
Found in src/Cashout/Initializer.php - About 2 hrs to fix

    Method process has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function process($tmpFilesPath, DateTime $lastUpdate = null)
        {
            try {
                $this->logger->info('Control Mirakl Settings', array('miraklId' => null, "action" => "Wallet creation"));
    
    
    Severity: Major
    Found in src/Vendor/Processor.php - About 2 hrs to fix

      Function handleBankInfo has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function handleBankInfo($vendorCollection, $miraklDataCollection, $tmpFilePath)
          {
              //Index mirakl Data
              $miraklDataCollection = $this->indexMiraklData($miraklDataCollection);
      
      
      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

      Function withdraw has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function withdraw(OperationInterface $operation)
          {
              try {
                  $vendor = $this->getVendor($operation);
      
      
      Severity: Minor
      Found in src/Cashout/Withdraw.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 __construct has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __construct(
              array $miraklData
          ) {
              $this->email = $miraklData['contact_informations']['email'];
              $this->controleType = 'CREDENTIALS';
      Severity: Minor
      Found in src/Api/HiPay/Model/Rest/UserAccount.php - About 1 hr to fix

        Method setNewStatus has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function setNewStatus(
                $operationId,
                $operation,
                $successStatus,
                $failStatus,
        Severity: Minor
        Found in src/Cashout/TransactionStatus.php - About 1 hr to fix

          Method getBalance has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getBalance(VendorInterface $vendor)
              {
                  $this->resetRestClient();
          
                  $this->restClient->getConfig()->setPath(
          Severity: Minor
          Found in src/Api/HiPay.php - About 1 hr to fix

            Method getAccountInfos has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getAccountInfos(UserAccount $userAccount, $vendor = null)
                {
                    $this->resetRestClient();
            
                    $this->restClient->getConfig()->setPath(
            Severity: Minor
            Found in src/Api/HiPay.php - About 1 hr to fix

              Method identification has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function identification($hipayId, $date, $status)
                  {
                      if ($status) {
                          $eventName = 'identification.notification.success';
                          $statusRequest = LogVendorsInterface::SUCCESS;
              Severity: Minor
              Found in src/Notification/Handler.php - About 1 hr to fix

                Function handleHiPayNotification has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function handleHiPayNotification($xml)
                    {
                        if (!$xml) {
                            return;
                        }
                Severity: Minor
                Found in src/Notification/Handler.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 logOperation has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function logOperation($miraklId, $paymentVoucherNumber, $status, $message)
                    {
                        $logOperation = $this->logOperationsManager->findByMiraklIdAndPaymentVoucherNumber(
                            $miraklId,
                            $paymentVoucherNumber
                Severity: Minor
                Found in src/Cashout/AbstractOperationProcessor.php - About 1 hr to fix

                  Method bankInfoValidation has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function bankInfoValidation($vendor, $date, $status)
                      {
                          // if status is OK
                          if ($status) {
                              $this->mirakl->updateOneVendor(
                  Severity: Minor
                  Found in src/Notification/Handler.php - About 1 hr to fix

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

                        private function getFileBack($fileType, $allMiraklFiles, $frontFile, $shopId, $tmpFilePath)
                        {
                    
                            try {
                                $backType = $this->getFileBackType($fileType);
                    Severity: Minor
                    Found in src/Vendor/Processor.php - About 1 hr to fix

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

                          public function controlMiraklSettings($docTypes)
                          {
                              // init mirakl settings by API Mirakl
                              $documentDto = $this->getDocumentTypesDto();
                              $countDocHiPay = count($docTypes);
                      Severity: Minor
                      Found in src/Api/Mirakl.php - About 1 hr to fix

                        Function controlMiraklSettings has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function controlMiraklSettings($docTypes)
                            {
                                // init mirakl settings by API Mirakl
                                $documentDto = $this->getDocumentTypesDto();
                                $countDocHiPay = count($docTypes);
                        Severity: Minor
                        Found in src/Api/Mirakl.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 __construct has 10 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                EventDispatcherInterface $dispatcher,
                                LoggerInterface $logger,
                                Factory $factory,
                                VendorInterface $operatorAccount,
                                VendorInterface $technicalAccount,
                        Severity: Major
                        Found in src/Cashout/Initializer.php - About 1 hr to fix

                          Method logVendor has 10 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  $miraklId,
                                  $hipayId,
                                  $login,
                                  $statusWalletAccount,
                                  $status,
                          Severity: Major
                          Found in src/Vendor/Processor.php - About 1 hr to fix

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

                                protected function withdrawalValidation($hipayId, DateTime $date, $withdrawalId, $status)
                                {
                                    $operation = $this->operationManager
                                        ->findByWithdrawalId($withdrawalId);
                            
                            
                            Severity: Minor
                            Found in src/Notification/Handler.php - About 1 hr to fix

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

                                  public function createFullUseraccountV2(UserAccount $userAccount)
                                  {
                                      $this->resetRestClient();
                              
                                      if (!$userAccount->getLocale()) {
                              Severity: Minor
                              Found in src/Api/HiPay.php - About 1 hr to fix

                                Method processInvoices has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function processInvoices(array $invoices, DateTime $cycleDate)
                                    {
                                
                                        $operations = array();
                                
                                
                                Severity: Minor
                                Found in src/Cashout/Initializer.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language