Showing 261 of 385 total issues
Function _fnBrowserDetect
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnBrowserDetect(settings) {
// We don't need to do this every time DataTables is constructed, the values
// calculated are specific to the browser and OS configuration which we
// don't expect to change between initialisations
if (!DataTable.__browser) {
Function validateCpf
has 40 lines of code (exceeds 25 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) {
Function show
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(d.prototype.show = function() {
if (!this.transitioning && !this.$element.hasClass('in')) {
var b,
e =
this.$parent &&
Function show
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(c.prototype.show = function(b) {
var d = this,
e = a.Event('show.bs.modal', { relatedTarget: b });
this.$element.trigger(e),
this.isShown ||
Function Transport
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Transport: function (url) {
var t = jQuery('#pagseguro-datatable').DataTable();
var rows = jQuery('#pagseguro-datatable').find(
'[data-target=abandoned]:checked'
);
Function _fnFilterComplete
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnFilterComplete(oSettings, oInput, iForce) {
var oPrevSearch = oSettings.oPreviousSearch;
var aoPrevSearch = oSettings.aoPreSearchCols;
var fnSaveFilter = function (oFilter) {
/* Save the filtering values */
Function placeOrder
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
placeOrder: function () {
var self = this;
var paymentData = quote.paymentMethod();
var messageContainer = this.messageContainer;
PagSeguroDirectPayment.setSessionId(
Function Conciliate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Conciliate: function (url) {
var t = jQuery('#pagseguro-datatable').DataTable();
var rows = jQuery('#pagseguro-datatable').find(
'[data-target=conciliation]:checked'
);
Function _fnInvalidate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnInvalidate(settings, rowIdx, src, colIdx) {
var row = settings.aoData[rowIdx];
var i, ien;
var cellWrite = function (cell, col) {
// This is very frustrating, but in IE if you just write directly
Method __construct
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigInterface,
\Magento\Framework\App\ResourceConnection $resourceConnection,
\Magento\Framework\Model\ResourceModel\Db\Context $context,
\Magento\Backend\Model\Session $session,
\Magento\Sales\Model\Order $order,
Function fetchData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var fetchData = function (data, type, src) {
var arrayNotation, funcNotation, out, innerSrc;
if (src !== '') {
var a = _fnSplitObjNotation(src);
Function setData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setData = function (data, val, src) {
var a = _fnSplitObjNotation(src),
b;
var aLast = a[a.length - 1];
var arrayNotation, funcNotation, o, innerSrc;
Function finishOrder
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
finishOrder: function (self, paymentData, messageContainer, pagseguroHash) {
$.when(
setPaymentInformationAction(messageContainer, {
method: self.getCode(),
additional_data: {
Method setShippingInformation
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function setShippingInformation()
{
if ($this->_checkoutSession->getLastRealOrder()->getIsVirtual()) {
$this->_paymentRequest->setShipping()->setAddressRequired()->withParameters('false');
} else {
Function getPaymentStatusToString
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public static function getPaymentStatusToString($key)
{
if (array_key_exists($key, self::$statusList)) {
switch ($key) {
- 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 _selector_run
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var _selector_run = function (type, selector, selectFn, settings, opts) {
var out = [],
res,
a,
i,
Function _fnApplyColumnDefs
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnApplyColumnDefs(oSettings, aoColDefs, aoCols, fn) {
var i, iLen, j, jLen, k, kLen, def;
var columns = oSettings.aoColumns;
// Column definitions with aTargets
Function _fnFeatureHtmlLength
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnFeatureHtmlLength(settings) {
var classes = settings.oClasses,
tableId = settings.sTableId,
menu = settings.aLengthMenu,
d2 = $.isArray(menu[0]),
Function _fnPageChange
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnPageChange(settings, action, redraw) {
var start = settings._iDisplayStart,
len = settings._iDisplayLength,
records = settings.fnRecordsDisplay();
Method getPaymentStatusToString
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getPaymentStatusToString($key)
{
if (array_key_exists($key, self::$statusList)) {
switch ($key) {