Showing 59 of 93 total issues
Function get_geo_by_geom
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def get_geo_by_geom(func):
"""Get geometry data"""
@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 get_composite_image
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_composite_image(geojson, instrument, date_range, thumb_size, \
Function get_by_geostore
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_by_geostore(lat, lon, start, end, sort_by, bands, bmin, bmax, opacity):
Function analyze_recent_data
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def analyze_recent_data(lat, lon, start, end, sort_by, bands, bmin, bmax, opacity):
Function validate_bands
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def validate_bands(bands, instrument):
"""Validate and serialide bands"""
# Format
if type(bands) == str:
bands = bands[1:-1].split(",")
- 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 set_params
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def set_params():
"""-"""
threshold = int(request.args.get('thresh', 30))
begin = request.args.get('begin', '2000-01-01')
end = request.args.get('end', '2019-12-31')
- 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 analyze
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def analyze(threshold, geojson, begin, end, aggregate_values=True,
Function get_composite_image
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_composite_image(geojson, instrument, date_range, thumb_size, \
classify, band_viz, get_dem, get_stats, show_bounds, cloudscore_thresh):
logging.info(f"[COMPOSITE SERVICE]: Creating composite")
try:
features = geojson.get('features')
- 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_recent_thumbs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_recent_thumbs(func):
@wraps(func)
def wrapper(*args, **kwargs):
if request.method == 'POST':
- 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_recent_tiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_recent_tiles(func):
@wraps(func)
def wrapper(*args, **kwargs):
if request.method == 'POST':
data_array = request.get_json().get('source_data', [])
- 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 analyze
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def analyze(geojson, area_ha):
"""Analyze Hansen"""
if not geojson:
return error(status=400, detail='Geojson is required')
threshold, begin, end, table = set_params()
- 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_extent_fc
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_extent_fc(image, fc, method='reduce_regions', bestEffort=False, scale=False, numPixels=10000):
Function gen_intact_sentence
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def gen_intact_sentence(stats):
not_intact = stats.get('intact2016').get('0', 0)
is_intact = stats.get('intact2016').get('1', 0)
total_intact = not_intact + is_intact
intact_sentence = ""
- 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 lookup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def lookup(layer, result_dict, count_pixels):
lkp = all_lulc_dict[layer]
if count_pixels:
area_type = 'pixelCount'
- 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_title_elements
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_title_elements(s):
"""Take reverse geocoding results for upper and lower corners of a polygons bounds,
Extract the region, county, country, continent attributes of the locations.
Use the overlap to set an appropriate title.
"""
- 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_by_regional
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_by_regional(iso, id1, id2, geojson, area_ha):
Function analyze_recent_thumbs
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def analyze_recent_thumbs(data_array, bands, bmin, bmax, opacity):
Function get_by_tile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_by_tile(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 analyze
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def analyze(threshold, geojson, begin, end, layer, count_pixels):