pagseguro/magento2

View on GitHub

Showing 385 of 385 total issues

Function _fnFilterColumn has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    settings,
    searchStr,
    colIdx,
    regex,
    smart,
Severity: Minor
Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if (cache[k] === undefined) {
                  cache[k] = _fnGetCellData(settings, k, i, 'type');
                }
    Severity: Major
    Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  while (columns.length <= aTargets[j]) {
                    _fnAddColumn(oSettings);
                  }
      Severity: Major
      Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

        Function fnFilter has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              sInput,
              iColumn,
              bRegex,
              bSmart,
              bShowGlobal,
        Severity: Minor
        Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                      if (arrayNotation) {
                        // Array notation
                        a[i] = a[i].replace(__reArray, '');
          
                        // Condition allows simply [] to be passed in
          Severity: Major
          Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                      for (j = 0, jen = items.length; j < jen; j++) {
                        item = items[j];
            
                        if (type === 'cell') {
                          ret = fn.call(apiInst, context[i], item.row, item.column, i, j);
            Severity: Major
            Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

              Function _fnReduce has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                function _fnReduce(that, fn, init, start, end, inc) {
              Severity: Minor
              Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if (cellData === null) {
                              cellData = '';
                            }
                Severity: Major
                Found in view/adminhtml/web/js/jquery.dataTables.min.js - About 45 mins to fix

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

                                if (
                                  result.installmentCount !== undefined &&
                                  result.installmentCount !== false
                                ) {
                                  listPaymentLine1.append(
                  Severity: Major
                  Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
                  view/adminhtml/web/js/public.js on lines 578..584
                  view/adminhtml/web/js/public.js on lines 586..592
                  view/adminhtml/web/js/public.js on lines 594..598
                  view/adminhtml/web/js/public.js on lines 600..606
                  view/adminhtml/web/js/public.js on lines 608..617
                  view/adminhtml/web/js/public.js on lines 619..628
                  view/adminhtml/web/js/public.js on lines 630..639
                  view/adminhtml/web/js/public.js on lines 641..650
                  view/adminhtml/web/js/public.js on lines 749..758
                  view/adminhtml/web/js/public.js on lines 760..769

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

                  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 11 locations. Consider refactoring.
                  Open

                                if (
                                  result.reference !== undefined &&
                                  result.reference !== false
                                ) {
                                  listTransactionLine1.append(
                  Severity: Major
                  Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
                  view/adminhtml/web/js/public.js on lines 578..584
                  view/adminhtml/web/js/public.js on lines 586..592
                  view/adminhtml/web/js/public.js on lines 594..598
                  view/adminhtml/web/js/public.js on lines 600..606
                  view/adminhtml/web/js/public.js on lines 619..628
                  view/adminhtml/web/js/public.js on lines 630..639
                  view/adminhtml/web/js/public.js on lines 641..650
                  view/adminhtml/web/js/public.js on lines 694..703
                  view/adminhtml/web/js/public.js on lines 749..758
                  view/adminhtml/web/js/public.js on lines 760..769

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

                  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 11 locations. Consider refactoring.
                  Open

                                if (
                                  result.cancelationSource !== undefined &&
                                  result.cancelationSource !== false
                                ) {
                                  listTransactionLine2.append(
                  Severity: Major
                  Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
                  view/adminhtml/web/js/public.js on lines 578..584
                  view/adminhtml/web/js/public.js on lines 586..592
                  view/adminhtml/web/js/public.js on lines 594..598
                  view/adminhtml/web/js/public.js on lines 600..606
                  view/adminhtml/web/js/public.js on lines 608..617
                  view/adminhtml/web/js/public.js on lines 619..628
                  view/adminhtml/web/js/public.js on lines 641..650
                  view/adminhtml/web/js/public.js on lines 694..703
                  view/adminhtml/web/js/public.js on lines 749..758
                  view/adminhtml/web/js/public.js on lines 760..769

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

                  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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          \Magento\Directory\Api\CountryInformationAcquirerInterface $countryInformation,
                          \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                          \Magento\Framework\Module\ModuleList $moduleList,
                          \Magento\Sales\Model\Order $order,
                          \UOL\PagSeguro\Helper\Library $library,
                  Severity: Minor
                  Found in Model/Direct/BoletoMethod.php - About 45 mins to fix

                    Function setShippingInformation has a Cognitive Complexity of 8 (exceeds 5 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 45 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 searchTransactions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function searchTransactions()
                        {
                            try {
                                $connection = $this->getConnection();
                                $select = $connection->select()
                    Severity: Minor
                    Found in Model/Transactions/Method.php - About 45 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

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

                                  if (
                                    result.itemCount !== undefined &&
                                    result.itemCount !== false
                                  ) {
                                    listTransactionLine2.append(
                    Severity: Major
                    Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
                    view/adminhtml/web/js/public.js on lines 578..584
                    view/adminhtml/web/js/public.js on lines 586..592
                    view/adminhtml/web/js/public.js on lines 594..598
                    view/adminhtml/web/js/public.js on lines 600..606
                    view/adminhtml/web/js/public.js on lines 608..617
                    view/adminhtml/web/js/public.js on lines 619..628
                    view/adminhtml/web/js/public.js on lines 630..639
                    view/adminhtml/web/js/public.js on lines 694..703
                    view/adminhtml/web/js/public.js on lines 749..758
                    view/adminhtml/web/js/public.js on lines 760..769

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

                    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 11 locations. Consider refactoring.
                    Open

                                  if (
                                    result.escrowEndDate !== undefined &&
                                    result.escrowEndDate !== false
                                  ) {
                                    listPaymentLine1.append(
                    Severity: Major
                    Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
                    view/adminhtml/web/js/public.js on lines 578..584
                    view/adminhtml/web/js/public.js on lines 586..592
                    view/adminhtml/web/js/public.js on lines 594..598
                    view/adminhtml/web/js/public.js on lines 600..606
                    view/adminhtml/web/js/public.js on lines 608..617
                    view/adminhtml/web/js/public.js on lines 619..628
                    view/adminhtml/web/js/public.js on lines 630..639
                    view/adminhtml/web/js/public.js on lines 641..650
                    view/adminhtml/web/js/public.js on lines 694..703
                    view/adminhtml/web/js/public.js on lines 749..758

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

                    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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            \Magento\Directory\Api\CountryInformationAcquirerInterface $countryInformation,
                            \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                            \Magento\Framework\Module\ModuleList $moduleList,
                            \Magento\Sales\Model\Order $order,
                            \UOL\PagSeguro\Helper\Library $library,
                    Severity: Minor
                    Found in Model/Direct/CreditCardMethod.php - About 45 mins to fix

                      Function getTitleTypePaymentMethod has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function getTitleTypePaymentMethod($type)
                          {
                              if (!is_null($type)) {
                                  switch ($type) {
                                      case 1:
                      Severity: Minor
                      Found in Helper/Data.php - About 45 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

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

                                    if (result.code !== undefined && result.code !== false) {
                                      listTransactionLine1.append(
                                        '<dl><dt>Código da transação: </dt><dd>' +
                                          result.code +
                                          '</dd></dl>'
                      Severity: Major
                      Found in view/adminhtml/web/js/public.js and 10 other locations - About 45 mins to fix
                      view/adminhtml/web/js/public.js on lines 578..584
                      view/adminhtml/web/js/public.js on lines 586..592
                      view/adminhtml/web/js/public.js on lines 594..598
                      view/adminhtml/web/js/public.js on lines 608..617
                      view/adminhtml/web/js/public.js on lines 619..628
                      view/adminhtml/web/js/public.js on lines 630..639
                      view/adminhtml/web/js/public.js on lines 641..650
                      view/adminhtml/web/js/public.js on lines 694..703
                      view/adminhtml/web/js/public.js on lines 749..758
                      view/adminhtml/web/js/public.js on lines 760..769

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

                      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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              \Magento\Directory\Api\CountryInformationAcquirerInterface $countryInformation,
                              \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
                              \Magento\Framework\Module\ModuleList $moduleList,
                              \Magento\Sales\Model\Order $order,
                              \UOL\PagSeguro\Helper\Library $library,
                      Severity: Minor
                      Found in Model/Direct/DebitMethod.php - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language