julienmalard/Tikon

View on GitHub
tikon/central/calibs.py

Summary

Maintainability
B
6 hrs
Test Coverage

Function gen_dists_calibs has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def gen_dists_calibs(símismo, l_vals_prm, permitidas):
        l_dists = []

        sin_aprioris = list(l_vals_prm)
        if símismo.aprioris:
Severity: Minor
Found in tikon/central/calibs.py - About 1 hr 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 llenar_lista_calibs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def llenar_lista_calibs(símismo, lista, permitidas):

        for val_prm, d_dists in zip(símismo.vals_prms, símismo.dists_disp):
            try:
                existente = next(cnx for cnx in lista if any(_vals_prms_iguales(vl, val_prm) for vl in cnx.vals))
Severity: Minor
Found in tikon/central/calibs.py - About 1 hr 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 llenar has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def llenar(símismo, n_reps):

        índs_dists = {}
        for prm, d_dists in zip(símismo.vals_prms, símismo.dists_disp):
            n_dists = len(d_dists)
Severity: Minor
Found in tikon/central/calibs.py - About 1 hr 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 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(símismo, calibs=None, aprioris=False, corresp=True, heredar_inter=True):
Severity: Minor
Found in tikon/central/calibs.py - About 35 mins to fix

    Function filtrar_dists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def filtrar_dists(símismo, l_vals_prm):
            dists_disp = [pr.dists_disp(símismo.heredar_inter) for pr in l_vals_prm]
    
            if símismo.calibs is not None:
                for i, prm in enumerate(dists_disp):
    Severity: Minor
    Found in tikon/central/calibs.py - About 35 mins 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 llenar_vals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        def llenar_vals(símismo, l_vals_prm, n_reps):
    
            sin_aprioris = list(l_vals_prm)
            if símismo.aprioris:
                for prm in l_vals_prm:
    Severity: Minor
    Found in tikon/central/calibs.py - About 25 mins 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

    There are no issues that match your filters.

    Category
    Status