Showing 11 of 88 total issues
Function populate_event_data
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def populate_event_data():
if len(LastUpdateEventDate.objects) == 0:
LastUpdateEventDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateEventDate.objects.count()
- 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 populate_agent_data
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def populate_agent_data():
if len(LastUpdateAgentsDate.objects) == 0:
LastUpdateAgentsDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateAgentsDate.objects.count()
- 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 populate_mixed_data
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def populate_mixed_data(last_update):
for event in RequestMixedIndicatorsRawData(last_update).data:
for occurrences in event.occurrences:
if occurrences['space'] != None:
- 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 populate_library_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def populate_library_data():
if len(LastUpdateLibraryDate.objects) == 0:
LastUpdateLibraryDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateLibraryDate.objects.count()
- 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 populate_museum_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def populate_museum_data():
if len(LastUpdateMuseumDate.objects) == 0:
LastUpdateMuseumDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateMuseumDate.objects.count()
- 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_marker_address
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_marker_address(location):
if location is not None:
if location['latitude'] != '0' or location['longitude'] != '0':
latitude = "lat=" + location['latitude']
- 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 exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function get_location
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_location(j_object, marker_type):
if marker_type == 'project':
if j_object['owner'] is not None:
location = j_object['owner']['location']
else:
- 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 populate_project_data
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def populate_project_data():
if len(LastUpdateProjectDate.objects) == 0:
LastUpdateProjectDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateProjectDate.objects.count()
- 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 deeply nested control flow statements. Open
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. Open
def populate_space_data():
if len(LastUpdateDate.objects) == 0:
LastUpdateDate(DEFAULT_INITIAL_DATE).save()
size = LastUpdateDate.objects.count()
- 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"