pagseguro/magento2

View on GitHub

Showing 385 of 385 total issues

Function Search has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      Search: function (url) {
        jQuery
          .ajax({
            url: url + '/pagseguro/abandoned/request',
            data: {
Severity: Minor
Found in view/adminhtml/web/js/public.js - About 1 hr to fix

    Function __details_events has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var __details_events = function (settings) {
        var api = new _Api(settings);
        var namespace = '.dt.DT_details';
        var drawEvent = 'draw' + namespace;
        var colvisEvent = 'column-visibility' + namespace;
    Severity: Minor
    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

      Function Installments has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              Installments: function (url, id, brand, isInternational) {
                jQuery
                  .ajax({
                    url: url + 'pagseguro/direct/installments',
                    data: {
      Severity: Minor
      Found in view/frontend/web/js/public.js - About 1 hr to fix

        Function _fnBuildHead has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function _fnBuildHead(oSettings) {
            var i, ien, cell, row, column;
            var thead = oSettings.nTHead;
            var tfoot = oSettings.nTFoot;
            var createHeader = $('th, td', thead).length === 0;
        Severity: Minor
        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

          Function _fnSortListener has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function _fnSortListener(settings, colIdx, append, callback) {
              var col = settings.aoColumns[colIdx];
              var sorting = settings.aaSorting;
              var asSorting = col.asSorting;
              var nextSortIdx;
          Severity: Minor
          Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

            Function _fnDetectHeader has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function _fnDetectHeader(aLayout, nThead) {
                var nTrs = $(nThead).children('tr');
                var nTr, nCell;
                var i, k, l, iLen, jLen, iColShifted, iColumn, iColspan, iRowspan;
                var bUnique;
            Severity: Minor
            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

              Function Search has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    Search: function (url) {
                      jQuery
                        .ajax({
                          url: url + '/pagseguro/cancellation/request',
                          data: {
              Severity: Minor
              Found in view/adminhtml/web/js/public.js - About 1 hr to fix

                Function _selector_row_indexes has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var _selector_row_indexes = function (settings, opts) {
                    var i,
                      ien,
                      tmp,
                      a = [],
                Severity: Minor
                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                  Function slide has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      (c.prototype.slide = function(b, d) {
                          var e = this.$element.find('.item.active'),
                              f = d || this.getItemForDirection(b, e),
                              g = this.interval,
                              h = 'next' === b ? 'left' : 'right',
                  Severity: Minor
                  Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

                    Method install has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
                        {
                            /**
                             * Prepare database for install
                             */
                    Severity: Minor
                    Found in Setup/InstallData.php - About 1 hr to fix

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

                          public function request()
                          {
                              //load payments by date
                              $this->getPagSeguroAbandoned();
                      
                      
                      Severity: Minor
                      Found in Model/Transactions/Methods/Abandoned.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 __row_selector has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        var __row_selector = function (settings, selector, opts) {
                          var run = function (sel) {
                            var selInt = _intVal(sel);
                            var i, ien;
                      
                      
                      Severity: Minor
                      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                        Function _fnFeatureHtmlPaginate has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function _fnFeatureHtmlPaginate(settings) {
                            var type = settings.sPaginationType,
                              plugin = DataTable.ext.pager[type],
                              modern = typeof plugin === 'function',
                              redraw = function (settings) {
                        Severity: Minor
                        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

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

                                  a(window).on('load', function() {
                                      a('[data-ride="carousel"]').each(function() {
                                          var c = a(this);
                                          b.call(c, c.data());
                                      });
                          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 1500..1505

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

                          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(window).on('load.bs.scrollspy.data-api', function() {
                                  a('[data-spy="scroll"]').each(function() {
                                      var b = a(this);
                                      c.call(b, b.data());
                                  });
                          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 370..375

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

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

                            function _fnFilterData(settings) {
                              var columns = settings.aoColumns;
                              var column;
                              var i, j, ien, jen, filterData, cellData, row;
                              var fomatters = DataTable.ext.type.search;
                          Severity: Minor
                          Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                            Function backdrop has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                (c.prototype.backdrop = function(b) {
                                    var d = this,
                                        e = this.$element.hasClass('fade') ? 'fade' : '';
                                    if (this.isShown && this.options.backdrop) {
                                        var f = a.support.transition && e;
                            Severity: Minor
                            Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                if (
                                  isNaN(day) ||
                                  day < 01 ||
                                  ((day < 01 || day > 30) &&
                                    (month === 04 || month === 06 || month === 09 || month === 11)) ||
                              Severity: Critical
                              Found in view/adminhtml/web/js/public.js - About 1 hr to fix

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

                                    placeOrder: function () {
                                      var self = this;
                                      var paymentData = quote.paymentMethod();
                                      var messageContainer = this.messageContainer;
                                      // remove previous token error message if it exists

                                  Function _fnGetCellData has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function _fnGetCellData(settings, rowIdx, colIdx, type) {
                                      var draw = settings.iDraw;
                                      var col = settings.aoColumns[colIdx];
                                      var rowData = settings.aoData[rowIdx]._aData;
                                      var defaultContent = col.sDefaultContent;
                                  Severity: Minor
                                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language