Showing 179 of 384 total issues
Function update_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def update_data(self):
params = {
'dataset': 'tco-bus-circulation-passages-tr',
'rows': 2,
'apikey': settings.STAR_API_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 get_last_activity
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_last_activity(self):
last_activity = None
for app in self.tile_apps.all():
try:
app.content_object.get_app_dictionary()
- 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
Avoid deeply nested control flow statements. Open
if app_instances.count() > 1:
verbose_name += ' ' + str(i + 1)
apps_list.append({'verbose_name': verbose_name[16:], 'pk': instance.pk, 'enabled': instance.enabled,
Consider simplifying this complex logical expression. Open
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[j].type ] ) {
Consider simplifying this complex logical expression. Open
if ( delegateCount && cur.nodeType &&
( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
for ( ; cur !== this; cur = cur.parentNode || this ) {
Function condense
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function condense( unmatched, map, filter, context, xml ) {
Function augmentWidthOrHeight
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
Function superMatcher
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
superMatcher = function( seed, context, xml, results, outermost ) {
Function buildFragment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function buildFragment( elems, context, scripts, selection, ignored ) {
Function add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
add: function( elem, types, handler, data, selector ) {
Function remove
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
remove: function( elem, types, handler, selector, mappedTypes ) {
Function Tween
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Tween( elem, options, prop, end, easing ) {
Function CHILD
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
"CHILD": function( type, what, argument, first, last ) {
Function printText
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function printText(x, y, text, color, bg) {
Function drawRect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function drawRect(x0, y0, width, height, color) {
Function drawChar
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function drawChar(x0, y0, character, color, bg){
Function fillRect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function fillRect(x0, y0, width, height, color) {
Function __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, *args, **kw):
super(TasksModelForm, self).__init__(*args, **kw)
widget = self.fields['asana_project_id'].widget
value = ''
if 'asana_personal_access_token' in self.data and self.data['asana_personal_access_token']:
- 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
Avoid too many return
statements within this function. Open
return select( selector.replace( rtrim, "$1" ), context, results, seed );
Avoid too many return
statements within this function. Open
return results;