julienmalard/Tinamit

View on GitHub

Showing 184 of 188 total issues

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

    def _act_vals_clima(símismo, f_0, f_1, vars_clima=None):

        vars_clima = vars_clima or símismo.vars_clima

        # Actualizar datos de clima
Severity: Minor
Found in tinamit0/envolt/bf/_bloq.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

                    for indices in itertools.product(*iterdims):
                        dic_temp = {}
                        for especLínea in tuple_espec_línea:
                            línea_contenido = archContenido.readline().strip('\n')
                            anal_línea(línea_contenido, especLínea[1], especLínea[0], dic_temp)
Severity: Major
Found in tinamit0/envolt/bf/sahysmod/_arch_ingr/_anlzd_sntct.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        for i in range(len(dims)):
                            try:
                                dims[i] = int(dims[i])
                            except ValueError:
                                dims[i] = int(dic_paráms[dims[i]])
    Severity: Major
    Found in tinamit0/envolt/bf/sahysmod/_arch_ingr/_anlzd_sntct.py - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          while not _fin_sección(f):
                              vrs = _extraer_vars(f)
                              for var, val in vrs:
                                  if var not in dic_datos:
                                      dic_datos[var] = np.full((n_años, n_est, n_polí), np.nan)
      Severity: Major
      Found in tinamit0/envolt/bf/sahysmod/_arch_egr.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            for especLínea in tuple_espec_línea:
        
                                for nombre_parám in especLínea[1]:
                                    nombre_parám = nombre_parám.strip('*')
                                    dic_paráms[nombre_parám] = _crear_matriz_de_zeros(*dims)
        Severity: Major
        Found in tinamit0/envolt/bf/sahysmod/_arch_ingr/_anlzd_sntct.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              for indices in itertools.product(*iterdims):
                                  dic_temp = {}
                                  for especLínea in línea_espec_tuple:
                                      for nombre_parám in especLínea[1]:
                                          nombre_parám = nombre_parám.strip('*')
          Severity: Major
          Found in tinamit0/envolt/bf/sahysmod/_arch_ingr/_anlzd_sntct.py - About 45 mins to fix

            Consider simplifying this complex logical expression.
            Open

                if leng_orig is None:
                    # Si no conocemos la lengua original, buscar todas.
                    for u in l_u:
                        unid_t = next((x[leng_final] for x in l_dic_trads
                                       if (any([u == d['pr'] for d in x.values()]) or  # si `u` igual a la unidad principal
            Severity: Major
            Found in tinamit0/unids/trads.py - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                  if unid_t is None and (leng_orig == 'en' or leng_orig is None):
                      for u in l_u:
                          try:
                              u_base = regu.get_name(u)
              
              
              Severity: Major
              Found in tinamit0/unids/trads.py - About 40 mins to fix

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

                    def __init__(
                Severity: Minor
                Found in src/tinamit/rebanada.py - About 35 mins to fix

                  Function obt_vals has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def obt_vals(símismo, vars_interés, lugares=None, fechas=None):
                  Severity: Minor
                  Found in tinamit0/datos/fuente.py - About 35 mins to fix

                    Function quitar has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def quitar(símismo, var_fuente, modelo_fuente, modelo_recip, var_recip):
                    Severity: Minor
                    Found in tinamit0/conect/_conex.py - About 35 mins to fix

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

                          def __init__(símismo, archivo, color, llenar, alpha):
                      Severity: Minor
                      Found in tinamit0/geog/mapa.py - About 35 mins to fix

                        Function obt_atrib_var has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def obt_atrib_var(mod, var, cód_attrib, mns_error=None):
                        Severity: Minor
                        Found in tinamit0/envolt/mds/vensim_dll/_funcs.py - About 35 mins to fix

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

                              def __init__(
                          Severity: Minor
                          Found in src/tinamit/hilo.py - About 35 mins to fix

                            Function agregar_trad has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def agregar_trad(unid, trad, leng_trad, leng_orig=None, guardar=True):
                            Severity: Minor
                            Found in tinamit0/unids/trads.py - About 35 mins to fix

                              Function __call__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __call__(símismo, árbol, var, l_vars=None):
                              Severity: Minor
                              Found in tinamit0/calibs/sintx/_vstr.py - About 35 mins to fix

                                Function gen_res has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def gen_res(símismo, nombre, t, vars_interés):
                                Severity: Minor
                                Found in tinamit0/conect/_vars.py - About 35 mins to fix

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

                                      def __init__(símismo, archivo, llenar, alpha, **argsll):
                                  Severity: Minor
                                  Found in tinamit0/geog/mapa.py - About 35 mins to fix

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

                                        def __init__(símismo, nombre: str, plataforma: str, versión: str, url: str):
                                    Severity: Minor
                                    Found in src/tinamit/instalador.py - About 35 mins to fix

                                      Function _buscar has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          def _buscar(símismo, var_fuente, modelo_fuente, modelo_recip, var_recip):
                                      Severity: Minor
                                      Found in tinamit0/conect/_conex.py - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language