nemesiscodex/openfonacide

View on GitHub

Showing 970 of 970 total issues

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

        migrations.AlterField(
            model_name='serviciobasico',
            name='codigo_establecimiento',
            field=models.CharField(max_length=200, null=True, db_index=True),
Severity: Major
Found in openfonacide/migrations/0041_auto_20150507_0500.py and 22 other locations - About 30 mins to fix
openfonacide/migrations/0008_auto_20141130_2305.py on lines 236..239
openfonacide/migrations/0041_auto_20150507_0500.py on lines 14..17
openfonacide/migrations/0041_auto_20150507_0500.py on lines 20..23
openfonacide/migrations/0041_auto_20150507_0500.py on lines 26..29
openfonacide/migrations/0041_auto_20150507_0500.py on lines 32..35
openfonacide/migrations/0041_auto_20150507_0500.py on lines 38..41
openfonacide/migrations/0041_auto_20150507_0500.py on lines 110..113
openfonacide/migrations/0041_auto_20150507_0500.py on lines 116..119
openfonacide/migrations/0041_auto_20150507_0500.py on lines 122..125
openfonacide/migrations/0041_auto_20150507_0500.py on lines 128..131
openfonacide/migrations/0041_auto_20150507_0500.py on lines 134..137
openfonacide/migrations/0041_auto_20150507_0500.py on lines 140..143
openfonacide/migrations/0041_auto_20150507_0500.py on lines 146..149
openfonacide/migrations/0041_auto_20150507_0500.py on lines 152..155
openfonacide/migrations/0041_auto_20150507_0500.py on lines 158..161
openfonacide/migrations/0041_auto_20150507_0500.py on lines 164..167
openfonacide/migrations/0041_auto_20150507_0500.py on lines 170..173
openfonacide/migrations/0041_auto_20150507_0500.py on lines 176..179
openfonacide/migrations/0041_auto_20150507_0500.py on lines 182..185
openfonacide/migrations/0041_auto_20150507_0500.py on lines 194..197
openfonacide/migrations/0044_auto_20150513_0340.py on lines 24..27
openfonacide/migrations/0056_auto_20150615_0159.py on lines 44..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 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

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

        othersAnimating: function() {
          return ($sidebars.not($module).filter('.' + className.animating).length > 0);
        },
Severity: Minor
Found in static/components/sidebar.js and 1 other location - About 30 mins to fix
static/components/sidebar.js on lines 421..423

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 45.

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 23 locations. Consider refactoring.
Open

        migrations.AlterField(
            model_name='sanitario',
            name='codigo_establecimiento',
            field=models.CharField(max_length=256, null=True, db_index=True),
Severity: Major
Found in openfonacide/migrations/0041_auto_20150507_0500.py and 22 other locations - About 30 mins to fix
openfonacide/migrations/0008_auto_20141130_2305.py on lines 236..239
openfonacide/migrations/0041_auto_20150507_0500.py on lines 14..17
openfonacide/migrations/0041_auto_20150507_0500.py on lines 20..23
openfonacide/migrations/0041_auto_20150507_0500.py on lines 26..29
openfonacide/migrations/0041_auto_20150507_0500.py on lines 32..35
openfonacide/migrations/0041_auto_20150507_0500.py on lines 38..41
openfonacide/migrations/0041_auto_20150507_0500.py on lines 110..113
openfonacide/migrations/0041_auto_20150507_0500.py on lines 116..119
openfonacide/migrations/0041_auto_20150507_0500.py on lines 122..125
openfonacide/migrations/0041_auto_20150507_0500.py on lines 128..131
openfonacide/migrations/0041_auto_20150507_0500.py on lines 134..137
openfonacide/migrations/0041_auto_20150507_0500.py on lines 140..143
openfonacide/migrations/0041_auto_20150507_0500.py on lines 146..149
openfonacide/migrations/0041_auto_20150507_0500.py on lines 158..161
openfonacide/migrations/0041_auto_20150507_0500.py on lines 164..167
openfonacide/migrations/0041_auto_20150507_0500.py on lines 170..173
openfonacide/migrations/0041_auto_20150507_0500.py on lines 176..179
openfonacide/migrations/0041_auto_20150507_0500.py on lines 182..185
openfonacide/migrations/0041_auto_20150507_0500.py on lines 188..191
openfonacide/migrations/0041_auto_20150507_0500.py on lines 194..197
openfonacide/migrations/0044_auto_20150513_0340.py on lines 24..27
openfonacide/migrations/0056_auto_20150615_0159.py on lines 44..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 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

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

        migrations.AlterField(
            model_name='serviciobasico',
            name='codigo_barrio_localidad',
            field=models.CharField(max_length=200, null=True, db_index=True),
Severity: Major
Found in openfonacide/migrations/0041_auto_20150507_0500.py and 22 other locations - About 30 mins to fix
openfonacide/migrations/0008_auto_20141130_2305.py on lines 236..239
openfonacide/migrations/0041_auto_20150507_0500.py on lines 14..17
openfonacide/migrations/0041_auto_20150507_0500.py on lines 20..23
openfonacide/migrations/0041_auto_20150507_0500.py on lines 26..29
openfonacide/migrations/0041_auto_20150507_0500.py on lines 32..35
openfonacide/migrations/0041_auto_20150507_0500.py on lines 38..41
openfonacide/migrations/0041_auto_20150507_0500.py on lines 110..113
openfonacide/migrations/0041_auto_20150507_0500.py on lines 116..119
openfonacide/migrations/0041_auto_20150507_0500.py on lines 122..125
openfonacide/migrations/0041_auto_20150507_0500.py on lines 128..131
openfonacide/migrations/0041_auto_20150507_0500.py on lines 134..137
openfonacide/migrations/0041_auto_20150507_0500.py on lines 140..143
openfonacide/migrations/0041_auto_20150507_0500.py on lines 146..149
openfonacide/migrations/0041_auto_20150507_0500.py on lines 152..155
openfonacide/migrations/0041_auto_20150507_0500.py on lines 158..161
openfonacide/migrations/0041_auto_20150507_0500.py on lines 164..167
openfonacide/migrations/0041_auto_20150507_0500.py on lines 176..179
openfonacide/migrations/0041_auto_20150507_0500.py on lines 182..185
openfonacide/migrations/0041_auto_20150507_0500.py on lines 188..191
openfonacide/migrations/0041_auto_20150507_0500.py on lines 194..197
openfonacide/migrations/0044_auto_20150513_0340.py on lines 24..27
openfonacide/migrations/0056_auto_20150615_0159.py on lines 44..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 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

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

        migrations.AlterField(
            model_name='institucion',
            name='codigo_establecimiento',
            field=models.CharField(max_length=256, serialize=False, primary_key=True),
Severity: Major
Found in openfonacide/migrations/0008_auto_20141130_2305.py and 22 other locations - About 30 mins to fix
openfonacide/migrations/0041_auto_20150507_0500.py on lines 14..17
openfonacide/migrations/0041_auto_20150507_0500.py on lines 20..23
openfonacide/migrations/0041_auto_20150507_0500.py on lines 26..29
openfonacide/migrations/0041_auto_20150507_0500.py on lines 32..35
openfonacide/migrations/0041_auto_20150507_0500.py on lines 38..41
openfonacide/migrations/0041_auto_20150507_0500.py on lines 110..113
openfonacide/migrations/0041_auto_20150507_0500.py on lines 116..119
openfonacide/migrations/0041_auto_20150507_0500.py on lines 122..125
openfonacide/migrations/0041_auto_20150507_0500.py on lines 128..131
openfonacide/migrations/0041_auto_20150507_0500.py on lines 134..137
openfonacide/migrations/0041_auto_20150507_0500.py on lines 140..143
openfonacide/migrations/0041_auto_20150507_0500.py on lines 146..149
openfonacide/migrations/0041_auto_20150507_0500.py on lines 152..155
openfonacide/migrations/0041_auto_20150507_0500.py on lines 158..161
openfonacide/migrations/0041_auto_20150507_0500.py on lines 164..167
openfonacide/migrations/0041_auto_20150507_0500.py on lines 170..173
openfonacide/migrations/0041_auto_20150507_0500.py on lines 176..179
openfonacide/migrations/0041_auto_20150507_0500.py on lines 182..185
openfonacide/migrations/0041_auto_20150507_0500.py on lines 188..191
openfonacide/migrations/0041_auto_20150507_0500.py on lines 194..197
openfonacide/migrations/0044_auto_20150513_0340.py on lines 24..27
openfonacide/migrations/0056_auto_20150615_0159.py on lines 44..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 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

    if not permiso_cambiar and not permiso_verificar:
        return JsonResponse({'error': 'No tiene permisos para realizar esta accion'}, status=403)
Severity: Minor
Found in openfonacide/views.py and 1 other location - About 30 mins to fix
openfonacide/views.py on lines 699..700

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

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

        migrations.AlterField(
            model_name='mobiliario',
            name='codigo_establecimiento',
            field=models.CharField(max_length=256, null=True, db_index=True),
Severity: Major
Found in openfonacide/migrations/0041_auto_20150507_0500.py and 22 other locations - About 30 mins to fix
openfonacide/migrations/0008_auto_20141130_2305.py on lines 236..239
openfonacide/migrations/0041_auto_20150507_0500.py on lines 14..17
openfonacide/migrations/0041_auto_20150507_0500.py on lines 20..23
openfonacide/migrations/0041_auto_20150507_0500.py on lines 26..29
openfonacide/migrations/0041_auto_20150507_0500.py on lines 32..35
openfonacide/migrations/0041_auto_20150507_0500.py on lines 38..41
openfonacide/migrations/0041_auto_20150507_0500.py on lines 110..113
openfonacide/migrations/0041_auto_20150507_0500.py on lines 116..119
openfonacide/migrations/0041_auto_20150507_0500.py on lines 128..131
openfonacide/migrations/0041_auto_20150507_0500.py on lines 134..137
openfonacide/migrations/0041_auto_20150507_0500.py on lines 140..143
openfonacide/migrations/0041_auto_20150507_0500.py on lines 146..149
openfonacide/migrations/0041_auto_20150507_0500.py on lines 152..155
openfonacide/migrations/0041_auto_20150507_0500.py on lines 158..161
openfonacide/migrations/0041_auto_20150507_0500.py on lines 164..167
openfonacide/migrations/0041_auto_20150507_0500.py on lines 170..173
openfonacide/migrations/0041_auto_20150507_0500.py on lines 176..179
openfonacide/migrations/0041_auto_20150507_0500.py on lines 182..185
openfonacide/migrations/0041_auto_20150507_0500.py on lines 188..191
openfonacide/migrations/0041_auto_20150507_0500.py on lines 194..197
openfonacide/migrations/0044_auto_20150513_0340.py on lines 24..27
openfonacide/migrations/0056_auto_20150615_0159.py on lines 44..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 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

Function get_object has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def get_object(self, codigo_establecimiento):
        prioridad = DummyPrioridad()
        not_found = 0

        try:
Severity: Minor
Found in openfonacide/views.py - About 25 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

Function get_rango has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def get_rango(rango):

    if not rango or len(rango) != 2:
        return [0, 200]
    try:
Severity: Minor
Found in openfonacide/filtros.py - About 25 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

Function heuristicas has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def heuristicas(cadena1, cadena2):
    assert isinstance(cadena1, unicode)
    assert isinstance(cadena2, unicode)
    # Verificar si son
    # ESCUELA
Severity: Minor
Found in openfonacide/matcher.py - About 25 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

Severity
Category
Status
Source
Language