Showing 50 of 50 total issues
File views.py
has 305 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib.auth import authenticate
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User, Permission
Function draw_base_chart
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
function draw_base_chart(data){
data = google.visualization.arrayToDataTable(data);
var options = {
title: 'Gráficos do transdutor ',
File views.py
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse_lazy, reverse
from django.core import serializers
Function report
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report(request, transductor_id):
now = datetime.datetime.now()
delta = datetime.timedelta(days=1)
date = []
Function generatePdf
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generatePdf(transductor_id):
import time
from reportlab.lib.enums import TA_JUSTIFY
from reportlab.lib.pagesizes import letter
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Image
Error: inconsistent use of tabs and spaces in indentation (<unknown>, line 145)</unknown> Open
from django.core import mail
- Read upRead up
- Exclude checks
We encountered an error attempting to analyze this line.
Function add_pass_fields
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function add_pass_fields(email){
$("#myModalLabel")[0].textContent = "Mudar senha";
var tittle = "<h2 class='form-signin-heading" +
Function register
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def register(request):
if request.method == "GET":
return render(request, 'userRegister/register.html')
else:
- 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 draw_initial_chart
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function draw_initial_chart(){
var data = [
["Date",
"Active power A", "Active power B", "Active power C",
"Apparent power A", "Apparent power B", "Apparent power C",
Function getAlertType
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getAlertType(notification, notification_name) {
var element = "";
switch (notification.fields.priority) {
case 1:
element = '<div class="alert alert-info" name="' + notification_name + '"> '+
Function create_graphic
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_graphic(path, array_date, array_dateb,
array_datec, array_data, label):
title = _('Monitoring') + ' ' + label
fig = Figure()
Function confirm_email
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function confirm_email() {
$.ajax({
url : "/retrieve_password/forgot/", // the endpoint
type : "POST", // http method
data : {
Function create_graphic
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_graphic(path, array_date, array_dateb,
Function edit_user
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def edit_user(request, user_id):
user = User.objects.get(id=user_id)
if request.method == "GET":
- 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 confirm_email
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def confirm_email(request, token):
if request.method == "GET":
return render(request, "retrieve_password/reset_password.html", \
{"token":token})
else:
- 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 render(request, 'users/dashboard.html')
Function getAlertType
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getAlertType(notification, notification_name) {
var element = "";
switch (notification.fields.priority) {
case 1:
element = '<div class="alert alert-info" name="' + notification_name + '"> '+
- 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
Using width with padding can sometimes make elements larger than you expect. Open
padding: 15px;
- Exclude checks
2 IDs in the selector, really? Open
#wrapper.toggled #page-content-wrapper {
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.form-signin input[type="password"] {
- Exclude checks