fga-gpp-mds/2017.2-QueroCultura

View on GitHub

Showing 88 of 88 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

page_descripition = 'Agentes são artistas, gestores, produtores e'\
    + 'instituições juntos eles formam uma rede de atores '\
    + 'envolvidos na cena cultural brasileira, nos gráficos '\
    + 'abaixo geramos indicadores visando extrair informações'\
    + ' úteis ao MinC e a população em geral sobre os Agentes '\
Severity: Major
Found in agents_indicators/views.py and 2 other locations - About 45 mins to fix
library_indicators/views.py on lines 31..36
museums_indicators/views.py on lines 29..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 35.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

page_descripition = "Museus são lugares onde se guardam e exibem coleções de "\
                    + "objetos de interesse artístico, cultural, científico, "\
                    + "histórico, entre outros, que procuram difundir o "\
                    + "conhecimento humano. Os gráficos abaixo representam "\
                    + "indicadores que são gerados a partir dos dados de "\
Severity: Major
Found in museums_indicators/views.py and 2 other locations - About 45 mins to fix
agents_indicators/views.py on lines 34..39
library_indicators/views.py on lines 31..36

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 35.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

                             'createTimestamp': "BET(" + str(initial_date) + ","
                             + str(final_date) + ")"}
    Severity: Minor
    Found in agents_indicators/api_connection.py and 1 other location - About 35 mins to fix
    events_indicators/api_connections.py on lines 48..49

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 33.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

    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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

                             'createTimestamp': "BET(" + str(initial_date) + ","
                             + str(final_date) + ")"}
    Severity: Minor
    Found in events_indicators/api_connections.py and 1 other location - About 35 mins to fix
    agents_indicators/api_connection.py on lines 46..47

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 33.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            result = [{"createTimestamp": {"date": "2012-01-01 00:00:00.000000"},
                       "type": {"name": "Livre"}, "name": "FGA",
                       "terms": {"area": ["Cinema", "Teatro"]}}]
    Severity: Minor
    Found in space_indicators/tests.py and 1 other location - About 30 mins to fix
    space_indicators/tests.py on lines 91..93

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 32.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

            result = [{"createTimestamp": {"date": "2012-01-01 00:00:00.000000"},
                       "type": {"name": "Livre"}, "name": "FGA",
                       "terms": {"area": ["Cinema", "Teatro"]}}]
    Severity: Minor
    Found in space_indicators/tests.py and 1 other location - About 30 mins to fix
    space_indicators/tests.py on lines 67..69

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 32.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language