julienmalard/Tikon

View on GitHub
tikon/central/matriz.py

Summary

Maintainability
D
2 days
Test Coverage

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

      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 _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 __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(símismo, val, dims, coords, nombre=None, atribs=None, _verif=True, _conv_coords=None):
      Severity: Major
      Found in tikon/central/matriz.py - About 1 hr to fix

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

            def f_eje(símismo, f, dim, *args, **argsll):
        Severity: Minor
        Found in tikon/central/matriz.py - About 35 mins to fix

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

          def _gen_f_expandir_dims(dims_datos, coords_datos, dims, coords, guardar_orden):
          Severity: Minor
          Found in tikon/central/matriz.py - About 35 mins to fix

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

                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)):
                            val = np.array(val)
            Severity: Minor
            Found in tikon/central/matriz.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 __setitem__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def __setitem__(símismo, llave, valor):
                    if isinstance(valor, Datos):
                        if isinstance(llave, (dict, frozendict)):
                            dims, coords = símismo._proc_llave(llave)
                        else:
            Severity: Minor
            Found in tikon/central/matriz.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