Showing 117 of 117 total issues
Function base_query
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def base_query(self, field):
select_query = 'SELECT b.:field, a.count, b.year FROM (SELECT :field , count, year::text'
from_query = ' FROM :view_name'
where_query = ' WHERE :field IS NOT NULL'
- 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
if data_year == self.results[i].data_year:
d.value = d.value + getattr(self.results[i], self.keys[j].column_name)
d.value = int(d.value)
Function query
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def query(self, args):
base_query = None
qry = None
param_dict = {}
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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, field, year=None, state_id=None, state_abbr=None, ori=None, as_json=True):
Function get_offenses
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_offenses(offense):
if offense == 'aggravated-assault':
return ['Aggravated Assault']
elif offense == 'burglary':
return ['Burglary/Breaking & Entering']
- 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
if data_year == self.results[i].data_year and keytype == getattr(self.results[i], self.key_type):
d.value = d.value + getattr(self.results[i], self.keys[j].column_name)
d.value = int(d.value)
Function base_query
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def base_query(self, field):
query = 'SELECT b.:field, a.count, b.year FROM (SELECT :field ,stolen_value::text, recovered_value::text, year::text, count'
query += ' FROM :view_name '
where_query = ' WHERE :field IS NOT NULL'
- 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
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, args, variable,queryType,state_abbr=None, offense_name=None):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, state = None, agency = None, year = None, county = None, explorer_offense = None):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, args, variable, state_id=None, state_abbr=None, ori=None):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, args, variable, state_id=None, state_abbr=None, ori=None):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, state = None, agency = None, year = None, county = None, classification = None):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, args, variable, state_id=None, state_abbr=None, ori=None):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, state = None, agency = None, year = None, county = None, explorer_offense = None):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,ui_type,title,category,noun,short_title):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, args, variable, state_id=None, state_abbr=None, ori=None):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, args, variable, state_id=None, state_abbr=None, ori=None):
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self, args, variable,queryType,ori=None, offense_name=None):
Function __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, field, year=None, state_id=None, ori=None,
offense_name=None, state_abbr=None, explorer_offense=None, as_json=True):
self.as_json = as_json
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get(self, state = None, agency = None, year = None, county = None, explorer_offense = None):
"""Get Agency Sums given a state/year/county/agency ori, etc."""
query = AgencySums.query
if state:
- 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"