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);

                    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 1221..1228

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

Function prepareAjaxRequest has a Cognitive Complexity of 10 (exceeds 5 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

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 processVendors has 26 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/LogVendorsCountryCommand.php - About 1 hr to fix

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

    <?php
    /**
     * 2017 HiPay
     *
     * NOTICE OF LICENSE
    src/ServiceProvider/Command/LogVendorsCountryServiceProvider.php on lines 1..38

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

    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
    /**
     * 2017 HiPay
     *
     * NOTICE OF LICENSE
    src/ServiceProvider/Command/LogVendorsRecoverServiceProvider.php on lines 1..38

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

    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 create has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $email,
            $miraklId,
            $hipayId,
            $hipayUserSpaceId,
            $hipayIdentified,
    Severity: Major
    Found in src/Entity/VendorRepository.php - About 1 hr to fix

      Function processVendors has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          private function processVendors()
          {
              $vendors = $this->vendorManager->findAll();
      
              $logs = array();
      Severity: Minor
      Found in src/Command/Log/LogVendorsRecoverCommand.php - About 55 mins 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 prepareAjaxData has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 reRunAction has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function reRunAction(Request $request)
          {
              $reRunForm = $this->generateReRunForm();
      
              $settingsForm = $this->generateSettingsForm();
      Severity: Minor
      Found in src/Controller/SettingController.php - About 55 mins 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 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function __construct($miraklId = null, $action = null, $message = null, $context = null, $level = null,
                                      $levelName = null, $extra = null)
      Severity: Major
      Found in src/Entity/LogGeneral.php - About 50 mins to fix

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

                enable: function() {
                    this.$select.prop('disabled', false);
                    this.$button.prop('disabled', false)
                        .removeClass('disabled');
                },
        Severity: Minor
        Found in web/js/bootstrap-multiselect.js and 1 other location - About 50 mins to fix
        web/js/bootstrap-multiselect.js on lines 1574..1578

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

        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

                disable: function() {
                    this.$select.prop('disabled', true);
                    this.$button.prop('disabled', true)
                        .addClass('disabled');
                },
        Severity: Minor
        Found in web/js/bootstrap-multiselect.js and 1 other location - About 50 mins to fix
        web/js/bootstrap-multiselect.js on lines 1565..1569

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

        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.statusTransferts.status == -9 || data.statusTransferts.status == -10 || data.statusTransferts.status == -5) {
        Severity: Minor
        Found in web/js/custom.js and 1 other location - About 50 mins to fix
        web/js/custom.js on lines 135..137

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

        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.statusWithDrawal.status == -7 ||
                                data.statusWithDrawal.status == -8 ||
                                data.statusWithDrawal.status == -11 ||
        Severity: Minor
        Found in web/js/custom.js and 1 other location - About 50 mins to fix
        web/js/custom.js on lines 145..145

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

        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

        Avoid deeply nested control flow statements.
        Open

                                                if (this.options.enableCaseInsensitiveFiltering) {
                                                    filterCandidate = filterCandidate.toLowerCase();
                                                    this.query = this.query.toLowerCase();
                                                }
        Severity: Major
        Found in web/js/bootstrap-multiselect.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                                  if (this.options.enableFullValueFiltering && this.options.filterBehavior !== 'both') {
                                                      var valueToMatch = filterCandidate.trim().substring(0, this.query.length);
                                                      if (this.query.indexOf(valueToMatch) > -1) {
                                                          showElement = true;
                                                      }
          Severity: Major
          Found in web/js/bootstrap-multiselect.js - About 45 mins to fix

            Function processVendors has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                private function processVendors()
                {
                    $vendors = $this->vendorManager->findAll();
            
                    $logs = array();
            Severity: Minor
            Found in src/Command/Log/LogVendorsCountryCommand.php - About 45 mins 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 prepareAjaxData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function prepareAjaxData($data)
                {
                    foreach ($data as $key => $logRow) {
                        $data[$key]['date'] = $logRow['date']->format('Y-m-d H:i:s');
                        $data[$key]['statusWalletAccount'] = array(
            Severity: Minor
            Found in src/Controller/LogVendorController.php - About 45 mins 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

            Avoid deeply nested control flow statements.
            Open

                                                    if(!showElement){
                                                      $(element).css('display', 'none');
                                                      $(element).addClass('multiselect-filter-hidden');
                                                    }
            Severity: Major
            Found in web/js/bootstrap-multiselect.js - About 45 mins to fix

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

                  public function create($miraklId, $hipayId, $paymentVoucher, $amount, $originAmount, $balance)
              Severity: Minor
              Found in src/Entity/LogOperationsRepository.php - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language