File recent_tiles.py
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""EE SENTINEL TILE URL SERVICE"""
import asyncio
import collections
import functools as funct
Function recent_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def recent_data(lat, lon, start, end, sort_by):
logging.info("[RECENT>DATA] function initiated")
try:
point = ee.Geometry.Point(float(lon), float(lat))
S2 = (
- 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 recent_thumbs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def recent_thumbs(col_data, bands, bmin, bmax, opacity):
"""Takes collection data array and fetches thumbs"""
source = col_data["source"]
logging.info(f"[RECENT>THUMB] {source}")
- 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 recent_tiles
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def recent_tiles(col_data, bands, bmin, bmax, opacity):
"""Takes collection data array and fetches tiles"""
logging.info(f"[RECENT>TILE] {col_data.get('source')}")
source = col_data["source"]
- 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_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"