Showing 551 of 2,707 total issues
Function list_players
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def list_players(race=None):
"""List players belonging to a particular race. In case race is missing,
list all players. Add printing of race name."""
_players = Player.objects.all()
if race:
- 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 groupset
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def groupset(request, id):
profile = get_object_or_404(Player, pk=id)
from django.forms import ModelForm, SelectMultiple
- 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 list_users
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def list_users(race=None):
"""List users belonging to a particular race. In case race is missing,
list all users."""
players = Player.objects.all()
if race:
- 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 scoring_activity_stats
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def scoring_activity_stats():
from wouso.core.user.models import Player
from wouso.core.scoring.models import History
data = []
- 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 applyPlacement
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Tooltip.prototype.applyPlacement = function (offset, placement) {
var $tip = this.tip()
var width = $tip[0].offsetWidth
var height = $tip[0].offsetHeight
Function main
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def main():
"""In main, parse command line arguments and call corresponding functions.
"""
parser = argparse.ArgumentParser()
Function handlers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
handlers: function( event, handlers ) {
var sel, handleObj, matches, i,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
Function attr
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
attr: function( elem, name, value ) {
var hooks, ret,
nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
Function promise
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
Function promise
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
Function attr
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
attr: function( elem, name, value ) {
var hooks, ret,
nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
Function handlers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
handlers: function( event, handlers ) {
var sel, handleObj, matches, i,
handlerQueue = [],
delegateCount = handlers.delegateCount,
cur = event.target;
Function checkPosition
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
var scrollHeight = $(document).height()
var scrollTop = this.$target.scrollTop()
Function html
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
html: function( value ) {
return access( this, function( value ) {
var elem = this[ 0 ] || {},
i = 0,
l = this.length;
Function toggleClass
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
toggleClass: function( value, stateVal ) {
var type = typeof value;
if ( typeof stateVal === "boolean" && type === "string" ) {
return stateVal ? this.addClass( value ) : this.removeClass( value );
Function show
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Collapse.prototype.show = function () {
if (this.transitioning || this.$element.hasClass('in')) return
var startEvent = $.Event('show.bs.collapse')
this.$element.trigger(startEvent)
Function html
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
html: function( value ) {
return access( this, function( value ) {
var elem = this[ 0 ] || {},
i = 0,
l = this.length;
Function toggleClass
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
toggleClass: function( value, stateVal ) {
var type = typeof value;
if ( typeof stateVal === "boolean" && type === "string" ) {
return stateVal ? this.addClass( value ) : this.removeClass( value );
Function fix
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
Function finish
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
finish: function( type ) {
if ( type !== false ) {
type = type || "fx";
}
return this.each(function() {