Showing 192 of 3,000 total issues
Function agrega_ganaderia_config
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def agrega_ganaderia_config(request):
id_user = request.user
number_message = number_messages(request, id_user.username )
if id_user.is_staff:
if Ganaderia.objects.filter(perfil=id_user):
- Read upRead up
- Create a ticketCreate a ticket
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 sendNotificationApplicationWormer
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def sendNotificationApplicationWormer(self, beliefs_application_wormer, beliefs_application_wormer2):
datee = date.today() + relativedelta(days=3)
three_day_before = date.today() - relativedelta(days=3)
one_day_before = date.today() - relativedelta(days=1)
- Read upRead up
- Create a ticketCreate a ticket
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 agrega_ganado_ordenio
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def agrega_ganado_ordenio(request, ganado_id):
user = request.user
id_user = User.objects.filter(username=user.username)
number_message = number_messages(request, user.username)
ganaderia = Ganaderia.objects.get(perfil=id_user)
- Read upRead up
- Create a ticketCreate a ticket
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 sendNotificationApplicationVaccine
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def sendNotificationApplicationVaccine(self, beliefs_application_vaccine, beliefs_application_vaccine2):
datee = date.today() + relativedelta(days=3)
three_day_before = date.today() - relativedelta(days=3)
one_day_before = date.today() - relativedelta(days=1)
- Read upRead up
- Create a ticketCreate a ticket
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 deferEtapa
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def deferEtapa(request, notification_id):
if request.method == 'POST':
formDeferEtapa = deferEtapaForm(request.POST)
if formDeferEtapa.is_valid():
notification = Notification.objects.get(id=notification_id)
- Read upRead up
- Create a ticketCreate a ticket
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 views.py
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- encoding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.shortcuts import render_to_response
- Create a ticketCreate a ticket
Function performTermsSearch
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
performTermsSearch : function(searchterms, excluded, terms, score) {
var filenames = this._index.filenames;
var titles = this._index.titles;
var i, j, file, files;
- Read upRead up
- Create a ticketCreate a ticket
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 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
#-*- coding: utf-8 -*-
from django.db import models
from profiles.models import Ganaderia
from django.core import serializers
- Create a ticketCreate a ticket
Function ajaxAddListNotificationsReproduccionNoRealizadas
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def ajaxAddListNotificationsReproduccionNoRealizadas(request):
number_search = request.GET['number_search']
user = request.user
farm = Ganaderia.objects.get(perfil=user)
- Read upRead up
- Create a ticketCreate a ticket
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 ajaxAddListNotificationsProduccionRealizadas
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def ajaxAddListNotificationsProduccionRealizadas(request):
number_search = request.GET['number_search']
user = request.user
farm = Ganaderia.objects.get(perfil=user)
- Read upRead up
- Create a ticketCreate a ticket
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 ajaxAddListNotificationsProduccionNoRealizadas
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def ajaxAddListNotificationsProduccionNoRealizadas(request):
number_search = request.GET['number_search']
user = request.user
farm = Ganaderia.objects.get(perfil=user)
- Read upRead up
- Create a ticketCreate a ticket
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 ajaxAddListNotificationsReproduccionRealizadas
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def ajaxAddListNotificationsReproduccionRealizadas(request):
number_search = request.GET['number_search']
user = request.user
farm = Ganaderia.objects.get(perfil=user)
- Read upRead up
- Create a ticketCreate a ticket
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 displayNextItem
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayNextItem() {
// results left, load the summary and display it
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
- Create a ticketCreate a ticket
Function sendNotificationChangeCicloSeco
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def sendNotificationChangeCicloSeco(self, beliefs_seco):
datee = date.today() + relativedelta(days=3)
one_day_before = date.today() - relativedelta(days=1)
user = User.objects.get(id=user_name)
farm = Ganaderia.objects.get(perfil=user)
- Read upRead up
- Create a ticketCreate a ticket
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 sendNotificationParto
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def sendNotificationParto(self, beliefs_parto):
datee = date.today() + timedelta(days=12)
one_day_before = date.today() - relativedelta(days=1)
user = User.objects.get(id=user_name)
farm = Ganaderia.objects.get(perfil=user)
- Read upRead up
- Create a ticketCreate a ticket
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 gestacion
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def gestacion(request, id_cattle):
user = request.user
number_message = number_messages(request, user.username)
farm = Ganaderia.objects.get(perfil=user)
configuration = Configuracion.objects.get(id=farm.configuracion_id)
- Read upRead up
- Create a ticketCreate a ticket
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 performObjectSearch
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
performObjectSearch : function(object, otherterms) {
var filenames = this._index.filenames;
var objects = this._index.objects;
var objnames = this._index.objnames;
var titles = this._index.titles;
- Create a ticketCreate a ticket
Function initEvents
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initEvents() {
$('a.comment-close').live("click", function(event) {
event.preventDefault();
hide($(this).attr('id').substring(2));
});
- Create a ticketCreate a ticket
Function ajaxAssignCattleVaccineFinal
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def ajaxAssignCattleVaccineFinal(request):
id_wormer = request.GET['id_vaccine']
listCattle = str(request.GET['listCattle'])
user = request.user
ganaderia = Ganaderia.objects.get(perfil=user)
- Read upRead up
- Create a ticketCreate a ticket
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 ajaxAssignCattleWormerFinal
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def ajaxAssignCattleWormerFinal(request):
id_wormer = request.GET['id_wormer']
listCattle = str(request.GET['listCattle'])
user = request.user
ganaderia = Ganaderia.objects.get(perfil=user)
- Read upRead up
- Create a ticketCreate a ticket
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"