mricharleon/HatosGanaderos

View on GitHub

Showing 192 of 3,000 total issues

File views.py has 3615 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#-*- coding: utf-8 -*-
from django.db.models import Q
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse
from ganados.models import Ganado, Identificacion_Simple, Ganaderia, Etapa, Identificacion_Ecuador, Ciclo, Verification, Insemination, Ordenio, DeferEtapa, Celo, ProblemaGestacion
Severity: Major
Found in webServices/wsGanados/views.py - About 1 wk to fix

Function __init__ has a Cognitive Complexity of 308 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self):
        self.beliefs_amount_vaccine = []
        self.beliefs_amount_wormer = []
        self.beliefs_expiration_vaccine = []
        self.beliefs_expiration_wormer = []
Severity: Minor
Found in webServices/wsGanados/views.py - About 6 days to fix

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 273 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self):
        self.beliefs_amount_food = []
        self.beliefs_expiration_food = []
        self.beliefs_application_food = []
        self.beliefs_application_food2 = []
Severity: Minor
Found in webServices/wsGanados/views.py - About 5 days to fix

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 sendNotificationCelo has a Cognitive Complexity of 169 (exceeds 5 allowed). Consider refactoring.
Open

    def sendNotificationCelo(self, beliefs_celo):
        datee = date.today() + timedelta(days=3)
        one_day_before = date.today() - relativedelta(days=1)
        user = User.objects.get(id=user_name)
        farm = Ganaderia.objects.get(perfil=user)
Severity: Minor
Found in webServices/wsGanados/views.py - About 3 days to fix

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 wsGanadosProduccion_view has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
Open

def wsGanadosProduccion_view(request):
    search = request.GET['search']
    user = request.user
    ganaderia = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 2 days to fix

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 wsGanados_view has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
Open

def wsGanados_view(request):
    search = request.GET['search']
    user = request.user
    ganaderia = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 2 days to fix

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 ajaxDownCattle_view has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
Open

def ajaxDownCattle_view(request):
    search = request.GET['search']
    user = request.user
    ganaderia = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 2 days to fix

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 wsGanadosVientre_view has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
Open

def wsGanadosVientre_view(request):
    search = request.GET['search']
    user = request.user
    ganaderia = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 2 days to fix

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 wsGanadosVaca_view has a Cognitive Complexity of 133 (exceeds 5 allowed). Consider refactoring.
Open

def wsGanadosVaca_view(request):
    search = request.GET['search']
    user = request.user
    ganaderia = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 2 days to fix

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 1005 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.shortcuts import redirect, get_object_or_404
from django.http import Http404
Severity: Major
Found in ganados/views.py - About 2 days to fix

Function __init__ has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self):
        self.beliefs_celo = ['agent_reproduccion']
        self.beliefs_service = []
        self.beliefs_verification = []
        self.beliefs_parto = []
Severity: Minor
Found in webServices/wsGanados/views.py - About 2 days to fix

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 wsGanadosFierro_view has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
Open

def wsGanadosFierro_view(request):
    search = request.GET['search']
    user = request.user
    ganaderia = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 2 days to fix

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 wsGanadosMedia_view has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
Open

def wsGanadosMedia_view(request):
    search = request.GET['search']
    user = request.user
    ganaderia = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 2 days to fix

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 wsGanadosTerneras_view has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring.
Open

def wsGanadosTerneras_view(request):
    search = request.GET['search']
    user = request.user
    ganaderia = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 2 days to fix

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 add_cattle has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
Open

def add_cattle(request):
    user = request.user
    number_message = number_messages(request, user.username)
    try:
        farm = Ganaderia.objects.get(perfil=user)
Severity: Minor
Found in ganados/views.py - About 1 day to fix

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 websupport.js has 638 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * websupport.js
 * ~~~~~~~~~~~~~
 *
 * sphinx.websupport utilties for all documentation.
Severity: Major
Found in SIDGV/templates/_build/html/_static/websupport.js - About 1 day to fix

Function sendNotificationService has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
Open

    def sendNotificationService(self, beliefs_service):
        one_day_before = date.today() - relativedelta(days=1)
        user = User.objects.get(id=user_name)
        farm = Ganaderia.objects.get(perfil=user)
        configuration = Configuracion.objects.get(id=farm.configuracion_id)
Severity: Minor
Found in webServices/wsGanados/views.py - About 1 day to fix

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 generatePdf has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
Open

def generatePdf(request, cattle_id):
    # Load the rml template into the preprocessor, ...
    template = preppy.getModule('testDoc.prep')
    user = request.user
    farm = Ganaderia.objects.get(perfil=user)
Severity: Minor
Found in reports/views.py - About 1 day to fix

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 Stemmer has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

var Stemmer = function() {

  var step2list = {
    ational: 'ate',
    tional: 'tion',
Severity: Minor
Found in SIDGV/templates/_build/html/_static/searchtools.js - About 1 day to fix

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 problem_gestacion has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
Open

def problem_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)
Severity: Minor
Found in ganados/views.py - About 1 day to fix

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

Severity
Category
Status
Source
Language