Showing 20 of 76 total issues
File seed.py
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
import binascii
import datetime
import pytz
from Crypto import Random
Function searchFunction
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function searchFunction() {
var input, filter, table, tr;
input = document.getElementById("searchInput");
filter = input.value;
- 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 sessions_index
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def sessions_index(request, email=None, password=None, path='/dashboard/home'):
if request.method == "POST":
# Set path variable
if 'path' in request.POST:
path = request.POST['path']
- 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 drawChart
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawChart() {
var pto_taken = parseInt(document.getElementById('pto_taken').value);
var pto_remain = parseInt(document.getElementById('pto_remain').value);
var sick_taken = parseInt(document.getElementById('sick_taken').value);
var sick_remain = parseInt(document.getElementById('sick_remain').value);
Function user_view
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def user_view(request, user_id):
if request.method == "POST":
form = request.POST
if not form:
return HttpResponse("User " + str(user_id) + "POST")
- 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 validate_update_form
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def validate_update_form(form, user, update):
err_list = []
if form["password_new"] != form["confirm"]:
err_list.append("Password and Confirm Password does not match")
elif len(form["password_new"]) != 0:
- 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 validation
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validation() {
$("form").validate({
rules: {
"password": {
required: false,
Function searchFunction
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function searchFunction() {
var input, filter, table, tr;
input = document.getElementById("searchInput");
filter = input.value;
Function drawChart
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawChart() {
// console.log(document.all)
// Create the data table.
var sick_days_taken = parseInt(document.getElementById('sick_days_taken').value);
Function index
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def index(request):
if request.method == "POST":
form = request.POST
if not form:
return HttpResponse("Users index")
- 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 simulate_simple_authentication
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def simulate_simple_authentication(factory, client, email, password, path, add_messages_middleware, views):
Function check_if_valid_token
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_if_valid_token(request):
if 'HTTP_AUTHORIZATION' not in request.META:
return False
else:
token = urlparse.unquote(request.META['HTTP_AUTHORIZATION'])
- 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 getCookie
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
- 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 getCookie
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie !== '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
- 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 api_index
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def api_index(request):
if check_if_valid_token(request):
try:
token = urlparse.unquote(request.META['HTTP_AUTHORIZATION'])
user_id = extrapolate_user(token)
- 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 admin_analytics
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def admin_analytics(request, selected_id): # pylint: disable=unused-argument
current_user = utils.current_user(request)
data = request.GET.dict().copy()
col = []
for key in 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 getCookie
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
- 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
Avoid too many return
statements within this function. Open
return HttpResponse("Invalid HTTP method")
Avoid too many return
statements within this function. Open
return HttpResponse("Sessions Index")
Function user_is_authenticated
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def user_is_authenticated(function):
def wrap(request, *args, **kwargs):
if 'auth_token' in request.COOKIES:
try:
- 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"