Showing 551 of 2,707 total issues
Function remove
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
remove: function(element, label, fn) {
var timers = element.$timers, ret;
if ( timers ) {
Function off
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
off: function( types, selector, fn ) {
var handleObj, type;
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
handleObj = types.handleObj;
Function *
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
"*": [ function( prop, value ) {
var tween = this.createTween( prop, value ),
target = tween.cur(),
parts = rfxnum.exec( value ),
unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
Function offset
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
offset: function( options ) {
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
Function off
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
off: function( types, selector, fn ) {
var handleObj, type;
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
handleObj = types.handleObj;
Function refresh
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
ScrollSpy.prototype.refresh = function () {
var offsetMethod = 'offset'
var offsetBase = 0
if (!$.isWindow(this.$scrollElement[0])) {
Function *
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
"*": [ function( prop, value ) {
var tween = this.createTween( prop, value ),
target = tween.cur(),
parts = rfxnum.exec( value ),
unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
Function offset
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
offset: function( options ) {
if ( arguments.length ) {
return options === undefined ?
this :
this.each(function( i ) {
Function autocomplete
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.fn.autocomplete = function(url, options, data) {
// Make sure options exists
options = options || {};
// Set url as option
options.url = url;
Function test_final_quest_results_view
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def test_final_quest_results_view(self):
u1 = self._get_player(1).get_extension(QuestUser)
u2 = self._get_player(2).get_extension(QuestUser)
r = Race.objects.create(name='rasa_buna', can_play=True)
Formula.add('finalquest-ok', expression='points=50*({level}+1)/{level_users}')
Consider simplifying this complex logical expression. Open
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
support.getById && context.nodeType === 9 && documentIsHTML &&
Expr.relative[ tokens[1].type ] ) {
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
Consider simplifying this complex logical expression. Open
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
support.getById && context.nodeType === 9 && documentIsHTML &&
Expr.relative[ tokens[1].type ] ) {
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
Function add_user
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_user(username, first_name, last_name, email, password, is_active=False, is_staff=False, is_superuser=False):
Function update_user
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_user(username, first_name=None, last_name=None, email=None, password=None, is_active=None, is_staff=None, is_superuser=None):
Function main
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def main():
ulist = User.objects.all()
accounts_per_race_dict = {}
for u in ulist:
p = Player.objects.get(user__username=u.username)
- 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 __init__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, data=None, instance=None):
super(EditQuestionForm, self).__init__(data)
for a, i in zip(instance.answers_all, xrange(1, len(instance.answers_all) + 1)):
self.fields['answer_%d' % i] = forms.CharField(max_length=500,
- 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 manage_player_set
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def manage_player_set(request, player_id, task_id):
player = get_object_or_404(SpecialQuestUser, id=player_id)
task = get_object_or_404(SpecialQuestTask, id=task_id)
if task not in player.done_tasks.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 save
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def save(self):
data = self.cleaned_data
# Create new question instance
self.instance = Question.objects.create()
- 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 answered
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def answered(user, question, choice):
correct = False
for i, a in enumerate(question.answers):
if a.id == choice:
if a.correct:
- 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 process_request
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def process_request(self, request):
# import pprint; pprint.pprint(request.META['HTTP_AUTHORIZATION']);pprint.pprint(request.POST);
if not request.user.is_anonymous():
try:
profile = request.user.get_profile()
- 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"