nemesiscodex/openfonacide

View on GitHub

Showing 350 of 970 total issues

Function prompt has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          prompt: function(identifier, errors) {
            var
              $field       = module.get.field(identifier),
              $fieldGroup  = $field.closest($group),
              $prompt      = $fieldGroup.children(selector.prompt),
Severity: Minor
Found in static/components/form.js - About 1 hr to fix

    Function parseRange has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function parseRange(index, dimSize) {
        if (index.indexOf(':') >= 0) {
            // Range indexing;
            var res = index.split(/\s*:\s*/);
    
    
    Severity: Minor
    Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

      Function parameter has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  parameter: function(name, value, append) {
                      var i, params;
                      if (value !== UNDEFINED) {
                          var names = this.parameterNames();
                          params = [];
      Severity: Minor
      Found in static/js/jquery.address.js - About 1 hr to fix

        Function reformSetting has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function reformSetting() {
                // Settings of log label base
                logLabelBase = custOpts.logLabelBase;
                if (logLabelBase == null) {
                    logLabelMode = 'plain';
        Severity: Minor
        Found in static/js/dncp/util/smartLogSteps.js - About 1 hr to fix

          Function scrollPosition has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                    scrollPosition: function($item, forceScroll) {
                      var
                        edgeTolerance = 5,
                        hasActive,
                        offset,
          Severity: Minor
          Found in static/components/dropdown.js - About 1 hr to fix

            Function error has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        error: function(xhr, status, httpMessage) {
                          var
                            errorMessage = (settings.error[status] !== undefined)
                              ? settings.error[status]
                              : httpMessage,
            Severity: Minor
            Found in static/components/api.js - About 1 hr to fix

              Function _mercator has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _mercator() {
                      var radians = Math.PI / 180;
                      var scale = 500;
                      var translate = [480, 250];
              
              
              Severity: Minor
              Found in static/js/dncp/util/projection/mercator.js - About 1 hr to fix

                Function argmax has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    argmax : kwargs((function () {
                        function withAxis(data, source, offsetStride, axisSize, stride) {
                            var cursor = 0;
                            for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                for (var i = 0; i < stride; i++) {
                Severity: Minor
                Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                  Function repeat has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      repeat : kwargs(function (repeats, axis, out) {
                          var shape;
                          // flattened input array
                          if (typeof(axis) === 'undefined') {
                              shape = [this._size];
                  Severity: Minor
                  Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                    Function argmin has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        argmin : kwargs((function () {
                            function withAxis(data, source, offsetStride, axisSize, stride) {
                                var cursor = 0;
                                for (var offset = 0; offset < this._size; offset+=offsetStride) {
                                    for (var i = 0; i < stride; i++) {
                    Severity: Minor
                    Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                      Function ribbon has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function ribbon(zr, oldShape, newShape, duration, easing) {
                              if (!oldShape) {        // add
                                  oldShape = {
                                      style : {
                                          source0 : 0,
                      Severity: Minor
                      Found in static/js/dncp/util/ecAnimation.js - About 1 hr to fix

                        Function reset has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                reset: function() {
                                  $field
                                    .each(function () {
                                      var
                                        $field       = $(this),
                        Severity: Minor
                        Found in static/components/form.js - About 1 hr to fix

                          Function loadLiquidFillGauge has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function loadLiquidFillGauge(elementId, value, config) {
                              if(config == null) config = liquidFillGaugeDefaultSettings();
                          
                              var gauge = d3.select("#" + elementId);
                              var radius = Math.min(parseInt(gauge.style("width")), parseInt(gauge.style("height")))/2;
                          Severity: Minor
                          Found in static/js/liquidFillGauge.js - About 1 hr 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 setPiece has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  var setPiece = function (axis, offset) {
                                      var range = ranges[axis];
                                      var stride = strides[axis];
                                      if (axis < len-1) {
                                          if (range[2] > 0) {
                          Severity: Minor
                          Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                            Function estado_de_obra has 35 lines of code (exceeds 25 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 1 hr to fix

                              Function line has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function line(zr, oldShape, newShape, duration, easing) {
                                      if (!oldShape) {
                                          oldShape = {
                                              style : {
                                                  xStart : newShape.style.xStart,
                              Severity: Minor
                              Found in static/js/dncp/util/ecAnimation.js - About 1 hr to fix

                                Function sort has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    sort : kwargs(function (axis, order) {
                                        if (axis < 0) {
                                            axis = this._shape.length + axis;
                                        }
                                        var compareFunc;
                                Severity: Minor
                                Found in static/js/dncp/util/ndarray.js - About 1 hr to fix

                                  Function agregarUbicacion has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              $control.agregarUbicacion = function () {
                                                  var selected = [];
                                                  if (!$control.selected.departamento) {
                                                      return;
                                                  }
                                  Severity: Minor
                                  Found in static/js/frontend.directive.js - About 1 hr to fix

                                    Function _initEvents has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        CBPGridGallery.prototype._initEvents = function() {
                                            var self = this;
                                    
                                            // open the slideshow when clicking on the main grid items
                                            this.gridItems.forEach( function( item, idx ) {
                                    Severity: Minor
                                    Found in static/js/cbpGridGallery.js - About 1 hr to fix

                                      Function parseSrcSize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function parseSrcSize(json, specialArea) {
                                              specialArea = specialArea || {};
                                              convertorParse.xmin = 360;
                                              convertorParse.xmax = -360;
                                              convertorParse.ymin = 180;
                                      Severity: Minor
                                      Found in static/js/dncp/util/projection/normal.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language