fga-gpp-mds/2017.2-QueroCultura

View on GitHub

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()
Severity: Minor
Found in events_indicators/views.py - About 2 hrs to fix

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:
Severity: Minor
Found in mixed_indicators/views.py - About 1 hr to fix

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()
Severity: Minor
Found in agents_indicators/views.py - About 1 hr to fix

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()
Severity: Minor
Found in library_indicators/views.py - About 1 hr to fix

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()
Severity: Minor
Found in museums_indicators/views.py - About 1 hr to fix

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']
Severity: Minor
Found in quero_cultura/api_connections.py - About 1 hr to fix

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: '',
Severity: Minor
Found in karma.conf.js - About 1 hr to fix

    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:
    Severity: Minor
    Found in quero_cultura/api_connections.py - About 1 hr to fix

    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()
    Severity: Minor
    Found in project_indicators/views.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

    if occurrences['space']['acessibilidade'] != '':
    accessible_space = str(occurrences['space'][
    'acessibilidade']).capitalize()
     
    EventAndSpaceData(event.instance, str(
    Severity: Major
    Found in mixed_indicators/views.py - About 45 mins to fix

      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()
      Severity: Minor
      Found in space_indicators/views.py - About 35 mins to fix
      Severity
      Category
      Status
      Source
      Language