pagseguro/magento2

View on GitHub

Showing 385 of 385 total issues

Function fnUpdate has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    this.fnUpdate = function (mData, mRow, iColumn, bRedraw, bAction) {
Severity: Minor
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 35 mins to fix

    Function _selector_run has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      var _selector_run = function (type, selector, selectFn, settings, opts) {
    Severity: Minor
    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 35 mins to fix

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

              Payment: function (url, id, hash, document, bank) {
      Severity: Minor
      Found in view/frontend/web/js/public.js - About 35 mins to fix

        Function __columnData has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          var __columnData = function (settings, column, r1, r2, rows) {
        Severity: Minor
        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 35 mins to fix

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

                  \Magento\Framework\ObjectManagerInterface $objectManager,
                  \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                  \Magento\Framework\Model\ResourceModel\Db\Context $context,
                  \UOL\PagSeguro\Model\OrdersFactory $ordersFactory,
                  \UOL\PagSeguro\Model\System\Config\Environment $environmentConfig
          Severity: Minor
          Found in Observer/CreatePagSeguroOrder.php - About 35 mins to fix

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

                    \Magento\Framework\View\Element\Template\Context $context,
                    \Magento\Checkout\Model\Session $checkoutSession,
                    \Magento\Sales\Model\Order\Config $orderConfig,
                    \Magento\Framework\App\Http\Context $httpContext,
                    array $data = []
            Severity: Minor
            Found in Block/Payment/Checkout.php - About 35 mins to fix

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

                      \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                      \Magento\Framework\Module\ModuleList $moduleList,
                      \Magento\Sales\Model\Order $order,
                      \UOL\PagSeguro\Helper\Library $library,
                      $data = array()
              Severity: Minor
              Found in Model/Direct/InstallmentsMethod.php - About 35 mins to fix

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

                        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                        \Magento\Sales\Api\OrderRepositoryInterface $order,
                        \Magento\Sales\Api\Data\OrderStatusHistoryInterface $history,
                        \Magento\Framework\Module\ModuleList $moduleList,
                        \Magento\Framework\Model\ResourceModel\Db\Context $context
                Severity: Minor
                Found in Model/NotificationMethod.php - About 35 mins to fix

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

                      if (data === undefined) {
                        // Get
                        return ctx.length && this.length
                          ? ctx[0].aoData[this[0]]._aData
                          : undefined;
                  Severity: Minor
                  Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 35 mins to fix
                  view/adminhtml/web/js/jquery.dataTables.min.js on lines 7959..7973

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

                  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 (data === undefined) {
                        // get
                        return ctx.length && this.length
                          ? ctx[0].aoData[this[0]]._details
                          : undefined;
                  Severity: Minor
                  Found in view/adminhtml/web/js/jquery.dataTables.min.js and 1 other location - About 35 mins to fix
                  view/adminhtml/web/js/jquery.dataTables.min.js on lines 7766..7771

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

                  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 validateDocument has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function validateDocument(self) {
                    var value = unmask(self.value);
                    if (value.length === 11) {
                      status = validateCpf(self);
                    } else if (value.length === 14) {
                  Severity: Minor
                  Found in view/frontend/web/js/model/direct-payment-validator.js - About 35 mins 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 assignData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function assignData(\Magento\Framework\DataObject $data)
                      {
                          parent::assignData($data);
                  
                          $info = $this->getInfoInstance();
                  Severity: Minor
                  Found in Model/PaymentCreditCard.php - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function request()
                      {
                          $this->getTransactions();
                          if (! is_null($this->_PagSeguroPaymentList->getTransactions())) {
                              foreach ($this->_PagSeguroPaymentList->getTransactions() as $payment) {
                  Severity: Minor
                  Found in Model/Transactions/Methods/Cancellation.php - About 35 mins 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 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function request()
                      {
                          $this->getTransactions();
                          if (! is_null($this->_PagSeguroPaymentList->getTransactions())) {
                  
                  
                  Severity: Minor
                  Found in Model/Transactions/Methods/Conciliation.php - About 35 mins 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

                  Avoid too many return statements within this function.
                  Open

                        return;
                  Severity: Major
                  Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                              return [sel._DT_RowIndex]; // Property added by DT for fast lookup
                    Severity: Major
                    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return [_fnVisibleToColumnIndex(settings, idx)];
                      Severity: Major
                      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                  return host.length ? [host.data('dt-row')] : [];
                        Severity: Major
                        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return function (data, val) {
                                  // meta is also passed in, but not used
                                  data[mSource] = val;
                                };
                          Severity: Major
                          Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return jqResult;
                            Severity: Major
                            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language