pagseguro/magento2

View on GitHub

Showing 385 of 385 total issues

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

    public function __construct(
        \Magento\Directory\Api\CountryInformationAcquirerInterface $countryInformation,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
        \Magento\Framework\Module\ModuleList $moduleList,
        \Magento\Sales\Model\Order $order,
Severity: Major
Found in Model/Direct/BoletoMethod.php and 1 other location - About 1 hr to fix
Model/Direct/DebitMethod.php on lines 70..89

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

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

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

    public function __construct(
        \Magento\Directory\Api\CountryInformationAcquirerInterface $countryInformation,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
        \Magento\Framework\Module\ModuleList $moduleList,
        \Magento\Sales\Model\Order $order,
Severity: Major
Found in Model/Direct/DebitMethod.php and 1 other location - About 1 hr to fix
Model/Direct/BoletoMethod.php on lines 70..89

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

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

  function _fnSortAria(settings) {
    var label;
    var nextSort;
    var columns = settings.aoColumns;
    var aSort = _fnSortFlatten(settings);
Severity: Minor
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

    Function dateVerify has 29 lines of code (exceeds 25 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

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

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

        Function events has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              events: function () {
                a.on('keydown.mask', function (c) {
                  a.data('mask-keycode', c.keyCode || c.which);
                })
                  .on(
        Severity: Minor
        Found in view/frontend/web/js/jquery.mask.min.js - About 1 hr to fix

          Function _fnUpdateInfo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function _fnUpdateInfo(settings) {
              /* Show information about the table */
              var nodes = settings.aanFeatures.i;
              if (nodes.length === 0) {
                return;
          Severity: Minor
          Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

            Method execute has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function execute()
                {
            
                    //$cardInternational = $this->getRequest()->getParam('card_international');
            
            
            Severity: Minor
            Found in Controller/Direct/CreditCard.php - About 1 hr to fix

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

                          c ||
                          ((c = new this.constructor(
                                  b.currentTarget,
                                  this.getDelegateOptions()
                              )),
              Severity: Major
              Found in view/frontend/web/js/bootstrap.min.js and 2 other locations - About 1 hr to fix
              view/frontend/web/js/bootstrap.min.js on lines 1043..1048
              view/frontend/web/js/bootstrap.min.js on lines 1288..1293

              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

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

                          (c ||
                              ((c = new this.constructor(
                                      b.currentTarget,
                                      this.getDelegateOptions()
                                  )),
              Severity: Major
              Found in view/frontend/web/js/bootstrap.min.js and 2 other locations - About 1 hr to fix
              view/frontend/web/js/bootstrap.min.js on lines 1013..1018
              view/frontend/web/js/bootstrap.min.js on lines 1288..1293

              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

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

                              c ||
                              ((c = new this.constructor(
                                      b.currentTarget,
                                      this.getDelegateOptions()
                                  )),
              Severity: Major
              Found in view/frontend/web/js/bootstrap.min.js and 2 other locations - About 1 hr to fix
              view/frontend/web/js/bootstrap.min.js on lines 1013..1018
              view/frontend/web/js/bootstrap.min.js on lines 1043..1048

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

                function _addNumericSort(decimalPlace) {
                  $.each(
                    {
                      // Plain numbers
                      num: function (d) {
              Severity: Minor
              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                Function extend has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  _Api.extend = function (scope, obj, ext) {
                    // Only extend API instances and static properties of the API
                    if (!ext.length || !obj || (!(obj instanceof _Api) && !obj.__dt_wrapper)) {
                      return;
                    }
                Severity: Minor
                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                  Function _fnAjaxUpdateDraw has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function _fnAjaxUpdateDraw(settings, json) {
                      // v1.10 uses camelCase variables, while 1.9 uses Hungarian notation.
                      // Support both
                      var compat = function (old, modern) {
                        return json[old] !== undefined ? json[old] : json[modern];
                  Severity: Minor
                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                    Function _fnFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function _fnFilter(settings, input, force, regex, smart, caseInsensitive) {
                        var rpSearch = _fnFilterCreateSearch(input, regex, smart, caseInsensitive);
                        var prevSearch = settings.oPreviousSearch.sSearch;
                        var displayMaster = settings.aiDisplayMaster;
                        var display, invalidated, i;
                    Severity: Minor
                    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                      Function _toSettings has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        var _toSettings = function (mixed) {
                          var idx, jq;
                          var settings = DataTable.settings;
                          var tables = $.map(settings, function (el, i) {
                            return el.nTable;
                      Severity: Minor
                      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 1 hr to fix

                        Method setBillingInformation has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Function toMoney has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  (i.toMoney = function(a, b) {
                                      if (((b = f(b)), b.zeroCents)) {
                                          b.lastOutput = b.lastOutput || '';
                                          var c = '(' + b.separator + '[0]{0,' + b.precision + '})',
                                              d = new RegExp(c, 'g'),
                          Severity: Minor
                          Found in view/frontend/web/js/vanillamasker.min.js - About 1 hr to fix

                            Function refresh has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                (b.prototype.refresh = function() {
                                    var b = this,
                                        c = 'offset',
                                        d = 0;
                                    (this.offsets = []),
                            Severity: Minor
                            Found in view/frontend/web/js/bootstrap.min.js - About 1 hr to fix

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

                                    $.extend(preSearch[column], {
                                      sSearch: input + '',
                                      bRegex: regex === null ? false : regex,
                                      bSmart: smart === null ? true : smart,
                                      bCaseInsensitive: caseInsen === null ? true : caseInsen,
                              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 8696..8701

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

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language