pagseguro/magento2

View on GitHub

Showing 385 of 385 total issues

File jquery.dataTables.min.js has 6305 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! DataTables 1.10.12
 * ©2008-2015 SpryMedia Ltd - datatables.net/license
 */

/**
Severity: Major
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 wks to fix

    File bootstrap.min.js has 1669 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Bootstrap v3.3.7 (http://getbootstrap.com)
     * Copyright 2011-2016 Twitter, Inc.
     * Licensed under the MIT license
     */
    Severity: Major
    Found in view/frontend/web/js/bootstrap.min.js - About 4 days to fix

      Function DataTable has 536 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var DataTable = function (options) {
          /**
           * Perform a jQuery selector action on the table's TR elements (from the tbody) and
           * return the resulting jQuery object.
           *  @param {string|node|jQuery} sSelector jQuery selector or node collection to act on
      Severity: Major
      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 2 days to fix

        File public.js has 919 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         *
         * Modals
         *
         */
        Severity: Major
        Found in view/adminhtml/web/js/public.js - About 2 days to fix

          Function Details has 313 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                Details: function (url, transaction_code, order) {
                  jQuery
                    .ajax({
                      url: url + '/pagseguro/transactions/transaction',
                      type: 'POST',
          Severity: Major
          Found in view/adminhtml/web/js/public.js - About 1 day to fix

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

                private function setShippingInformation()
                {
                    $shipping = $this->_order->getShippingAddress();
                    if ($shipping) {
                        if (count($shipping->getStreet()) === 4) {
            Severity: Major
            Found in Model/Direct/BoletoMethod.php and 2 other locations - About 1 day to fix
            Model/Direct/CreditCardMethod.php on lines 383..417
            Model/Direct/DebitMethod.php on lines 304..338

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

            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

                private function setShippingInformation()
                {
                    $shipping = $this->_order->getShippingAddress();
                    if ($shipping) {
                        if (count($shipping->getStreet()) === 4) {
            Severity: Major
            Found in Model/Direct/CreditCardMethod.php and 2 other locations - About 1 day to fix
            Model/Direct/BoletoMethod.php on lines 298..332
            Model/Direct/DebitMethod.php on lines 304..338

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

            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

                private function setShippingInformation()
                {
                    $shipping = $this->_order->getShippingAddress();
                    if ($shipping) {
                        if (count($shipping->getStreet()) === 4) {
            Severity: Major
            Found in Model/Direct/DebitMethod.php and 2 other locations - About 1 day to fix
            Model/Direct/BoletoMethod.php on lines 298..332
            Model/Direct/CreditCardMethod.php on lines 383..417

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

            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

            <?php
            /**
             * 2007-2016 [PagSeguro Internet Ltda.]
             *
             * NOTICE OF LICENSE
            Severity: Major
            Found in Model/PaymentDefaultlLightbox.php and 1 other location - About 1 day to fix
            Model/Payment.php on lines 1..156

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

            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

            <?php
            /**
             * 2007-2016 [PagSeguro Internet Ltda.]
             *
             * NOTICE OF LICENSE
            Severity: Major
            Found in Model/Payment.php and 1 other location - About 1 day to fix
            Model/PaymentDefaultlLightbox.php on lines 1..156

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

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

              var y = function (a, e, d) {
                var c = {
                  invalid: [],
                  getCaret: function () {
                    try {
            Severity: Major
            Found in view/frontend/web/js/jquery.mask.min.js - About 1 day to fix

              Function _fnScrollDraw has 179 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function _fnScrollDraw(settings) {
                  // Given that this is such a monster function, a lot of variables are use
                  // to try and keep the minimised size as small as possible
                  var scroll = settings.oScroll,
                    scrollX = scroll.sX,
              Severity: Major
              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 7 hrs to fix

                Function _fnCalculateColumnWidths has 146 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function _fnCalculateColumnWidths(oSettings) {
                    var table = oSettings.nTable,
                      columns = oSettings.aoColumns,
                      scroll = oSettings.oScroll,
                      scrollY = scroll.sY,
                Severity: Major
                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 5 hrs to fix

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

                  <?php
                  /**
                   * 2007-2016 [PagSeguro Internet Ltda.]
                   *
                   * NOTICE OF LICENSE
                  Severity: Major
                  Found in Controller/Adminhtml/Refund/Request.php and 2 other locations - About 5 hrs to fix
                  Controller/Adminhtml/Cancellation/Request.php on lines 1..81
                  Controller/Adminhtml/Conciliation/Request.php on lines 1..83

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

                  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

                  <?php
                  /**
                   * 2007-2016 [PagSeguro Internet Ltda.]
                   *
                   * NOTICE OF LICENSE
                  Severity: Major
                  Found in Controller/Adminhtml/Cancellation/Cancel.php and 1 other location - About 5 hrs to fix
                  Controller/Adminhtml/Conciliation/Conciliate.php on lines 1..85

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

                  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

                  <?php
                  /**
                   * 2007-2016 [PagSeguro Internet Ltda.]
                   *
                   * NOTICE OF LICENSE
                  Severity: Major
                  Found in Controller/Adminhtml/Cancellation/Request.php and 2 other locations - About 5 hrs to fix
                  Controller/Adminhtml/Conciliation/Request.php on lines 1..83
                  Controller/Adminhtml/Refund/Request.php on lines 1..79

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

                  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

                  <?php
                  /**
                   * 2007-2016 [PagSeguro Internet Ltda.]
                   *
                   * NOTICE OF LICENSE
                  Severity: Major
                  Found in Controller/Adminhtml/Conciliation/Conciliate.php and 1 other location - About 5 hrs to fix
                  Controller/Adminhtml/Cancellation/Cancel.php on lines 1..80

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

                  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

                  <?php
                  /**
                   * 2007-2016 [PagSeguro Internet Ltda.]
                   *
                   * NOTICE OF LICENSE
                  Severity: Major
                  Found in Controller/Adminhtml/Conciliation/Request.php and 2 other locations - About 5 hrs to fix
                  Controller/Adminhtml/Cancellation/Request.php on lines 1..81
                  Controller/Adminhtml/Refund/Request.php on lines 1..79

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

                  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

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

                      public function execute()
                      {
                          $lastRealOrder = $this->_checkoutSession->getLastRealOrder();
                  
                          if ($lastRealOrder->getPayment()===null) {
                  Severity: Major
                  Found in Controller/Payment/Request.php - About 5 hrs to fix

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

                      _api_register('rows()', function (selector, opts) {
                        // argument shifting
                        if (selector === undefined) {
                          selector = '';
                        } else if ($.isPlainObject(selector)) {
                    Severity: Major
                    Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 5 hrs to fix
                    view/adminhtml/web/js/jquery.dataTables.min.js on lines 8187..8211

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

                    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