Showing 59 of 93 total issues
Function get_by_regional
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_by_regional(iso, id1, id2, geojson, area_ha):
Function get_by_regional
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_by_regional(iso, id1, id2, geojson, area_ha):
Function get_by_regional
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_by_regional(iso, id1, id2, geojson, area_ha):
Function analyze
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def analyze(year, z, x, y, map_object):
Function analyze_recent_tiles
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def analyze_recent_tiles(data_array, bands, bmin, bmax, opacity):
Function get_by_regional
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_by_regional(iso, id1, id2, geojson, area_ha):
Function get_by_regional
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_by_regional(iso, id1, id2, geojson, area_ha):
Function get_tile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_tile(year, z, x, y, map_object=None):
Function get_by_regional
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_by_regional(iso, id1, id2, geojson, area_ha):
Function get_by_thumb
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_by_thumb(data_array, bands, bmin, bmax, opacity):
Avoid too many return
statements within this function. Open
return jsonify(data=serialize_biomass_v1(data, 'biomasses')), 200
Avoid too many return
statements within this function. Open
return jsonify(data=serialize_biomass_v2(data, 'biomass-loss')), 200
Avoid too many return
statements within this function. Open
return jsonify(data=serialize_umd(data, 'umd')), 200
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"
Further reading
Function get_sentinel_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_sentinel_params(func):
@wraps(func)
def wrapper(*args, **kwargs):
if request.method == 'GET':
lat = request.args.get('lat')
- 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 return_pixel_count
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def return_pixel_count():
if request.method == 'GET':
pixel_count = request.args.get('pixel_count', None)
else:
pixel_count = request.get_json().get('pixel_count', None) if request.get_json() else 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 serialize_recent_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def serialize_recent_url(analysis, type):
logging.info("[SERIALISER] Initiating")
"""Convert output of images to json"""
tmp_output = []
output = {}
- 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 gen_mountain_sentence
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def gen_mountain_sentence(stats):
is_mountain = stats.get('isMountain').get('1', 0)
not_mountain = stats.get('isMountain').get('0', 0)
total_mountain = not_mountain + is_mountain
mountain_sentence = 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 decode_response
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def decode_response(begin, end, gee_response, layer):
requested_years = range(int(begin + 2000), int(end + 2000) + 1)
lulc_vals = valid_lulc_codes(layer)
- 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"