Showing 551 of 2,707 total issues
Function Sizzle
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Sizzle( selector, context, results, seed ) {
var match, elem, m, nodeType,
// QSA vars
i, groups, old, nid, newContext, newSelector;
Function buildFragment
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildFragment: function( elems, context, scripts, selection ) {
var j, elem, contains,
tmp, tag, tbody, wrap,
l = elems.length,
Function buildFragment
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildFragment: function( elems, context, scripts, selection ) {
var j, elem, contains,
tmp, tag, tbody, wrap,
l = elems.length,
Function add
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function( elem, types, handler, data, selector ) {
var tmp, events, t, handleObjIn,
special, eventHandle, handleObj,
handlers, type, namespaces, origType,
elemData = jQuery._data( elem );
Function add
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function( elem, types, handler, data, selector ) {
var tmp, events, t, handleObjIn,
special, eventHandle, handleObj,
handlers, type, namespaces, origType,
elemData = jQuery._data( elem );
Function manage_player
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def manage_player(request, player_id):
player = get_object_or_404(Player, pk=player_id)
player = player.get_extension(SpecialQuestUser)
tasks_not_done = SpecialQuestTask.objects.exclude(id__in=player.done_tasks.all().values('id')).all()
- 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 try_using_truncate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def try_using_truncate(username, first_name, last_name, email, password, cookie):
(username, ret) = try_using_truncate_no_recurse(username, first_name, last_name, email, password)
if ret == OP_SUCCESS:
return (username, 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 try_using_truncate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def try_using_truncate(username, first_name, last_name, email, password, cookie):
(username, ret) = try_using_truncate_no_recurse(username, first_name, last_name, email, password)
if ret == OP_SUCCESS:
return (username, 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
File models.py
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.db.models import Sum
import logging
import sys
from datetime import datetime, timedelta
from django.db import models
Function doSubmit
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doSubmit() {
// make sure form attrs are set
var t = $form.attr('target'), a = $form.attr('action');
// update form attrs in IE friendly way
Function matcherFromGroupMatchers
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
Function matcherFromGroupMatchers
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
File models.py
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
# coding=utf-8
import logging
from md5 import md5
from datetime import datetime, timedelta
from random import shuffle
Function done
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
Function done
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
Player
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Player(models.Model):
""" Base class for the game user. This is extended by game specific
player models.
"""
user = models.ForeignKey(User, unique=True, related_name="%(class)s_related")
Function setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
Function setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
Function doSort
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function doSort($this, $table) {
var sortColumn = parseFloat($this.attr('data-sortcolumn')),
context = lookupSortContext($table),
bsSort = context.bsSort;
Function magic_cast
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def magic_cast(request, destination=None, spell=None):
player = request.user.get_profile()
destination = get_object_or_404(Player, pk=destination)
error = ''
- 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"