RadarParlamentar-MES2017-1/radar

View on GitHub
radar_parlamentar/importadores/camara_genero.py

Summary

Maintainability
A
3 hrs
Test Coverage

Function contabiliza_termos_geral has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def contabiliza_termos_geral(lista_indexadas):
    for proposicao in lista_indexadas:
        for termo in proposicao['txtIndexacao']:
            if termo not in DESCARTADAS:
                if termo in DIC_TERMOS:
Severity: Minor
Found in radar_parlamentar/importadores/camara_genero.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 proposicoes_indexadas has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def proposicoes_indexadas(lista_proposicoes):
    indexados = []
    for proposicao in lista_proposicoes:
        if proposicao['txtIndexacao'] and proposicao['txtSiglaPartido']:
            if proposicao['txtSiglaPartido'].strip() in LISTA_BASE_PARTIDOS:
Severity: Minor
Found in radar_parlamentar/importadores/camara_genero.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 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']
Severity: Minor
Found in radar_parlamentar/importadores/camara_genero.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

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:
Severity: Minor
Found in radar_parlamentar/importadores/camara_genero.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

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 = []
Severity: Minor
Found in radar_parlamentar/importadores/camara_genero.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