Function populate_event_data
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
def populate_event_data():
if len(LastUpdateEventDate.objects) == 0:
LastUpdateEventDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateEventDate.objects.count()
Function populate_mixed_data
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
def populate_mixed_data(last_update):
for event in RequestMixedIndicatorsRawData(last_update).data:
for occurrences in event.occurrences:
if occurrences['space'] != None:
Function populate_agent_data
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
def populate_agent_data():
if len(LastUpdateAgentsDate.objects) == 0:
LastUpdateAgentsDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateAgentsDate.objects.count()
Function populate_library_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
def populate_library_data():
if len(LastUpdateLibraryDate.objects) == 0:
LastUpdateLibraryDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateLibraryDate.objects.count()
Function populate_museum_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
def populate_museum_data():
if len(LastUpdateMuseumDate.objects) == 0:
LastUpdateMuseumDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateMuseumDate.objects.count()
Function get_marker_address
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
def get_marker_address(location):
if location is not None:
if location['latitude'] != '0' or location['longitude'] != '0':
latitude = "lat=" + location['latitude']
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring.
module.exports = function(config) {
config.set({
basePath: '',
Function get_location
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def get_location(j_object, marker_type):
if marker_type == 'project':
if j_object['owner'] is not None:
location = j_object['owner']['location']
else:
Function populate_project_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
def populate_project_data():
if len(LastUpdateProjectDate.objects) == 0:
LastUpdateProjectDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateProjectDate.objects.count()
Avoid deeply nested control flow statements.
if occurrences['space']['acessibilidade'] != '':
accessible_space = str(occurrences['space'][
'acessibilidade']).capitalize()
EventAndSpaceData(event.instance, str(
Function populate_space_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def populate_space_data():
if len(LastUpdateDate.objects) == 0:
LastUpdateDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateDate.objects.count()