julienmalard/Tinamit

View on GitHub

Showing 188 of 188 total issues

Function prod has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    def prod(símismo, x):
        coef = None
        op = x.children[1].children[0]
        args = [x.children[0], x.children[2]]
        for i, a in enumerate(args):
Severity: Minor
Found in tinamit0/calibs/sintx/_vstr.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_vars has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def _gen_vars(mod):
    l_vars = []

    internos = ['FINAL TIME', 'TIME STEP', 'SAVEPER', 'INITIAL TIME']
    for i, f in mod.doc().iterrows():
Severity: Minor
Found in tinamit0/envolt/mds/pysd/_envolt.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 validar has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    def validar(símismo, t, datos, paráms=None, funcs=None, vars_extern=None, corresp_vars=None, clima=None):
        """
        Efectua la validación.

        Parameters
Severity: Minor
Found in tinamit0/calibs/valid.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 anal_l has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def anal_línea_d(línea, nombres_paráms, delim, dic_paráms):
    línea = línea.strip()
    if delim == 'W':
        valores = línea.split()
    else:
Severity: Minor
Found in src/tinamit/envolt/mbf/sahysmod/_arch_ingr/_anlzd_sntct.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 _extraer_de_archivo has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def _extraer_de_archivo(archivo):
    if not os.path.isfile(archivo):
        raise FileNotFoundError(_('El archivo siguiente no existe... :(\n\t{}').format(archivo))

    if os.path.splitext(archivo)[1] != '.py':
Severity: Minor
Found in tinamit0/envolt/bf/_auto.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 anal_l has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def anal_línea_d(línea, nombres_paráms, delim, dic_paráms):
    línea = línea.strip()
    if delim == 'W':
        valores = línea.split()
    else:
Severity: Minor
Found in tinamit0/envolt/bf/sahysmod/_arch_ingr/_anlzd_sntct.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 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(símismo, cód, nombre, unid, ingr, egr, tmñ_bloques, inic=0, líms=None, info=''):
Severity: Major
Found in tinamit0/envolt/bf/sahysmod/_vars.py - About 1 hr to fix

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

        def __init__(símismo, lugar):
    
            sub_ords = list(set(sub.ord_niveles.ords for sub in lugar.sub_lugares))
            ords = []
            for sb in sub_ords:
    Severity: Minor
    Found in tinamit0/geog/región.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 construir_l has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def construir_línea(nombres_paráms, espec_línea, dic_paráms, dic_config, paráms_ent):
        if paráms_ent is not None:
            for p in dic_paráms:
                if p in paráms_ent:
                    dic_paráms[p] = dic_paráms[p].astype(int)
    Severity: Minor
    Found in src/tinamit/envolt/mbf/sahysmod/_arch_ingr/_anlzd_sntct.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 obt_exe has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def obt_exe(
            nombre: str,
            url: Union[str, Instalador],
            versión: Optional[Union[str, Number]] = None
    ) -> Optional[str]:
    Severity: Minor
    Found in src/tinamit/instalador.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 dibujar_mapa_de_res has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def dibujar_mapa_de_res(
            forma_dinámica, res, var, t, escala=None, título='', directorio=None, otras_formas=None
    ):
        """
        Dibujar los resultados de una simulación en un mapa.
    Severity: Minor
    Found in tinamit0/geog/mapa.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 construir_l has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def construir_línea(nombres_paráms, espec_línea, dic_paráms, dic_config, paráms_ent):
        if paráms_ent is not None:
            for p in dic_paráms:
                if p in paráms_ent:
                    dic_paráms[p] = dic_paráms[p].astype(int)
    Severity: Minor
    Found in tinamit0/envolt/bf/sahysmod/_arch_ingr/_anlzd_sntct.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 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(símismo, nombre, unid, ingr, egr, ec, parientes, inic, subs=None, líms=None, info=''):
    Severity: Major
    Found in tinamit0/envolt/mds/_vars.py - About 1 hr to fix

      Function cmd_vensim has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      def cmd_vensim(func, args, mensaje_error=None, val_error=None):  # pragma: sin cobertura
          """
          Esta función sirve para llamar todo tipo_mod de comanda Vensim.
      
          Parameters
      Severity: Minor
      Found in tinamit0/envolt/mds/vensim_dll/_funcs.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 guardar has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def guardar(símismo, frmt='json', l_vars=None, arch=None):
              """
              Guarda los resultados en un archivo.
      
              Parameters
      Severity: Minor
      Found in tinamit0/mod/res.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 _correr_hasta_final has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def _correr_hasta_final(símismo):
              t = símismo.corrida.t
      
              t_inic_mod = símismo.mod.time._t
              eje_pysd = np.arange(
      Severity: Minor
      Found in tinamit0/envolt/mds/pysd/_envolt.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 validar has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def validar(símismo, t, datos, paráms=None, funcs=None, vars_extern=None, corresp_vars=None, clima=None):
              """
              Efectuar la validación.
      
              Parameters
      Severity: Minor
      Found in tinamit0/calibs/geog_mod.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 calibrar has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def calibrar(símismo, bd, lugar=None, líms_paráms=None, ops=None, corresp_vars=None, ord_niveles=None):
              """
              Efectua una calibración para cada lugar en ``Lugar`` según los datos en ``bd``.
      
              Parameters
      Severity: Minor
      Found in tinamit0/calibs/ec/_opt.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 11 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(símismo, nombre, nombre_py, unid, ec, parientes, inic=0, subs=None, líms=None, info=''):
      Severity: Major
      Found in tinamit0/envolt/mds/pysd/_vars.py - About 1 hr to fix

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

            def __init__(símismo, nombre, nombre_py, unid, ec, parientes, inic=0, subs=None, líms=None, info=''):
        Severity: Major
        Found in tinamit0/envolt/mds/pysd/_vars.py - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language