nemesiscodex/openfonacide

View on GitHub

Showing 970 of 970 total issues

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

                $scope.modificarEstado = function (prioridad, tipo) {
                    if (typeof (window.modificarEstado) === 'function') {
                        var institucion = $scope.infoData.instituciones.filter(function (obj) {
                            return obj.codigo_institucion == $scope.institucion_actual;
                        });
Severity: Major
Found in static/js/frontend.MapController.js and 1 other location - About 3 hrs to fix
static/js/frontend.MapController.js on lines 69..76

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

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

                itemStyle : {
                    normal : {
                        label: {
                            position: 'inner',
                            textStyle: {
Severity: Major
Found in static/js/frontend.ResumenController.js and 1 other location - About 3 hrs to fix
static/js/frontend.ResumenController.js on lines 138..156

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

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

              else {
                if(text.hover) {
                  module.verbose('Changing text to hover text', text.hover);
                  module.update.text(text.hover);
                }
Severity: Major
Found in static/components/state.js and 1 other location - About 3 hrs to fix
static/components/state.js on lines 268..277

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

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

                $scope.reportar = function (prioridad, tipo) {
                    if (typeof (window.reportar) === 'function') {
                        var institucion = $scope.infoData.instituciones.filter(function (obj) {
                            return obj.codigo_institucion == $scope.institucion_actual;
                        });
Severity: Major
Found in static/js/frontend.MapController.js and 1 other location - About 3 hrs to fix
static/js/frontend.MapController.js on lines 77..84

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

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 _load has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            _load = function() {
                if (!_loaded) {
                    _loaded = TRUE;
                    _options();
                    $('a[rel*="address:"]').address();
Severity: Major
Found in static/js/jquery.address.js - About 3 hrs to fix

    Function buildPath has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            buildPath : function (ctx, style) {
                var pointList = style.pointList;
                var len = pointList.length;
                if (len === 0) {
                    return;
    Severity: Major
    Found in static/js/dncp/util/shape/Symbol.js - About 3 hrs to fix

      Function stick has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              stick: function(scroll) {
                var
                  cachedPosition = scroll || $scroll.scrollTop(),
                  cache          = module.cache,
                  fits           = cache.fits,
      Severity: Major
      Found in static/components/sticky.js - About 3 hrs to fix

        Function show has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                  show: function(callback, $subMenu) {
                    var
                      $currentMenu = $subMenu || $menu,
                      start = ($subMenu)
                        ? function() {}
        Severity: Major
        Found in static/components/dropdown.js - About 3 hrs to fix

          Function handleKeyboard has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  handleKeyboard: function(event) {
                    var
                      // force selector refresh
                      $result      = $module.find(selector.result),
                      $category    = $module.find(selector.category),
          Severity: Major
          Found in static/components/search.js - About 3 hrs to fix

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

                    migrations.CreateModel(
                        name='NotificacionesCambioDeEstado',
                        fields=[
                            ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                            ('email', models.CharField(max_length=256)),
            openfonacide/migrations/0055_notificacionescambiodeestado_notificacionesreportes_notificacionesverificacion.py on lines 26..36
            openfonacide/migrations/0055_notificacionescambiodeestado_notificacionesreportes_notificacionesverificacion.py on lines 38..48

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

            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

                    migrations.CreateModel(
                        name='NotificacionesVerificacion',
                        fields=[
                            ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                            ('email', models.CharField(max_length=256)),
            openfonacide/migrations/0055_notificacionescambiodeestado_notificacionesreportes_notificacionesverificacion.py on lines 14..24
            openfonacide/migrations/0055_notificacionescambiodeestado_notificacionesreportes_notificacionesverificacion.py on lines 26..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 62.

            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

                    migrations.CreateModel(
                        name='NotificacionesReportes',
                        fields=[
                            ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                            ('email', models.CharField(max_length=256)),
            openfonacide/migrations/0055_notificacionescambiodeestado_notificacionesreportes_notificacionesverificacion.py on lines 14..24
            openfonacide/migrations/0055_notificacionescambiodeestado_notificacionesreportes_notificacionesverificacion.py on lines 38..48

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

            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

                    observeChanges: function() {
                      if('MutationObserver' in window) {
                        observer = new MutationObserver(function(mutations) {
                          module.debug('DOM tree modified, updating selector cache');
                          module.refresh();
            Severity: Major
            Found in static/components/checkbox.js and 2 other locations - About 2 hrs to fix
            static/components/accordion.js on lines 90..102
            static/components/modal.js on lines 140..152

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

            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

                    observeChanges: function() {
                      if('MutationObserver' in window) {
                        observer = new MutationObserver(function(mutations) {
                          module.debug('DOM tree modified, updating selector cache');
                          module.refresh();
            Severity: Major
            Found in static/components/accordion.js and 2 other locations - About 2 hrs to fix
            static/components/checkbox.js on lines 101..113
            static/components/modal.js on lines 140..152

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

            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

                    observeChanges: function() {
                      if('MutationObserver' in window) {
                        observer = new MutationObserver(function(mutations) {
                          module.debug('DOM tree modified, refreshing');
                          module.refresh();
            Severity: Major
            Found in static/components/modal.js and 2 other locations - About 2 hrs to fix
            static/components/accordion.js on lines 90..102
            static/components/checkbox.js on lines 101..113

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

            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 estado_de_obra has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

            def estado_de_obra(request):
                if request.method != 'POST':
                    return JsonResponse({'error': 'Método inválido.'}, status=405)
            
                estado = request.POST.get('estado')
            Severity: Minor
            Found in openfonacide/views.py - About 2 hrs 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

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

                      animationName: function() {
                        var
                          element     = document.createElement('div'),
                          animations  = {
                            'animation'       :'animationName',
            Severity: Major
            Found in static/components/transition.js and 2 other locations - About 2 hrs to fix
            static/components/transition.js on lines 600..617
            static/components/transition.js on lines 618..635

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

            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

                            if (range[2] > 0) {
                                for (var i = range[0]; i < range[1]; i += range[2]) {
                                    for (var j = 0; j < stride; j++) {
                                        data[cursor++] = source[i*stride + j + offset];
                                    }
            Severity: Major
            Found in static/js/dncp/util/ndarray.js and 1 other location - About 2 hrs to fix
            static/js/dncp/util/ndarray.js on lines 1738..1744

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

            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

                      animationStartEvent: function() {
                        var
                          element     = document.createElement('div'),
                          animations  = {
                            'animation'       :'animationstart',
            Severity: Major
            Found in static/components/transition.js and 2 other locations - About 2 hrs to fix
            static/components/transition.js on lines 582..599
            static/components/transition.js on lines 618..635

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

            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

                            } else {
                                for (var i = range[0]; i > range[1]; i += range[2]) {
                                    for (var j = 0; j < stride; j++) {
                                        data[cursor++] = source[i*stride + j + offset];
                                    }
            Severity: Major
            Found in static/js/dncp/util/ndarray.js and 1 other location - About 2 hrs to fix
            static/js/dncp/util/ndarray.js on lines 1732..1738

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

            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