hipay/hipay-wallet-cashout-mirakl-library

View on GitHub

Showing 101 of 101 total issues

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

    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 __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

        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 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 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 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 process has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function process(DateTime $startDate, DateTime $endDate, DateTime $cycleDate)
                  {
                      $this->logger->info('Control Mirakl Settings', array('miraklId' => null, "action" => "Operations creation"));
                      // control mirakl settings
                      $boolControl = $this->getControlMiraklSettings($this->documentTypes);
              Severity: Minor
              Found in src/Cashout/Initializer.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

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

                      protected function transferValidation($transferId, $status, $notificationType)
                      {
                          $operation = $this->operationManager->findOneByTransferId($transferId);
                  
                          if (!$operation) {
                  Severity: Minor
                  Found in src/Notification/Handler.php - About 1 hr to fix

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                        public function __construct(
                            EventDispatcherInterface $dispatcher,
                            LoggerInterface $logger,
                            Factory $factory,
                            OperationManager $operationManager,
                    Severity: Major
                    Found in src/Cashout/TransactionStatus.php and 1 other location - About 1 hr to fix
                    src/Cashout/Withdraw.php on lines 46..68

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 103.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                        public function __construct(
                            EventDispatcherInterface $dispatcher,
                            LoggerInterface $logger,
                            Factory $factory,
                            OperationManager $operationManager,
                    Severity: Major
                    Found in src/Cashout/Withdraw.php and 1 other location - About 1 hr to fix
                    src/Cashout/TransactionStatus.php on lines 57..79

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 103.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    <?php
                    
                    namespace HiPay\Wallet\Mirakl\Api\HiPay\Model\Rest;
                    
                    use HiPay\Wallet\Mirakl\Service\Validation\ModelValidator;
                    Severity: Major
                    Found in src/Api/HiPay/Model/Rest/ModelAbstract.php and 1 other location - About 1 hr to fix
                    src/Api/HiPay/Model/Soap/ModelAbstract.php on lines 1..54

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 103.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    <?php
                    
                    namespace HiPay\Wallet\Mirakl\Api\HiPay\Model\Soap;
                    
                    use HiPay\Wallet\Mirakl\Service\Validation\ModelValidator;
                    Severity: Major
                    Found in src/Api/HiPay/Model/Soap/ModelAbstract.php and 1 other location - About 1 hr to fix
                    src/Api/HiPay/Model/Rest/ModelAbstract.php on lines 1..54

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 103.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                            $baseSoapUrl,
                            $baseRestUrl,
                            $login,
                            $password,
                            $entity,
                    Severity: Major
                    Found in src/Api/HiPay.php - About 1 hr to fix

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

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

                        Method executeRest has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function executeRest($command, $parameters = array())
                            {
                                $this->restClient->getConfig()->setPath(
                                    'request.options/headers/x-professional-client-origin',
                                    'hipay-mirakl-connector-v1'
                        Severity: Minor
                        Found in src/Api/HiPay.php - About 1 hr to fix

                          Method callSoap has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function callSoap($name, array $parameters)
                              {
                                  $parameters = $this->mergeLoginParametersSoap($parameters);
                                  //Make the call
                                  $response = $this->getClient($name)->$name(
                          Severity: Minor
                          Found in src/Api/HiPay.php - About 1 hr to fix

                            Method logOperation has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

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

                                  protected function createVendor(
                                      $email,
                                      $walletId,
                                      $walletSpaceId,
                                      $identified,
                              Severity: Minor
                              Found in src/Vendor/Processor.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language