julienmalard/Tinamit

View on GitHub
src/tinamit/envolt/mbf/sahysmod/_arch_ingr/_anlzd_sntct.py

Summary

Maintainability
C
7 hrs
Test Coverage

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

def construir_línea_f(nombres_paráms, anchura_cols, dic_paráms):  # pragma: sin cobertura
    línea_egr = ''
    matriz_paráms = 0
    for i in range(len(anchura_cols)):
        if not matriz_paráms:
Severity: Minor
Found in src/tinamit/envolt/mbf/sahysmod/_arch_ingr/_anlzd_sntct.py - About 55 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 anlz_l has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def anlz_línea_f(línea, nombres_parámetros, anchura_cols, dic_parámetros):  # pragma: sin cobertura
    cursor = 0
    matriz_paráms = 0

    for i in range(len(anchura_cols)):
Severity: Minor
Found in src/tinamit/envolt/mbf/sahysmod/_arch_ingr/_anlzd_sntct.py - About 55 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 tupla_plantilla[0][0:4] != 'FOR[':
                        await archContenido.write(
                            construir_línea(tupla_plantilla[1], tupla_plantilla[0], dic_paráms, dic_config, paráms_ent)
                        )
                    else:
Severity: Major
Found in src/tinamit/envolt/mbf/sahysmod/_arch_ingr/_anlzd_sntct.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if template_tuple[0][0:4] != 'FOR[':
                            línea_contenido = await archContenido.readline().strip('\n')
                            anal_línea(línea_contenido, template_tuple[1], template_tuple[0], dic_paráms)
                        else:
                            dims = [i.strip(']') for i in template_tuple[0].split('[')][1:]
    Severity: Major
    Found in src/tinamit/envolt/mbf/sahysmod/_arch_ingr/_anlzd_sntct.py - About 45 mins to fix

      Function construir_l has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def construir_línea_l(nombres_parámetros, dic_parámetros):
          if nombres_parámetros[0] == '#':
              try:
                  línea = dic_parámetros['#'].pop(0)
              except KeyError:
      Severity: Minor
      Found in src/tinamit/envolt/mbf/sahysmod/_arch_ingr/_anlzd_sntct.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