Showing 43 of 1,450 total issues
Function detailFormatter
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
detailFormatter : function(index, row, element) {
var table = $('<table>');
$(element).append(table);
Function cash_flow
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def cash_flow(n):
""" Get cash flow.
"""
# Create dict for last 'n' months
- 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 bindTable
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindTable: function(_data) {
// Construir tabela
$('table.table-customers').bootstrapTable({
uniqueId: 'id',
Function bindTable
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindTable: function(_data) {
// Construir tabela
$('table.table-suppliers').bootstrapTable({
uniqueId: 'id',
Function bindTrackCode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.bindTrackCode = function() {
// Get track code by tag attribute
this.each(function(index, element) {
Consider simplifying this complex logical expression. Open
if (!attachEvent) {
var requestFrame = (function(){
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame ||
function(fn){ return window.setTimeout(fn, 20); };
return function(fn){ return raf(fn); };
Function request
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
request : function(options) {
// Create promise
var deferred = $.Deferred(function(def) {
Function save
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save(purchase):
""" Add or update for purchase.
"""
# Get parent
Function deferred
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var deferred = $.Deferred(function(def) {
// fn success
var success = function(response) {
Function submitHandler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
submitHandler: function(form, event) {
// não submete form
event.preventDefault();
Function activate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
activate: function (toggleBtn) {
//Get the screen sizes
var screenSizes = $.AdminLTE.options.screenSizes;
//Enable sidebar toggle
Function populate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.populate = function(data) {
var _form = $(this);
// Validate
Function tree
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.AdminLTE.tree = function (menu) {
var _this = this;
var animationSpeed = $.AdminLTE.options.animationSpeed;
$(document).on('click', menu + ' li a', function (e) {
//Get the clicked link and the next element
Function showCashFlowChart
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var showCashFlowChart = function(count) {
$('#cash_flow-chart').html(LOADING);
// Carregar informações do fluxo de caixa a partir do 'n'
Function which
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def which(name, flags=os.X_OK):
"""Search PATH for executable files with the given name.
On newer versions of MS-Windows, the PATHEXT environment variable will be
set to the list of file extensions for files considered executable. This
will normally include things like ".EXE". This fuction will also find files
- 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 load_tests
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def load_tests(import_location):
"""Loads all tests for modules and adds them to a single test suite.
Args:
import_location: String; used to determine how the endpoints_proto_datastore
package is imported.
- 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 tokenize_autocomplete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def tokenize_autocomplete(phrase):
a = []
for word in phrase.split():
j = 1
while True:
- 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 encomenda
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def encomenda(self,numero):
# Usado como referencia o codigo do Guilherme Chapiewski
# https://github.com/guilhermechapiewski/correios-api-py
url = 'http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_ITEMCODE=&P_LINGUA=001&P_TESTE=&P_TIPO=001&P_COD_UNI=%s' % (str(numero),)
- 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 get_stats_by_products
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_stats_by_products():
""" Get sales statistics
"""
# Get all sales
- 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 report_products_by_customers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def report_products_by_customers():
""" List products grouped by its customers.
"""
# List all sales
- 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"