julienmalard/Tikon

View on GitHub

Showing 189 of 189 total issues

Datos has 64 functions (exceeds 20 allowed). Consider refactoring.
Open

class Datos(object):
    def __init__(símismo, val, dims, coords, nombre=None, atribs=None, _verif=True, _conv_coords=None):

        if not isinstance(val, np.ndarray):
            if isinstance(val, (list, tuple)):
Severity: Major
Found in tikon/central/matriz.py - About 1 day to fix

    File matriz.py has 452 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import functools
    from typing import Any, Optional, Union, List
    
    import numpy as np
    import pandas as pd
    Severity: Minor
    Found in tikon/central/matriz.py - About 6 hrs to fix

      File a_prioris.py has 312 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # Un documento con todas las distribuciones a prioris necesarias para el modelo de O. arenosella
      
      
      """
      
      
      Severity: Minor
      Found in tikon/ejemplos/proyectos/opisina_arenosella/a_prioris.py - About 3 hrs to fix

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

            def __init__(símismo, nombre, exper, sim, datos, n_reps):
                super().__init__(nombre, exper, sim=sim, datos=datos, n_reps=n_reps)
                líms = proc_líms(sim.líms)
                # para hacer: estandardizar
                if símismo.datos.obs:
        Severity: Minor
        Found in tikon/central/paráms_exper.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 de_dens has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            def de_dens(
                    cls, dens: int | float, líms_dens: Optional[Líms_Con_None],
                    líms: Optional[Líms_Con_None]
            ) -> "DistAnalítica":
                líms_dens_resueltas = np.array(proc_líms(líms_dens))
        Severity: Minor
        Found in tikon/ecs/dists/anlt.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 de_traza has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

            def de_traza(cls, trz: Tipo_Matriz_Numérica, líms: Líms_Con_None, permitidas: list[str] = None):
                permitidas = permitidas or list(utils.dists)
        
                líms = proc_líms(líms)
                if trz.min() < líms[0] or trz.max() > líms[1]:
        Severity: Minor
        Found in tikon/ecs/dists/anlt.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

        File utils.py has 288 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        from math import pi
        from typing import TypedDict, Union, Optional
        
        import numpy as np
        import scipy.stats as estad
        Severity: Minor
        Found in tikon/ecs/dists/utils.py - About 2 hrs to fix

          Function _calc_ has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

          def _calc_índices(_dic, _coords, _dims):
              índices = []
              í_crds = {ll: list(range(len(v))) for ll, v in _coords.items()}
              for dm in _dims:
                  if dm in _dic:
          Severity: Minor
          Found in tikon/central/matriz.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 apriori_de_obs has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              def apriori_de_obs(símismo, obs, índ):
                  etp = índ[EJE_ETAPA]
          
                  def _extr_ref(e=None):
                      if e:
          Severity: Minor
          Found in tikon/móds/rae/red/res/res.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

          Organismo has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Organismo(Coso):
              """
              Un organismo es la clase pariente para cualquier especie en una red agroecológica.
              """
          
          
          Severity: Minor
          Found in tikon/móds/rae/orgs/organismo.py - About 2 hrs to fix

            PlantillaRamaEc has 21 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class PlantillaRamaEc(object):
                cls_ramas: Sequence[Type["PlantillaRamaEc"]] = []
            
                _cls_en_coso: "Type[PlantillaRamaEcCoso]" = NotImplemented
                _nombre_res: str = NotImplemented
            Severity: Minor
            Found in tikon/ecs/árb_mód.py - About 2 hrs to fix

              File test_datos.py has 254 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import unittest
              
              import numpy as np
              import numpy.testing as npt
              import xarray as xr
              Severity: Minor
              Found in pruebas/test_datos/test_datos.py - About 2 hrs to fix

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

                def _gen_f_expandir_dims(dims_datos, coords_datos, dims, coords, guardar_orden):
                    dims_prior, extras = (dims_datos, dims) if guardar_orden else (dims, dims_datos)
                    d_final = tuple([*dims_prior, *(d for d in extras if d not in dims_prior)])
                
                    if dims_datos != d_final:
                Severity: Minor
                Found in tikon/central/matriz.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_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 graficar_res has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                def graficar_res(
                        título, directorio, simulado, obs=None, color='#99CC00', promedio=True, incert='confianza',
                        etiq_x=None, etiq_y=None
                ):
                    obs = obs or []
                Severity: Minor
                Found in tikon/datos/dibs.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 verificar_reqs has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    def verificar_reqs(símismo):
                
                        for sim_mód in símismo:
                            reqs_mód = símismo[sim_mód].requísitos() or []
                            for req in reqs_mód:
                Severity: Minor
                Found in tikon/central/simul.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 de_cuadro has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def de_cuadro(cls, datos_pd, corresp, eje_principal, parc=None, tiempo=None, coords=None, factor=1, **argsll):
                        if isinstance(datos_pd, str):
                            datos_pd = pd.read_csv(datos_pd, encoding='utf8')
                        corresp = corresp or {}
                        for ll, v in corresp.items():
                Severity: Minor
                Found in tikon/datos/obs.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, raíz, palo, sabia, hoja, flor, fruta, semilla, variedad=None, tipo_ecs=None):
                Severity: Major
                Found in tikon/móds/rae/orgs/plantas/base.py - About 1 hr to fix

                  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 concuerda has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def concuerda(símismo, etapa: Etapa) -> bool:
                          def _obt_huésped_base(f: EtapaFantasma) -> [Organismo, Etapa]:
                              etapa_huésped = f.etp_hués
                              if isinstance(etapa_huésped, EtapaFantasma):
                                  return _obt_huésped_base(etapa_huésped)
                  Severity: Minor
                  Found in tikon/móds/rae/orgs/etapa.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

                  Severity
                  Category
                  Status
                  Source
                  Language