julienmalard/Tinamit

View on GitHub
tinamit0/calibs/sintx/ec.py

Summary

Maintainability
F
3 days
Test Coverage

Function gen_mod_bayes has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
Open

    def gen_mod_bayes(
            símismo, líms_paráms, obs_x, obs_y, aprioris=None, binario=False, nv_jerarquía=None, í_datos=None,
            trsld_sub=False
    ):

Severity: Minor
Found in tinamit0/calibs/sintx/ec.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 _coef_de_ec has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def _coef_de_ec(árbol, l_vars=None):
    if l_vars is None:
        l_vars = []
    if árbol.data == 'prod':
        arg1 = árbol.children[0]
Severity: Minor
Found in tinamit0/calibs/sintx/ec.py - About 2 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 gen_mod_bayes has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def gen_mod_bayes(
Severity: Major
Found in tinamit0/calibs/sintx/ec.py - About 1 hr to fix

    Avoid deeply nested control flow statements.
    Open

                                if últ_niv:
                                    mu_v = final
    
    
    Severity: Major
    Found in tinamit0/calibs/sintx/ec.py - About 45 mins to fix

      Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(símismo, ec, nombre=None, otras_ecs=None, nombres_equiv=None, dialecto='tinamït'):
      Severity: Minor
      Found in tinamit0/calibs/sintx/ec.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if líms[0] is None:
                                        final = pm.Deterministic(nmbr_mu, líms[1] - pm.math.exp(mu_v))
                                    elif líms[1] is None:
                                        final = pm.Deterministic(nmbr_mu, líms[0] + pm.math.exp(mu_v))
                                    else:
        Severity: Major
        Found in tinamit0/calibs/sintx/ec.py - About 45 mins to fix

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

              def __init__(símismo, ec, nombre=None, otras_ecs=None, nombres_equiv=None, dialecto='tinamït'):
                  """
                  Inicializa un objeto de ecuación.
          
                  Parameters
          Severity: Minor
          Found in tinamit0/calibs/sintx/ec.py - About 45 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

          Avoid deeply nested control flow statements.
          Open

                                      if líms[0] is None:
                                          final = pm.Deterministic(nmbr_mu, líms[1] - pm.math.exp(mu_v))
                                      elif líms[1] is None:
                                          final = pm.Deterministic(nmbr_mu, líms[0] + pm.math.exp(mu_v))
                                      else:
          Severity: Major
          Found in tinamit0/calibs/sintx/ec.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if últ_niv:
                                            mu_v = final
                                else:
            Severity: Major
            Found in tinamit0/calibs/sintx/ec.py - About 45 mins to fix

              There are no issues that match your filters.

              Category
              Status