hipay/hipay-wallet-cashout-mirakl-integration

View on GitHub

Showing 114 of 114 total issues

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

                        else {
                            $(input).prop('checked', false);
                            $(input).closest('li')
                                .removeClass(this.options.selectedClass);

Severity: Major
Found in web/js/bootstrap-multiselect.js and 1 other location - About 1 hr to fix
web/js/bootstrap-multiselect.js on lines 800..806

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 62.

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

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $batch = new Batch($this->getName());
        $this->batchManager->save($batch);

Severity: Minor
Found in src/Command/Cashout/GenerateCommand.php - About 1 hr to fix

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

        private function getStatusLabel($status)
        {
            switch ($status) {
                case Status::WITHDRAW_FAILED:
                    return $this->translator->trans('withdraw.request.failed');
    Severity: Minor
    Found in src/Controller/LogOperationsController.php - About 1 hr to fix

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

          protected function prepareAjaxRequest($queryBuilder, $search, $custom)
          {
      
              if (!empty($search)) {
                  $queryBuilder->where(
      Severity: Minor
      Found in src/Entity/LogGeneralRepository.php - About 1 hr to fix

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

            private function getDefaultSettingsParams()
            {
                $reRunForm = $this->generateReRunForm();
        
                $settingsForm = $this->generateSettingsForm();
        Severity: Minor
        Found in src/Controller/SettingController.php - About 1 hr to fix

          Function buildSelectAll has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  buildSelectAll: function() {
                      if (typeof this.options.selectAllValue === 'number') {
                          this.options.selectAllValue = this.options.selectAllValue.toString();
                      }
          
          
          Severity: Minor
          Found in web/js/bootstrap-multiselect.js - About 1 hr to fix

            Method reRunAction has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function reRunAction(Request $request)
                {
                    $reRunForm = $this->generateReRunForm();
            
                    $settingsForm = $this->generateSettingsForm();
            Severity: Minor
            Found in src/Controller/SettingController.php - About 1 hr to fix

              Function select has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      select: function(selectValues, triggerOnChange) {
                          if(!$.isArray(selectValues)) {
                              selectValues = [selectValues];
                          }
              
              
              Severity: Minor
              Found in web/js/bootstrap-multiselect.js - About 1 hr to fix

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

                    private function processVendors()
                    {
                        $vendors = $this->vendorManager->findAll();
                
                        $logs = array();
                Severity: Minor
                Found in src/Command/Log/LogVendorsRecoverCommand.php - About 1 hr to fix

                  Function buttonText has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              buttonText: function(options, select) {
                                  if (this.disabledText.length > 0
                                          && (select.prop('disabled') || (options.length == 0 && this.disableIfEmpty)))  {
                  
                                      return this.disabledText;
                  Severity: Minor
                  Found in web/js/bootstrap-multiselect.js - About 1 hr to fix

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

                        protected function prepareAjaxData($data)
                        {
                            foreach ($data as $key => $logRow) {
                                $data[$key]['startedAt'] = $logRow['startedAt']->format('Y-m-d H:i:s');
                    
                    
                    Severity: Minor
                    Found in src/Controller/BatchController.php - About 1 hr to fix

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

                          public function getCycleDate(array $cycleDays, DateTime $cronDate)
                          {
                              $currentDay = (int) date('j', $cronDate->getTimestamp());
                              $currentMonth = (int) date('n', $cronDate->getTimestamp());
                              $currentYear = (int) date('Y', $cronDate->getTimestamp());
                      Severity: Minor
                      Found in src/Command/Cashout/GenerateCommand.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/Entity/LogVendorsRepository.php - About 1 hr to fix

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

                                  LoggerInterface $logger,
                                  CashoutInitializer $processor,
                                  array $cycleDays,
                                  $cycleHour,
                                  $cycleMinute,
                          Severity: Major
                          Found in src/Command/Cashout/GenerateCommand.php - About 1 hr to fix

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

                                    $miraklId = null,
                                    $hipayId = null,
                                    $login = null,
                                    $statusWalletAccount = null,
                                    $status = null,
                            Severity: Major
                            Found in src/Entity/LogVendors.php - About 1 hr to fix

                              Function selectAll has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      selectAll: function (justVisible, triggerOnSelectAll) {
                              
                                          var justVisible = typeof justVisible === 'undefined' ? true : justVisible;
                                          var allLis = $("li:not(.divider):not(.disabled):not(.multiselect-group)", this.$ul);
                                          var visibleLis = $("li:not(.divider):not(.disabled):not(.multiselect-group):not(.multiselect-filter-hidden):not(.multiselect-collapisble-hidden)", this.$ul).filter(':visible');
                              Severity: Minor
                              Found in web/js/bootstrap-multiselect.js - About 1 hr to fix

                                Function deselectAll has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        deselectAll: function (justVisible, triggerOnDeselectAll) {
                                
                                            var justVisible = typeof justVisible === 'undefined' ? true : justVisible;
                                            var allLis = $("li:not(.divider):not(.disabled):not(.multiselect-group)", this.$ul);
                                            var visibleLis = $("li:not(.divider):not(.disabled):not(.multiselect-group):not(.multiselect-filter-hidden):not(.multiselect-collapisble-hidden)", this.$ul).filter(':visible');
                                Severity: Minor
                                Found in web/js/bootstrap-multiselect.js - About 1 hr to fix

                                  Function deselect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          deselect: function(deselectValues, triggerOnChange) {
                                              if(!$.isArray(deselectValues)) {
                                                  deselectValues = [deselectValues];
                                              }
                                  
                                  
                                  Severity: Minor
                                  Found in web/js/bootstrap-multiselect.js - About 1 hr to fix

                                    Method register has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function register(Application $app)
                                        {
                                            $app['vendors.repository'] = $app->share(function ($app) {
                                                return $app['orm.em']->getRepository('HiPay\\Wallet\\Mirakl\\Integration\\Entity\\Vendor');
                                            });
                                    Severity: Minor
                                    Found in src/ServiceProvider/RepositoriesServiceProvider.php - About 1 hr to fix

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

                                                      if ($elem.is(':selected')) {
                                                          $input.prop('checked', true);
                                      
                                                          if (this.options.selectedClass) {
                                                              $input.closest('li')
                                      Severity: Major
                                      Found in web/js/bootstrap-multiselect.js and 1 other location - About 1 hr to fix
                                      web/js/bootstrap-multiselect.js on lines 1229..1236

                                      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 57.

                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language