Showing 551 of 2,707 total issues
Function search
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def search(request):
""" Perform regular search by either first or last name """
logger.debug('Initiating regular search')
form = SearchForm(request.POST)
if form.is_valid():
- 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 user_util.py
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env/python
# To test, run from parent folder using commands such as:
# PYTHONPATH=../:. python utils/user_util.py --list-users
# PYTHONPATH=../:. python utils/user_util.py --list-races
Function superMatcher
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],
Function superMatcher
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],
Function context
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def context(request):
""" Make all configuration settings available as config_name
and also define some game context
"""
settings_dict = {}
- 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 login_view
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def login_view(request):
# TODO: rethink and rewrite
next = request.GET.get('next', '')
if request.method != 'POST':
form = AuthenticationForm(request)
- 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 can_cast
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def can_cast(self, spell, source, destination):
""" Check if destination can receive spell from source
Return: a tuple of (can_cast, error_message)
"""
- 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 force_round_close
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def force_round_close(cls, round):
"""
Finish every challenge in the round
"""
for c in round.challenges():
- 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 domManip
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
domManip: function( args, callback ) {
// Flatten any nested arrays
args = concat.apply( [], args );
Function init
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
init = jQuery.fn.init = function( selector, context ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
Function send
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
send: function( headers, complete ) {
var i,
xhr = options.xhr(),
id = ++xhrId;
Function init
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
init = jQuery.fn.init = function( selector, context ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
Function domManip
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
domManip: function( args, callback ) {
// Flatten any nested arrays
args = concat.apply( [], args );
Function send
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
send: function( headers, complete ) {
var i,
xhr = options.xhr(),
id = ++xhrId;
Function CHILD
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
"CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
Function Deferred
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
Function formToArray
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.formToArray = function(semantic, elements) {
var a = [];
if (this.length === 0) {
return a;
}
Function CHILD
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
"CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
Function Deferred
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
Consider simplifying this complex logical expression. Open
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
outerCache = parent[ expando ] || (parent[ expando ] = {});
cache = outerCache[ type ] || [];
nodeIndex = cache[0] === dirruns && cache[1];