Function leer_archivo
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def leer_archivo(nombre_arch_contenido, nombre_arch_plantilla, paráms_ent=None):
if paráms_ent is None:
paráms_ent = []
dic_paráms = {'#': []}
- Read upRead up
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 escribir_archivo
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
def escribir_archivo(dic_paráms, nombre_arch_contenido, nombre_arch_plantilla, paráms_ent=None):
# k=1
dic_config = {}
with open(nombre_arch_contenido, 'w') as archContenido, open(nombre_arch_plantilla, 'r') as arch_plantilla:
for templatelínea in arch_plantilla:
- Read upRead up
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:
- Read upRead up
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)
- Read upRead up
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:
- Read upRead up
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)):
- Read upRead up
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)
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]])
Function escribir_archivo
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def escribir_archivo(dic_paráms, nombre_arch_contenido, nombre_arch_plantilla, paráms_ent=None):
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('*')
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)
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]])
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:
- Read upRead up
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"