Showing 551 of 2,707 total issues
File tests.py
has 484 lines of code (exceeds 250 allowed). Consider refactoring. Open
import json
import unittest
from datetime import datetime,timedelta
from mock import patch
from django.contrib.auth.models import User
File models.py
has 444 lines of code (exceeds 250 allowed). Consider refactoring. Open
from math import ceil
from random import shuffle
from datetime import datetime, time, timedelta
from django.db import models
from django.template.loader import render_to_string
File tests.py
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.core.cache import cache
import unittest
from datetime import datetime
from django.contrib.auth.models import User, Group, Permission
from django.contrib.contenttypes.models import ContentType
File handlers.py
has 435 lines of code (exceeds 250 allowed). Consider refactoring. Open
from datetime import datetime, timedelta
from django.shortcuts import get_object_or_404
from django.template.defaultfilters import slugify
from django.utils.html import strip_tags
from piston.handler import BaseHandler
File jquery.autocomplete.js
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Jquery Auto Complete Plugin by Dylan Verheul
* url: http://www.dyve.net/jquery/?autocomplete
* from the site: "Licensed like jQuery, see http://docs.jquery.com/License."
*/
Function try_using_cookie
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def try_using_cookie(username, first_name, last_name, email, password, cookie):
(username, ret) = try_using_cookie_no_recurse(username, first_name, last_name, email, password, cookie)
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_cookie
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def try_using_cookie(username, first_name, last_name, email, password, cookie):
(username, ret) = try_using_cookie_no_recurse(username, first_name, last_name, email, password, cookie)
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 tests.py
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
import unittest
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import IntegrityError
CpanelViewsTest
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class CpanelViewsTest(WousoTest):
def setUp(self):
super(CpanelViewsTest, self).setUp()
self.admin = self._get_superuser()
self.client = Client()
Function Callbacks
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
Function Callbacks
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
Function main
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def main():
"""In main, parse command line arguments and call corresponding functions.
"""
parser = argparse.ArgumentParser()
- 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 cb
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
function cb(e) {
if (xhr.aborted || callbackProcessed) {
return;
}
try {
Consider simplifying this complex logical expression. Open
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
Consider simplifying this complex logical expression. Open
if ( event.pageX == null && original.clientX != null ) {
eventDoc = event.target.ownerDocument || document;
doc = eventDoc.documentElement;
body = eventDoc.body;
File cpanel.py
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django import forms
from django.shortcuts import render_to_response, redirect, get_object_or_404
from django.template.context import RequestContext
from django.views.generic import View, ListView, UpdateView, CreateView, \
DetailView
Function remove
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
remove: function(element, label, fn) {
var timers = element.$timers, ret;
if ( timers ) {
- 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 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Quest will use QPool questions tagged 'quest'
import os
import logging
import datetime
import subprocess
Function defaultPrefilter
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
function defaultPrefilter( elem, props, opts ) {
/* jshint validthis: true */
var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
anim = this,
orig = {},
Function defaultPrefilter
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
function defaultPrefilter( elem, props, opts ) {
/* jshint validthis: true */
var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
anim = this,
orig = {},