pagseguro/magento2

View on GitHub

Showing 385 of 385 total issues

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

              if (
                result.promoCode !== undefined &&
                result.promoCode !== false
              ) {
                listPaymentLine2.append(
Severity: Major
Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
view/adminhtml/web/js/public.js on lines 578..584
view/adminhtml/web/js/public.js on lines 586..592
view/adminhtml/web/js/public.js on lines 594..598
view/adminhtml/web/js/public.js on lines 600..606
view/adminhtml/web/js/public.js on lines 608..617
view/adminhtml/web/js/public.js on lines 619..628
view/adminhtml/web/js/public.js on lines 630..639
view/adminhtml/web/js/public.js on lines 641..650
view/adminhtml/web/js/public.js on lines 694..703
view/adminhtml/web/js/public.js on lines 760..769

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

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

              if (
                result.lastEventDate !== undefined &&
                result.lastEventDate !== false
              ) {
                listTransactionLine2.append(
Severity: Major
Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
view/adminhtml/web/js/public.js on lines 578..584
view/adminhtml/web/js/public.js on lines 586..592
view/adminhtml/web/js/public.js on lines 594..598
view/adminhtml/web/js/public.js on lines 600..606
view/adminhtml/web/js/public.js on lines 608..617
view/adminhtml/web/js/public.js on lines 630..639
view/adminhtml/web/js/public.js on lines 641..650
view/adminhtml/web/js/public.js on lines 694..703
view/adminhtml/web/js/public.js on lines 749..758
view/adminhtml/web/js/public.js on lines 760..769

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

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

              if (result.date !== undefined && result.date !== false) {
                listTransactionLine1.append(
                  '<dl class=""><dt>Data e hora: </dt><dd>' +
                    result.date +
                    '</dd></dl>'
Severity: Major
Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
view/adminhtml/web/js/public.js on lines 586..592
view/adminhtml/web/js/public.js on lines 594..598
view/adminhtml/web/js/public.js on lines 600..606
view/adminhtml/web/js/public.js on lines 608..617
view/adminhtml/web/js/public.js on lines 619..628
view/adminhtml/web/js/public.js on lines 630..639
view/adminhtml/web/js/public.js on lines 641..650
view/adminhtml/web/js/public.js on lines 694..703
view/adminhtml/web/js/public.js on lines 749..758
view/adminhtml/web/js/public.js on lines 760..769

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

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

              if (result.type !== undefined && result.type !== false) {
                listTransactionLine1.append(
                  '<dl class=""><dt>Tipo: </dt><dd>' +
                    result.type +
                    '</dd></dl>'
Severity: Major
Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
view/adminhtml/web/js/public.js on lines 578..584
view/adminhtml/web/js/public.js on lines 594..598
view/adminhtml/web/js/public.js on lines 600..606
view/adminhtml/web/js/public.js on lines 608..617
view/adminhtml/web/js/public.js on lines 619..628
view/adminhtml/web/js/public.js on lines 630..639
view/adminhtml/web/js/public.js on lines 641..650
view/adminhtml/web/js/public.js on lines 694..703
view/adminhtml/web/js/public.js on lines 749..758
view/adminhtml/web/js/public.js on lines 760..769

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

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

              if (result.status !== undefined && result.status !== false) {
                listTransactionLine1.append(
                  '<dl><dt>Status: </dt><dd>' + result.status + '</dd></dl>'
                );
              }
Severity: Major
Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
view/adminhtml/web/js/public.js on lines 578..584
view/adminhtml/web/js/public.js on lines 586..592
view/adminhtml/web/js/public.js on lines 600..606
view/adminhtml/web/js/public.js on lines 608..617
view/adminhtml/web/js/public.js on lines 619..628
view/adminhtml/web/js/public.js on lines 630..639
view/adminhtml/web/js/public.js on lines 641..650
view/adminhtml/web/js/public.js on lines 694..703
view/adminhtml/web/js/public.js on lines 749..758
view/adminhtml/web/js/public.js on lines 760..769

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

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 (mydate.length === 2 && event.keyCode !== 8) {
    mydate = mydate + '/';
    field.value = mydate;
  }
Severity: Minor
Found in view/adminhtml/web/js/public.js and 1 other location - About 40 mins to fix
view/adminhtml/web/js/public.js on lines 921..924

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

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

                case 'last':
                  btnDisplay = lang.sLast;
                  btnClass =
                    button +
                    (page < pages - 1 ? '' : ' ' + classes.sPageButtonDisabled);
Severity: Minor
Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 40 mins to fix
view/adminhtml/web/js/jquery.dataTables.min.js on lines 14147..14152

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

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

            a.attr('data-content') ||
            ('function' === typeof b.content ? b.content.call(a[0]) : b.content)
Severity: Minor
Found in view/frontend/web/js/bootstrap.min.js and 1 other location - About 40 mins to fix
view/frontend/web/js/bootstrap.min.js on lines 1254..1255

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

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 (mydate.length === 5 && event.keyCode !== 8) {
    mydate = mydate + '/';
    field.value = mydate;
  }
Severity: Minor
Found in view/adminhtml/web/js/public.js and 1 other location - About 40 mins to fix
view/adminhtml/web/js/public.js on lines 917..920

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

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

            b.attr('data-original-title') ||
            ('function' === typeof c.title ? c.title.call(b[0]) : c.title));
Severity: Minor
Found in view/frontend/web/js/bootstrap.min.js and 1 other location - About 40 mins to fix
view/frontend/web/js/bootstrap.min.js on lines 1374..1375

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

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

                case 'next':
                  btnDisplay = lang.sNext;
                  btnClass =
                    button +
                    (page < pages - 1 ? '' : ' ' + classes.sPageButtonDisabled);
Severity: Minor
Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 40 mins to fix
view/adminhtml/web/js/jquery.dataTables.min.js on lines 14154..14159

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

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

Consider simplifying this complex logical expression.
Open

        if (
          nCell.nodeName.toUpperCase() === 'TD' ||
          nCell.nodeName.toUpperCase() === 'TH'
        ) {
          /* Get the col and rowspan attributes from the DOM and sanitise them */
Severity: Major
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

        if (
            (b[0] < 2 && b[1] < 9) ||
            (1 === b[0] && 9 === b[1] && b[2] < 1) ||
            b[0] > 3
        )
    Severity: Major
    Found in view/frontend/web/js/bootstrap.min.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                      if (i.length) {
                          var j = i.index(c.target);
                          38 === c.which && j > 0 && j--,
                              40 === c.which && j < i.length - 1 && j++, ~j || (j = 0),
                              i.eq(j).trigger('focus');
      Severity: Major
      Found in view/frontend/web/js/bootstrap.min.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

          if (Digitato !== 8) {
            // backspace
            for (i = 0; i <= TamanhoMascara; i++) {
              boleanoMascara =
                Mascara.charAt(i) === '-' ||
        Severity: Major
        Found in view/frontend/web/js/model/direct-payment-validator.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

            if (
              isNaN(year) ||
              (month === 2 &&
                (day < 01 || day > 29 || (day > 28 && parseInt((year / 4),10) !== year / 4)))
            ) {
          Severity: Major
          Found in view/adminhtml/web/js/public.js - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                            if (
                                (j[f] === a && k[m].match(/[0-9]/)) ||
                                (j[f] === b && k[m].match(/[a-zA-Z]/)) ||
                                (j[f] === c && k[m].match(/[0-9a-zA-Z]/))
                            )
            Severity: Major
            Found in view/frontend/web/js/vanillamasker.min.js - About 40 mins to fix

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

                              this.$element.on(
                                      h + '.' + this.type,
                                      this.options.selector,
                                      a.proxy(this.enter, this)
                                  ),
              Severity: Minor
              Found in view/frontend/web/js/bootstrap.min.js and 1 other location - About 40 mins to fix
              view/frontend/web/js/bootstrap.min.js on lines 970..974

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

              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

                                  this.$element.on(
                                      i + '.' + this.type,
                                      this.options.selector,
                                      a.proxy(this.leave, this)
                                  );
              Severity: Minor
              Found in view/frontend/web/js/bootstrap.min.js and 1 other location - About 40 mins to fix
              view/frontend/web/js/bootstrap.min.js on lines 965..969

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

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

                  number: function (thousands, decimal, precision, prefix, postfix) {
              Severity: Minor
              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language