Showing 8 of 12 total issues
Function format_dataset_query
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def format_dataset_query(dataset_name, params):
agg_by = params['aggregate_by']
agg_values = params['aggregate_values']
agg_admin = params['aggregate_admin']
- 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 create_time_table
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def create_time_table(dataset_name, data, params):
agg_by = params["aggregate_by"]
agg_values = params["aggregate_values"]
agg_admin = params["aggregate_admin"]
agg_time = params["aggregate_time"]
- 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 validate_period
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def validate_period(minYear, params):
# validate period
today = datetime.datetime.now()
period = request.args.get("period", 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 validate_aggregate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def validate_aggregate(params):
# validate aggregate
agg_values = request.args.get("aggregate_values")
agg_by = request.args.get("aggregate_by")
agg_admin = request.args.get("aggregate_admin")
- 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 validate_args_fires
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def validate_args_fires(func):
"""Validate user arguments"""
@wraps(func)
def wrapper(*args, **kwargs):
- 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 load_adm_rows
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_adm_rows(dataset_name, params):
valid_rows = load_valid_poly_iso(dataset_name)
# looks like [<iso>] or [iso, adm1] or [iso, adm1, adm2]
- 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 summarize_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def summarize_data(dataset_name, params, is_valid_combo):
# we've already validated that the input iso/adm1/adm2 exists, and the
# polyname (if applicable) exists. Now time to see if the full combo
# (like - wdpa/BRA/1/1) exists in the world
- 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 worker_int
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def worker_int(worker):
worker.log.info("worker received INT or QUIT signal")
## get traceback info
import threading, sys, traceback
- 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"