Showing 117 of 377 total issues
Avoid too many return
statements within this function. Open
return models.ABSTENCAO
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return models.ABSTENCAO
Function lista_proposicoes_de_mulheres
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def lista_proposicoes_de_mulheres():
camaraws = Camaraws()
prop_finder = ProposicoesFinder()
importador = ImportadorCamara([''])
importador.camara_dos_deputados = importador._gera_casa_legislativa()
- 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 enviar_para_elasticsearch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def enviar_para_elasticsearch(list_json, nome_indice):
es = conectar_em_elastic_search()
for item in list_json:
for key in list(item.keys()):
if item[key] == "":
- 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 plenaria
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def plenaria(request,
nome_curto_casa_legislativa=None,
identificador_proposicao=None):
"""identificador_proposicao: 'PL-123-2015'"""
- 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 analisa_partidos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def analisa_partidos(self):
"""Gera as seguintes saídas:
self.coordenadas_partido # partido => [x,y]
self.tamanhos_partidos # partido => int
self.parlamentares_por_partido # partido => parlamentares
- 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 jsonMatrix_gera_links_partidos_termos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def jsonMatrix_gera_links_partidos_termos():
global matrix
matrix['links'] = []
for p in range(len(matrix['partidos'])):
partidoNome = matrix['partidos'][p]['name']
- 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 retrieve_votacoes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def retrieve_votacoes(self):
try:
casa = models.CasaLegislativa.objects.get(nome_curto='cdep')
except:
casa = None
- 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 partidos_das_proposicoes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def partidos_das_proposicoes(lista_proposicoes):
for proposicao in lista_proposicoes:
if proposicao['txtSiglaPartido']:
partido = proposicao['txtSiglaPartido'].strip()
if partido not in PARTIDOS:
- 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 _scale
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _scale(self, coords):
scaled = {}
for key, coord in list(coords.items()):
x = coord[0]
try:
- 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 votos_from_tree
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def votos_from_tree(self, vot_tree, votacao):
"""Extrai lista de votos do XML da votação e as salva no banco de dados
Argumentos:
vot_tree -- etree dos votos
- 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 parseia_indexacoes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parseia_indexacoes(indexacao):
indexacao1 = [termo.strip()
for termo in indexacao.replace('\n', '').replace('.', '').
replace('_', '').split(',')]
indexacao2 = []
- 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 get_casas_legislativas_com_genero
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_casas_legislativas_com_genero():
casas_legislativas = []
for casa in CasaLegislativa.objects.all():
- 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 transform_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def transform_data(self):
self.csv_rows.append(LABELS)
for votacao in self.votacoes:
votos = votacao.votos()
for voto in votos:
- 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 _votacao_from_xml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _votacao_from_xml(self, votacao_xml, prop):
"""votacao_xml -- XML representando votação (objeto etree)
prop -- objeto do tipo Proposicao
"""
descricao = 'Resumo: [%s]. ObjVotacao: [%s]' % (
- 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 voto
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def voto(self, opcao):
if opcao == models.SIM:
return 1
elif opcao == models.NAO:
return -1
- 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"