Showing 179 of 384 total issues
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,
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
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
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 remove
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
remove: function( elem, types, handler, selector, mappedTypes ) {
Function superMatcher
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
superMatcher = function( seed, context, xml, results, outermost ) {
Function Tween
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function Tween( elem, options, prop, end, easing ) {
Function augmentWidthOrHeight
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
Function buildFragment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function buildFragment( elems, context, scripts, selection, ignored ) {
Function CHILD
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
"CHILD": function( type, what, argument, first, last ) {
Function add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
add: function( elem, types, handler, data, selector ) {
Function fillRect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function fillRect(x0, y0, width, height, color) {
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 printText
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function printText(x, y, text, color, bg) {
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 values[1];
Avoid too many return
statements within this function. Open
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'