hipay/hipay-wallet-cashout-mirakl-integration

View on GitHub

Showing 114 of 114 total issues

File bootstrap-multiselect.js has 1156 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Bootstrap Multiselect (http://davidstutz.de/bootstrap-multiselect/)
 *
 * Apache License, Version 2.0:
 * Copyright (c) 2012 - 2017 David Stutz
Severity: Major
Found in web/js/bootstrap-multiselect.js - About 2 days to fix

    Similar blocks of code found in 2 locations. 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: Major
    Found in web/js/bootstrap-multiselect.js and 1 other location - About 2 days to fix
    web/js/bootstrap-multiselect.js on lines 1427..1463

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

    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

            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: Major
    Found in web/js/bootstrap-multiselect.js and 1 other location - About 2 days to fix
    web/js/bootstrap-multiselect.js on lines 1382..1418

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

    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

    Function buildDropdownOptions has 220 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            buildDropdownOptions: function() {
    
                this.$select.children().each($.proxy(function(index, element) {
    
                    var $element = $(element);
    Severity: Major
    Found in web/js/bootstrap-multiselect.js - About 1 day to fix

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

      <?php
      
      namespace HiPay\Wallet\Mirakl\Integration\Command\Cashout;
      
      use Exception;
      Severity: Major
      Found in src/Command/Cashout/WithdrawCommand.php and 2 other locations - About 6 hrs to fix
      src/Command/Cashout/TransactionStatusCommand.php on lines 1..52
      src/Command/Cashout/TransferCommand.php on lines 1..53

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

      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 3 locations. Consider refactoring.
      Open

      <?php
      
      namespace HiPay\Wallet\Mirakl\Integration\Command\Cashout;
      
      use Exception;
      Severity: Major
      Found in src/Command/Cashout/TransferCommand.php and 2 other locations - About 6 hrs to fix
      src/Command/Cashout/TransactionStatusCommand.php on lines 1..52
      src/Command/Cashout/WithdrawCommand.php on lines 1..52

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

      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 3 locations. Consider refactoring.
      Open

      <?php
      
      namespace HiPay\Wallet\Mirakl\Integration\Command\Cashout;
      
      use Exception;
      Severity: Major
      Found in src/Command/Cashout/TransactionStatusCommand.php and 2 other locations - About 6 hrs to fix
      src/Command/Cashout/TransferCommand.php on lines 1..53
      src/Command/Cashout/WithdrawCommand.php on lines 1..52

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

      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

                      else if (this.numberDisplayed != 0 && options.length > this.numberDisplayed) {
                          return options.length + ' ' + this.nSelectedText;
                      }
                      else {
                          var selected = '';
      Severity: Major
      Found in web/js/bootstrap-multiselect.js and 1 other location - About 4 hrs to fix
      web/js/bootstrap-multiselect.js on lines 295..307

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

      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

                      if (options.length === 0) {
                          return this.nonSelectedText;
                      }
                      else {
                          var selected = '';
      Severity: Major
      Found in web/js/bootstrap-multiselect.js and 1 other location - About 4 hrs to fix
      web/js/bootstrap-multiselect.js on lines 272..285

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

      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

                          if (data.status.status == 3 || data.status.status == 4) {
                              $('td', row).eq(2).addClass('danger');
                          } else if (data.status.status == 1 || data.status.status == 3) {
                              $('td', row).eq(2).addClass('success');
                          }
      Severity: Major
      Found in web/js/custom.js and 1 other location - About 4 hrs to fix
      web/js/custom.js on lines 49..53

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

      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

                          if (data.statusWalletAccount.status == 2 || data.statusWalletAccount.status == 4) {
                              $('td', row).eq(3).addClass('danger');
                          } else if (data.statusWalletAccount.status == 1 || data.statusWalletAccount.status == 3) {
                              $('td', row).eq(3).addClass('success');
                          }
      Severity: Major
      Found in web/js/custom.js and 1 other location - About 4 hrs to fix
      web/js/custom.js on lines 54..58

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

      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

                      if (allBindings.has('value')) {
                          var value = allBindings.get('value');
                          if (ko.isObservable(value)) {
                              ko.computed({
                                  read: function() {
      Severity: Major
      Found in web/js/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
      web/js/bootstrap-multiselect.js on lines 106..119

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

      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

                      if (allBindings.has('selectedOptions')) {
                          var selectedOptions = allBindings.get('selectedOptions');
                          if (ko.isObservable(selectedOptions)) {
                              ko.computed({
                                  read: function() {
      Severity: Major
      Found in web/js/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
      web/js/bootstrap-multiselect.js on lines 89..102

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

      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

      Function buildFilter has 93 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              buildFilter: function() {
      
                  // Build filter if filtering OR case insensitive filtering is enabled and the number of options exceeds (or equals) enableFilterLength.
                  if (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering) {
                      var enableFilterLength = Math.max(this.options.enableFiltering, this.options.enableCaseInsensitiveFiltering);
      Severity: Major
      Found in web/js/bootstrap-multiselect.js - About 3 hrs to fix

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

                getOptionByValue: function (value) {
        
                    var options = $('option', this.$select);
                    var valueToCompare = value.toString();
        
        
        Severity: Major
        Found in web/js/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
        web/js/bootstrap-multiselect.js on lines 1716..1727

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

        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

                getInputByValue: function (value) {
        
                    var checkboxes = $('li input:not(.multiselect-search)', this.$ul);
                    var valueToCompare = value.toString();
        
        
        Severity: Major
        Found in web/js/bootstrap-multiselect.js and 1 other location - About 3 hrs to fix
        web/js/bootstrap-multiselect.js on lines 1697..1708

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

        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

        Operation has 29 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Operation implements OperationInterface
        {
            /**
             * @var int
             * @ORM\Id
        Severity: Minor
        Found in src/Entity/Operation.php - About 3 hrs to fix

          Function init has 85 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      init: function(element, valueAccessor, allBindings, viewModel, bindingContext) {
                          var $element = $(element);
                          var config = ko.toJS(valueAccessor());
          
                          $element.multiselect(config);
          Severity: Major
          Found in web/js/bootstrap-multiselect.js - About 3 hrs to fix

            Function is_writable_r has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                private function is_writable_r($dir)
                {
                    if (is_dir($dir)) {
                        if (is_writable($dir)) {
                            $objects = scandir($dir);
            Severity: Minor
            Found in src/Controller/SettingController.php - About 3 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

            LogVendors has 24 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class LogVendors implements LogVendorsInterface
            {
                /**
                 * @var int
                 *
            Severity: Minor
            Found in src/Entity/LogVendors.php - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language