nemesiscodex/openfonacide

View on GitHub

Showing 970 of 970 total issues

Avoid deeply nested control flow statements.
Open

                if( scroll.top < element.top ) {
                  module.debug('Fixed element reached top of container');
                  module.setInitialPosition();
                }
                else if( (element.height + scroll.top - elementScroll) > context.bottom ) {
Severity: Major
Found in static/components/sticky.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                  else if(module.is.bottom() ) {
    
                    // top edge
                    if( (scroll.bottom - element.height) < element.top) {
                      module.debug('Bottom fixed rail has reached top of container');
    Severity: Major
    Found in static/components/sticky.js - About 45 mins to fix

      Function query_prioridad has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def query_prioridad(tipo, rango, ubicacion, estado, documentos, reportadas):
      Severity: Minor
      Found in openfonacide/filtros.py - About 45 mins to fix

        Function tipo_requerimiento has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def tipo_requerimiento(periodo, prioridades, ubicaciones, estados, dncp, ret):
        Severity: Minor
        Found in openfonacide/resumen.py - About 45 mins to fix

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

              def get_object(self):
                  queryset = self.get_queryset()  # Get the base queryset
                  queryset = self.filter_queryset(queryset)  # Apply any filter backends
                  filter = {}
                  for field in self.lookup_fields:
          Severity: Minor
          Found in openfonacide/views.py - About 45 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 filtro_prioridad has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def filtro_prioridad(tipo, rango, ubicacion, estado, documentos, reportadas):
          Severity: Minor
          Found in openfonacide/filtros.py - About 45 mins to fix

            Function elegibles has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def elegibles(periodo, prioridades, ubicaciones, estados, dncp, ret):
            Severity: Minor
            Found in openfonacide/resumen.py - About 45 mins to fix

              Function generar_query has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              def generar_query(params):
                  periodo = params.get('anios')
                  ubicaciones = params.get('ubicaciones')
                  prioridades = params.get('prioridades')
                  estados = params.get('estado')
              Severity: Minor
              Found in openfonacide/resumen.py - About 45 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 beneficiarios_pedidos has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def beneficiarios_pedidos(periodo, prioridades, ubicaciones, estados, dncp, ret):
              Severity: Minor
              Found in openfonacide/resumen.py - About 45 mins to fix

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

                            if (shape.style.iconType == 'pin') {
                                effectShape.style.y += effectShape.style.height / 2 * 1.5;
                            }
                Severity: Minor
                Found in static/js/dncp/util/ecEffect.js and 1 other location - About 45 mins to fix
                static/js/dncp/util/ecEffect.js on lines 93..95

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

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

                    if estado and estado.lower() in ('priorizado', 'planificado', 'adjudicado', 'terminado'):
                        query_estado = " AND lower(estado_de_obra) = '%s' " % estado
                Severity: Major
                Found in openfonacide/resumen.py and 3 other locations - About 45 mins to fix
                openfonacide/filtros.py on lines 125..126
                openfonacide/resumen.py on lines 84..85
                openfonacide/resumen.py on lines 334..335

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

                          else {
                            module.remove.checked();
                            if(settings.fireOnInit) {
                              settings.onUnchecked.call($input.get());
                            }
                Severity: Minor
                Found in static/components/checkbox.js and 1 other location - About 45 mins to fix
                static/components/checkbox.js on lines 62..67

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

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

                    if estado and estado.lower() in ('priorizado', 'planificado', 'adjudicado', 'terminado'):
                        query_estado = " AND lower(estado_de_obra) = '%s' " % estado
                Severity: Major
                Found in openfonacide/resumen.py and 3 other locations - About 45 mins to fix
                openfonacide/filtros.py on lines 125..126
                openfonacide/resumen.py on lines 84..85
                openfonacide/resumen.py on lines 164..165

                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

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

                    if estado and estado.lower() in ('priorizado', 'planificado', 'adjudicado', 'terminado'):
                        query_estado = " AND lower(estado_de_obra) = '%s' " % estado
                Severity: Major
                Found in openfonacide/resumen.py and 3 other locations - About 45 mins to fix
                openfonacide/filtros.py on lines 125..126
                openfonacide/resumen.py on lines 164..165
                openfonacide/resumen.py on lines 334..335

                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

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

                    if estado and estado.lower() in ('priorizado', 'planificado', 'adjudicado', 'terminado'):
                        query_estado = " AND lower(estado_de_obra) = '%s' " % estado
                Severity: Major
                Found in openfonacide/filtros.py and 3 other locations - About 45 mins to fix
                openfonacide/resumen.py on lines 84..85
                openfonacide/resumen.py on lines 164..165
                openfonacide/resumen.py on lines 334..335

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

                          if( module.is.checked() ) {
                            module.set.checked();
                            if(settings.fireOnInit) {
                              settings.onChecked.call($input.get());
                            }
                Severity: Minor
                Found in static/components/checkbox.js and 1 other location - About 45 mins to fix
                static/components/checkbox.js on lines 68..73

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

                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 (shape.style.iconType == 'pin') {
                            effectShape.style.y -= shape.style.height / 2 * 1.5;
                        }
                Severity: Minor
                Found in static/js/dncp/util/ecEffect.js and 1 other location - About 45 mins to fix
                static/js/dncp/util/ecEffect.js on lines 53..55

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

                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

                                            } else if (_value != _href()) {
                                                if (_opts.history) {
                                                    _l.hash = '#' + _value;
                                                } else {
                                                    _l.replace('#' + _value);
                Severity: Minor
                Found in static/js/jquery.address.js and 1 other location - About 40 mins to fix
                static/js/jquery.address.js on lines 463..475

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

                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

                            if( $popup && module.has.popup() ) {
                              $popup
                                .on('mouseenter' + eventNamespace, module.event.start)
                                .on('mouseleave' + eventNamespace, module.event.end)
                              ;
                Severity: Major
                Found in static/components/popup.js and 2 other locations - About 40 mins to fix
                static/components/dropdown.js on lines 356..366
                static/components/sidebar.js on lines 172..177

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

                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 (_webkit) {
                                                if (_opts.history) {
                                                    _l.hash = '#' + _value;
                                                } else {
                                                    _l.replace('#' + _value);
                Severity: Minor
                Found in static/js/jquery.address.js and 1 other location - About 40 mins to fix
                static/js/jquery.address.js on lines 469..475

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

                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