nexgddp/services/query_service.py
File query_service.py
has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""QUERY SERVICE"""
import logging
import os
import tempfile
Function get_tile_diff_query
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_tile_diff_query(bbox, year, model, scenario, indicator, bounds, year_b, dset_b):
Function get_all_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_all_data(scenario, model, years, bbox):
logging.info('[QueryService] Getting * data from rasdaman')
year_min = sorted(years)[0]
year_max = sorted(years)[-1]
results = []
- 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_tile_query
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_tile_query(bbox, year, model, scenario, indicator, bounds):
Function get_stats
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_stats(scenario, model, years, indicator, bbox, function):
Function get_tile_mask_query
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_tile_mask_query(bbox, year, model, scenario, indicator, no_data):
Function get_temporal_series
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_temporal_series(scenario, model, years, indicator, bbox):
logging.info('[QueryService] Getting temporal series from rasdaman')
year_min = sorted(years)[0].replace("'", '') if type(sorted(years)[0]) == 'string' else sorted(years)[0]
year_max = sorted(years)[-1].replace("'", '') if type(sorted(years)[-1]) == 'string' else sorted(years)[-1]
logging.info(year_min)
- 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"