Showing 109 of 335 total issues
Function download_content
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def download_content(link, verify_link=config.get_download_verify_link(), post_parm=None, headers=None,
encoding='utf-8'):
try:
if post_parm is None:
logging.debug('Downloading without post parameters.')
- 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 query_name_road_around
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def query_name_road_around(self, lon, lat, name='', with_metadata=True, mode='both'):
'''
Search for road with name specified around the lon, lat point location in OpenStreetMap database based on
within preconfigured distance
:param lon: Longitude parameter. Looking for roads around this geom.
- 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 export_grouped_poi_data_with_postcode_groups
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def export_grouped_poi_data_with_postcode_groups(data):
try:
# Generating CSV files group by poi_code and postcode
output_dir = data[0]
filename = data[1]
- 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
Avoid too many return
statements within this function. Open
return None
Avoid too many return
statements within this function. Open
return geom_point(lat, lon, proj)
Function relationer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def relationer(relation_text):
if relation_text is None:
return None
data = []
for i in range(0, len(relation_text), 2):
- 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 print
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def print(self):
print(self.nodes)
print(self.ways)
for key, value in self.nodes.items():
print(key)
- 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 __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, db_connection, retry_counter=100, retry_sleep=30):
reco = 0 # Actual retry counter
self.db_retry_counter = retry_counter
self.db_retry_sleep = retry_sleep
self.db_connection = db_connection
- 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_or_create_cache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_or_create_cache(session, model, **kwargs):
if kwargs.get('osm_id') is not None and kwargs.get('osm_object_type'):
instance = session.query(model) \
.filter_by(osm_id=kwargs.get('osm_id')).filter_by(osm_object_type=kwargs.get('poi_addr_city')).first()
if instance:
- 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"