nemesiscodex/openfonacide

View on GitHub

Showing 350 of 970 total issues

Function handle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def handle(self, *args, **options):
        tareas = Importacion.objects.filter(activo=True)
        worked = False
        need_match = False

Severity: Minor
Found in openfonacide/management/commands/actualizar_datasets.py - About 55 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 agregar_adjudicacion has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def agregar_adjudicacion(request):
    if request.method != 'POST':
        return JsonResponse({'error': 'Método inválido.'}, status=405)

    codigo_institucion = request.POST.get('codigo_institucion')
Severity: Minor
Found in openfonacide/views.py - About 55 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

Avoid deeply nested control flow statements.
Open

                            if (isScalar) {
                                data[i*stride + j + offset] = source;
                            } else {
                                data[i*stride + j + offset] = source[cursor++];
                            }
Severity: Major
Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

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

        function icon(zr, oldShape, newShape, duration, easing, delay) {
    Severity: Minor
    Found in static/js/dncp/util/ecAnimation.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              switch (op) {
                                  case E_ADD: res = _a + _b; break;
                                  case E_SUB: res = _a - _b; break;
                                  case E_MUL: res = _a * _b; break;
                                  case E_DIV: res = _a / _b; break;
      Severity: Major
      Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

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

            function get_options_bar(titulo, subtitulo, legendData, legendSelected, categoryData, series){
        Severity: Minor
        Found in static/js/frontend.ResumenController.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      } else if (_value != _href()) {
                                          if (_opts.history) {
                                              _l.hash = '#' + _value;
                                          } else {
                                              _l.replace('#' + _value);
          Severity: Major
          Found in static/js/jquery.address.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    switch (op) {
                                        case E_ADD: res = _a + _b; break;
                                        case E_SUB: res = _a - _b; break;
                                        case E_MUL: res = _a * _b; break;
                                        case E_DIV: res = _a / _b; break;
            Severity: Major
            Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if (_opts.history) {
                                                  _l.hash = '#' + _value;
                                              } else {
                                                  _l.replace('#' + _value);
                                              }
              Severity: Major
              Found in static/js/jquery.address.js - About 45 mins to fix

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

                function mapa (datos) {
                
                
                
                function changeData(data, tipo_abastecimiento){
                Severity: Minor
                Found in static/js/agua.js - 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

                Avoid deeply nested control flow statements.
                Open

                                            if (isScalar) {
                                                data[i*stride + j + offset] = source;
                                            } else {
                                                data[i*stride + j + offset] = source[cursor++];
                                            }
                Severity: Major
                Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          switch (op) {
                                              case E_ADD: res = _a + _b; break;
                                              case E_SUB: res = _a - _b; break;
                                              case E_MUL: res = _a * _b; break;
                                              case E_DIV: res = _a / _b; break;
                  Severity: Major
                  Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            switch (op) {
                                                case E_ADD: res = _a + _b; break;
                                                case E_SUB: res = _a - _b; break;
                                                case E_MUL: res = _a * _b; break;
                                                case E_DIV: res = _a / _b; break;
                    Severity: Major
                    Found in static/js/dncp/util/ndarray.js - About 45 mins to fix

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

                      function tryForInt(min, max, section, expMin, expMax, secs) {
                      Severity: Minor
                      Found in static/js/dncp/util/smartSteps.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if(isChecked) {
                                              values[name] = true;
                                            }
                                            else {
                                              module.debug('Omitted unchecked checkbox', $field);
                        Severity: Major
                        Found in static/components/form.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                        if(settings.pushing) {
                                          if(module.is.bound() && scroll.bottom < context.bottom ) {
                                            module.debug('Fixing bottom attached element to bottom of browser.');
                                            module.fixBottom();
                                          }
                          Severity: Major
                          Found in static/components/sticky.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if(response && response.error !== undefined) {
                                                      errorMessage = response.error;
                                                    }
                            Severity: Major
                            Found in static/components/api.js - About 45 mins to fix

                              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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language