mricharleon/HatosGanaderos

View on GitHub

Showing 192 of 3,000 total issues

Function sendNotificationTerneras has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    def sendNotificationTerneras(self, beliefs_terneras):
        datee = date.today() + relativedelta(days=10)
        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 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 edita_ganado has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

def edita_ganado(request, ganado_id):
    id_user = request.user
    number_message = number_messages(request, id_user.username)
    ganaderia = Ganaderia.objects.get(perfil=id_user)
    configuracion = Configuracion.objects.get(id=ganaderia.configuracion_id)
Severity: Minor
Found in ganados/views.py - About 7 hrs 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 searchtools.js has 458 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * searchtools.js_t
 * ~~~~~~~~~~~~~~~~
 *
 * Sphinx JavaScript utilties for the full-text search.
Severity: Minor
Found in SIDGV/templates/_build/html/_static/searchtools.js - About 7 hrs to fix

Function performObjectSearch has a Cognitive Complexity of 44 (exceeds 5 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;
Severity: Minor
Found in SIDGV/templates/_build/html/_static/searchtools.js - About 6 hrs 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 query has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

  query : function(query) {
    var i;
    var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];

    // stem the searchterms and add them to the correct list
Severity: Minor
Found in SIDGV/templates/_build/html/_static/searchtools.js - About 6 hrs 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 151 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Stemmer = function() {

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

Function _process has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
Open

        def _process(self):
            user = User.objects.get(id=user_name)
            farm = Ganaderia.objects.get(perfil=user)
            beliefs = BeliefSanidad()
            desires = DesireSanidad()
Severity: Minor
Found in webServices/wsGanados/views.py - About 5 hrs 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 sendNotificationVientre has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    def sendNotificationVientre(self, beliefs_fierro):
        datee = date.today() + relativedelta(days=10)
        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 5 hrs 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 edita_ganado_celo has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

def edita_ganado_celo(request, ganado_id):
    id_user = request.user
    number_message = number_messages(request, id_user.username)
    ganaderia = Ganaderia.objects.get(perfil=id_user)
    configuracion = Configuracion.objects.get(id=ganaderia.configuracion_id)
Severity: Minor
Found in ganados/views.py - About 5 hrs 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 edita_ganado_ordenio has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
Open

def edita_ganado_ordenio(request, ganado_id, num_ordenio):
    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)
Severity: Minor
Found in ganados/views.py - About 5 hrs 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 view_report_female has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

def view_report_female(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 reports/views.py - About 4 hrs 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 query has 115 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  query : function(query) {
    var i;
    var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];

    // stem the searchterms and add them to the correct list
Severity: Major
Found in SIDGV/templates/_build/html/_static/searchtools.js - About 4 hrs to fix

Function stemWord has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  this.stemWord = function (w) {
    var stem;
    var suffix;
    var firstch;
    var origword = w;
Severity: Major
Found in SIDGV/templates/_build/html/_static/searchtools.js - About 4 hrs to fix

Function sendNotificationVerification has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def sendNotificationVerification(self, beliefs_verification):
        datee = date.today() + timedelta(days=2)
        one_day_before = date.today() - relativedelta(days=1)
        two_day_before = date.today() - relativedelta(days=2)
        user = User.objects.get(id=user_name)
Severity: Minor
Found in webServices/wsGanados/views.py - About 4 hrs 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 sendNotificationFierro has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def sendNotificationFierro(self, beliefs_media):
        datee = date.today() + relativedelta(days=10)
        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 hrs 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 sendNotificationVaca has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def sendNotificationVaca(self, beliefs_vientre):
        datee = date.today() + relativedelta(days=10)
        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 hrs 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 ajaxAddListNotificationsSanidadNoRealizadas has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def ajaxAddListNotificationsSanidadNoRealizadas(request):
    number_search = request.GET['number_search']
    user = request.user
    farm = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 3 hrs 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 ajaxAddListNotificationsAlimentacionNoRealizadas has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def ajaxAddListNotificationsAlimentacionNoRealizadas(request):
    number_search = request.GET['number_search']
    user = request.user
    farm = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 3 hrs 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 ajaxAddListNotificationsSanidadRealizadas has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

def ajaxAddListNotificationsSanidadRealizadas(request):
    number_search = request.GET['number_search']
    user = request.user
    farm = Ganaderia.objects.get(perfil=user)

Severity: Minor
Found in webServices/wsGanados/views.py - About 3 hrs 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 messages_details has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

def messages_details(request, user_id, user_send_id, user_receiver_id):
    user = User.objects.get(id=user_id)
    user_send = User.objects.get(id=user_send_id)
    user_receiver = User.objects.get(id=user_receiver_id)

Severity: Minor
Found in messages/views.py - About 3 hrs 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