pagseguro/magento2

View on GitHub

Showing 261 of 385 total issues

Function _fnBrowserDetect has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function _fnBrowserDetect(settings) {
    // We don't need to do this every time DataTables is constructed, the values
    // calculated are specific to the browser and OS configuration which we
    // don't expect to change between initialisations
    if (!DataTable.__browser) {
Severity: Minor
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

    Function validateCpf has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function validateCpf(self) {
      var cpf = unmask(self.value);
      var numeros, digitos, soma, i, resultado, digitos_iguais;
      digitos_iguais = 1;
      if (cpf.length < 11) {
    Severity: Minor
    Found in view/frontend/web/js/model/direct-payment-validator.js - About 1 hr to fix

      Function show has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          (d.prototype.show = function() {
              if (!this.transitioning && !this.$element.hasClass('in')) {
                  var b,
                      e =
                      this.$parent &&
      Severity: Minor
      Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

        Function show has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            (c.prototype.show = function(b) {
                var d = this,
                    e = a.Event('show.bs.modal', { relatedTarget: b });
                this.$element.trigger(e),
                    this.isShown ||
        Severity: Minor
        Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

          Function Transport has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                Transport: function (url) {
                  var t = jQuery('#pagseguro-datatable').DataTable();
                  var rows = jQuery('#pagseguro-datatable').find(
                    '[data-target=abandoned]:checked'
                  );
          Severity: Minor
          Found in view/adminhtml/web/js/public.js - About 1 hr to fix

            Function _fnFilterComplete has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function _fnFilterComplete(oSettings, oInput, iForce) {
                var oPrevSearch = oSettings.oPreviousSearch;
                var aoPrevSearch = oSettings.aoPreSearchCols;
                var fnSaveFilter = function (oFilter) {
                  /* Save the filtering values */
            Severity: Minor
            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

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

                  placeOrder: function () {
                    var self = this;
                    var paymentData = quote.paymentMethod();
                    var messageContainer = this.messageContainer;
                    PagSeguroDirectPayment.setSessionId(
              Severity: Minor
              Found in view/frontend/web/js/view/payment/method-renderer/boleto-method.js - About 1 hr to fix

                Function Conciliate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      Conciliate: function (url) {
                        var t = jQuery('#pagseguro-datatable').DataTable();
                        var rows = jQuery('#pagseguro-datatable').find(
                          '[data-target=conciliation]:checked'
                        );
                Severity: Minor
                Found in view/adminhtml/web/js/public.js - About 1 hr to fix

                  Function _fnInvalidate has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function _fnInvalidate(settings, rowIdx, src, colIdx) {
                      var row = settings.aoData[rowIdx];
                      var i, ien;
                      var cellWrite = function (cell, col) {
                        // This is very frustrating, but in IE if you just write directly
                  Severity: Minor
                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                    Method __construct has 12 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                            \Magento\Framework\App\ResourceConnection $resourceConnection,
                            \Magento\Framework\Model\ResourceModel\Db\Context $context,
                            \Magento\Backend\Model\Session $session,
                            \Magento\Sales\Model\Order $order,
                    Severity: Major
                    Found in Model/Transactions/Methods/Transactions.php - About 1 hr to fix

                      Function fetchData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            var fetchData = function (data, type, src) {
                              var arrayNotation, funcNotation, out, innerSrc;
                      
                              if (src !== '') {
                                var a = _fnSplitObjNotation(src);
                      Severity: Minor
                      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                        Function setData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              var setData = function (data, val, src) {
                                var a = _fnSplitObjNotation(src),
                                  b;
                                var aLast = a[a.length - 1];
                                var arrayNotation, funcNotation, o, innerSrc;
                        Severity: Minor
                        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                          Function finishOrder has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              finishOrder: function (self, paymentData, messageContainer, pagseguroHash) {
                                $.when(
                                  setPaymentInformationAction(messageContainer, {
                                    method: self.getCode(),
                                    additional_data: {

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

                                private function setShippingInformation()
                                {
                                    if ($this->_checkoutSession->getLastRealOrder()->getIsVirtual()) {
                                        $this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('false');
                                    } else {
                            Severity: Minor
                            Found in Model/PaymentMethod.php - About 1 hr to fix

                              Function getPaymentStatusToString has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function getPaymentStatusToString($key)
                                  {
                              
                                      if (array_key_exists($key, self::$statusList)) {
                                          switch ($key) {
                              Severity: Minor
                              Found in Helper/Data.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 _selector_run has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                var _selector_run = function (type, selector, selectFn, settings, opts) {
                                  var out = [],
                                    res,
                                    a,
                                    i,
                              Severity: Minor
                              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                                Function _fnApplyColumnDefs has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  function _fnApplyColumnDefs(oSettings, aoColDefs, aoCols, fn) {
                                    var i, iLen, j, jLen, k, kLen, def;
                                    var columns = oSettings.aoColumns;
                                
                                    // Column definitions with aTargets
                                Severity: Minor
                                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                                  Function _fnFeatureHtmlLength has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function _fnFeatureHtmlLength(settings) {
                                      var classes = settings.oClasses,
                                        tableId = settings.sTableId,
                                        menu = settings.aLengthMenu,
                                        d2 = $.isArray(menu[0]),
                                  Severity: Minor
                                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                                    Function _fnPageChange has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      function _fnPageChange(settings, action, redraw) {
                                        var start = settings._iDisplayStart,
                                          len = settings._iDisplayLength,
                                          records = settings.fnRecordsDisplay();
                                    
                                    
                                    Severity: Minor
                                    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                                      Method getPaymentStatusToString has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public static function getPaymentStatusToString($key)
                                          {
                                      
                                              if (array_key_exists($key, self::$statusList)) {
                                                  switch ($key) {
                                      Severity: Minor
                                      Found in Helper/Data.php - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language