pagseguro/magento2

View on GitHub

Showing 385 of 385 total issues

Method searchTransactions has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function searchTransactions()
    {
        try {
            $connection = $this->getConnection();
            $select = $connection->select()
Severity: Minor
Found in Model/Transactions/Method.php - About 1 hr to fix

    Method uninstall has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context)
        {
            $statuses = [
                'pagseguro_iniciado',
                'pagseguro_aguardando_pagamento',
    Severity: Minor
    Found in Setup/Uninstall.php - About 1 hr to fix

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

          } else if (
            typeof mSource === 'string' &&
            (mSource.indexOf('.') !== -1 ||
              mSource.indexOf('[') !== -1 ||
              mSource.indexOf('(') !== -1)
      Severity: Major
      Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
      view/adminhtml/web/js/jquery.dataTables.min.js on lines 2607..2686

      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

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

                    if (
                      result.paymentMethod.titleType !== undefined &&
                      result.paymentMethod.titleType !== false
                    ) {
                      listPaymentLine1.append(
      Severity: Major
      Found in view/adminhtml/web/js/public.js and 1 other location - About 1 hr to fix
      view/adminhtml/web/js/public.js on lines 671..680

      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

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

          } else if (
            typeof mSource === 'string' &&
            (mSource.indexOf('.') !== -1 ||
              mSource.indexOf('[') !== -1 ||
              mSource.indexOf('(') !== -1)
      Severity: Major
      Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 1 hr to fix
      view/adminhtml/web/js/jquery.dataTables.min.js on lines 2500..2582

      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

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

                  var c = a(this),
                      e = c.data('bs.collapse'),
                      f = a.extend({}, d.DEFAULTS, c.data(), 'object' === typeof b && b);
      Severity: Major
      Found in view/frontend/web/js/bootstrap.min.js and 1 other location - About 1 hr to fix
      view/frontend/web/js/bootstrap.min.js on lines 650..652

      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

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

                  var e = a(this),
                      f = e.data('bs.modal'),
                      g = a.extend({}, c.DEFAULTS, e.data(), 'object' === typeof b && b);
      Severity: Major
      Found in view/frontend/web/js/bootstrap.min.js and 1 other location - About 1 hr to fix
      view/frontend/web/js/bootstrap.min.js on lines 389..391

      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

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

                    if (
                      result.paymentMethod.titleCode !== undefined &&
                      result.paymentMethod.titleCode !== false
                    ) {
                      listPaymentLine1.append(
      Severity: Major
      Found in view/adminhtml/web/js/public.js and 1 other location - About 1 hr to fix
      view/adminhtml/web/js/public.js on lines 660..669

      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

      Consider simplifying this complex logical expression.
      Open

          if (
            ie67 ||
            (!userInputs &&
              !scrollX &&
              !scrollY &&
      Severity: Critical
      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

        Function activate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            (c.prototype.activate = function(b, d, e) {
                function f() {
                    g
                        .removeClass('active')
                        .find('> .dropdown-menu > .active')
        Severity: Minor
        Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

          Function Payment has 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                    url,
                    id,
                    hash,
                    document,
                    token,
          Severity: Major
          Found in view/frontend/web/js/public.js - About 1 hr to fix

            Function dateVerify has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            function dateVerify(fieldName) {
              day = fieldName.value.substring(0, 2);
              month = fieldName.value.substring(3, 5);
              year = fieldName.value.substring(6, 10);
            
            
            Severity: Minor
            Found in view/adminhtml/web/js/public.js - 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

            Function request has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                public function request()
                {
                    $this->getTransactions();
                    if (! is_null($this->_PagSeguroPaymentList->getTransactions())) {
                        $partiallyRefundedOrdersArray = $this->getPartiallyRefundedOrders();
            Severity: Minor
            Found in Model/Transactions/Methods/Refund.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

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

                placeOrder: function () {
                  var self = this;
                  var paymentData = quote.paymentMethod();
                  var messageContainer = this.messageContainer;
                  fullScreenLoader.startLoader();

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

              function formataCampo(campo, Mascara, evento) {
                var boleanoMascara;
              
                var Digitato = evento.keyCode;
                var exp = /\-|\.|\/|\(|\)| /g;
              Severity: Minor
              Found in view/frontend/web/js/model/direct-payment-validator.js - About 1 hr to fix

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

                    private function setShippingInformation()
                    {
                        $shipping = $this->_order->getShippingAddress();
                        if ($shipping) {
                            if (count($shipping->getStreet()) === 4) {
                Severity: Minor
                Found in Model/Direct/DebitMethod.php - About 1 hr to fix

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

                      private function setShippingInformation()
                      {
                          $shipping = $this->_order->getShippingAddress();
                          if ($shipping) {
                              if (count($shipping->getStreet()) === 4) {
                  Severity: Minor
                  Found in Model/Direct/BoletoMethod.php - About 1 hr to fix

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

                        private function setShippingInformation()
                        {
                            $shipping = $this->_order->getShippingAddress();
                            if ($shipping) {
                                if (count($shipping->getStreet()) === 4) {
                    Severity: Minor
                    Found in Model/Direct/CreditCardMethod.php - About 1 hr to fix

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

                        var __setColumnVis = function (settings, column, vis) {
                          var cols = settings.aoColumns,
                            col = cols[column],
                            data = settings.aoData,
                            row,
                      Severity: Minor
                      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

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

                            (c.prototype.applyPlacement = function(b, c) {
                                var d = this.tip(),
                                    e = d[0].offsetWidth,
                                    f = d[0].offsetHeight,
                                    g = parseInt(d.css('margin-top'), 10),
                        Severity: Minor
                        Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language