Showing 261 of 385 total issues
Function validateCnpj
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
function validateCnpj(self) {
var cnpj = unmask(self.value);
var numbersVal;
var digits;
var sum;
- Read upRead up
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 _fnSort
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnSort(oSettings) {
var i,
ien,
iLen,
j,
File CreditCardMethod.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* 2007-2016 [PagSeguro Internet Ltda.]
*
* NOTICE OF LICENSE
BoletoMethod
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class BoletoMethod implements Checkout
{
/**
* @var \Magento\Checkout\Model\Session
*/
Function _
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_: function (settings, host, idx, buttons, page, pages) {
var classes = settings.oClasses;
var lang = settings.oLanguage.oPaginate;
var aria = settings.oLanguage.oAria.paginate || {};
var btnDisplay,
Function _fnAddOptionsHtml
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnAddOptionsHtml(oSettings) {
var classes = oSettings.oClasses;
var table = $(oSettings.nTable);
var holding = $('<div/>').insertBefore(table); // Holding element for speed
var features = oSettings.oFeatures;
Method getTitleCodePaymentMethod
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getTitleCodePaymentMethod($code)
{
if (!is_null($code)) {
switch ($code) {
case 101:
File direct-payment-validator.js
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* 2007-2017 [PagSeguro Internet Ltda.]
*
* NOTICE OF LICENSE
*
Function _fnAjaxParameters
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnAjaxParameters(settings) {
var columns = settings.aoColumns,
columnCount = columns.length,
features = settings.oFeatures,
preSearch = settings.oPreviousSearch,
Function _fnGetObjectDataFn
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnGetObjectDataFn(mSource) {
if ($.isPlainObject(mSource)) {
/* Build an object of get functions, and wrap them in a single call */
var o = {};
$.each(mSource, function (key, val) {
Function _fnColumnOptions
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnColumnOptions(oSettings, iCol, oOptions) {
var oCol = oSettings.aoColumns[iCol];
var oClasses = oSettings.oClasses;
var th = $(oCol.nTh);
Function _fnGetRowElements
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnGetRowElements(settings, row, colIdx, d) {
var tds = [],
td = row.firstChild,
name,
col,
Function attach
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var attach = function (container, buttons) {
var i, ien, node, button;
var clickHandler = function (e) {
_fnPageChange(settings, e.data.action, true);
};
Function Refund
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Refund: function (url, data, row, value = null) {
var t = jQuery('#pagseguro-datatable').DataTable();
jQuery
.ajax({
url: url + '/pagseguro/refund/refund',
Function show
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(c.prototype.show = function() {
var b = a.Event('show.bs.' + this.type);
if (this.hasContent() && this.enabled) {
this.$element.trigger(b);
var d = a.contains(
Function __cell_selector
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var __cell_selector = function (settings, selector, opts) {
var data = settings.aoData;
var rows = _selector_row_indexes(settings, opts);
var cells = _removeEmpty(_pluck_order(data, rows, 'anCells'));
var allCells = $([].concat.apply([], cells));
Method createPagSeguroOrdersTable
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function createPagSeguroOrdersTable($setup)
{
// Get pagseguro orders table
$tableName = $setup->getTable(self::PAGSEGURO_ORDERS);
// Check if the table already exists
Function iterator
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
iterator: function (flatten, type, fn, alwaysNew) {
var a = [],
ret,
i,
ien,
Function _fnSetObjectDataFn
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnSetObjectDataFn(mSource) {
if ($.isPlainObject(mSource)) {
/* Unlike get, only the underscore (global) option is used for for
* setting data since we don't know the type here. This is why an object
* option is not documented for `mData` (which is read/write), but it is
Function validateCpf
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
function validateCpf(self) {
var cpf = unmask(self.value);
var numeros, digitos, soma, i, resultado, digitos_iguais;
digitos_iguais = 1;
if (cpf.length < 11) {
- Read upRead up
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"