mangroveorg/datawinners

View on GitHub

Showing 1,567 of 3,608 total issues

Function utils has 417 lines of code (exceeds 25 allowed). Consider refactoring.
Open

ko.utils = (function () {
    var objectForEach = function(obj, action) {
        for (var prop in obj) {
            if (obj.hasOwnProperty(prop)) {
                action(prop, obj[prop]);

    File fileuploader.js has 853 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * http://github.com/valums/file-uploader
     * 
     * Multiple file upload component with progress-bar, drag-and-drop. 
     * © 2010 Andrew Valums ( andrew(at)valums.com ) 
    Severity: Major
    Found in datawinners/media/javascript/file_uploader/fileuploader.js - About 2 days to fix

      File underscore.js has 846 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      //     Underscore.js 1.4.3
      //     http://underscorejs.org
      //     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
      //     Underscore may be freely distributed under the MIT license.
      
      
      Severity: Major
      Found in datawinners/media/javascript/underscore.js - About 2 days to fix

        File validation-ui-tests.js has 816 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*global
            module:false,
            equal:false,
            notEqual:false,
            strictEqual:false,

          File xform_bridge.py has 802 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import csv
          from datetime import datetime
          import itertools
          import os
          import re
          Severity: Major
          Found in datawinners/blue/xform_bridge.py - About 1 day to fix

            QuestionnaireTabPage has 96 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class QuestionnaireTabPage(Page):
                def __init__(self, driver):
                    Page.__init__(self, driver)
                    self.SELECT_FUNC = {
                        WORD: self.configure_word_type_question,
            Severity: Major
            Found in func_tests/pages/questionnairetabpage/questionnaire_tab_page.py - About 1 day to fix

              File view.py has 765 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import json
              import logging
              import mimetypes
              import os
              import re
              Severity: Major
              Found in datawinners/blue/view.py - About 1 day to fix

                Function json_parse has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring.
                Open

                var json_parse = (function () {
                    "use strict";
                
                // This is a function that can parse a JSON text, producing a JavaScript
                // data structure. It is a simple, recursive descent parser. It does not use
                Severity: Minor
                Found in datawinners/media/javascript/JSON_fix/json_parse.js - About 1 day 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

                File rules-tests.js has 758 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*global
                    module:false,
                    equal:false,
                    notEqual:false,
                    strictEqual:false,
                Severity: Major
                Found in datawinners/media/javascript/Knockout-Validation/Tests/rules-tests.js - About 1 day to fix

                  Function jQuery_vsprintf has 345 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  jQuery.vsprintf = function jQuery_vsprintf( format, args ) {
                      if( format == null ) {
                          throw "Not enough arguments for vsprintf";
                      }
                      if( args == null ) {
                  Severity: Major
                  Found in datawinners/media/javascript/jquery.sprintf.js - About 1 day to fix

                    File dropdownchecklist.custom.js has 733 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    ;(function($) {
                        /*
                         * ui.dropdownchecklist
                         *
                         * Copyright (c) 2008-2010 Adrian Tosca, Copyright (c) 2010-2011 Ittrium LLC

                      File views.py has 715 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
                      import json
                      import logging
                      from operator import itemgetter
                      
                      
                      Severity: Major
                      Found in datawinners/entity/views.py - About 1 day to fix

                        Function daterangepicker has 328 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        jQuery.fn.daterangepicker = function(settings){
                            var rangeInput = jQuery(this);
                        
                            //defaults
                            var options = jQuery.extend({

                          File submission_views.py has 701 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          from collections import OrderedDict
                          from copy import deepcopy
                          import json
                          import re
                          import datetime
                          Severity: Major
                          Found in datawinners/project/views/submission_views.py - About 1 day to fix

                            Function daterangepicker has 311 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            jQuery.fn.daterangepicker = function(settings){
                                var rangeInput = jQuery(this);
                            
                                //defaults
                                var options = jQuery.extend({

                              Function SmsViewModel has 301 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function SmsViewModel(){
                                var self = this;
                              
                                var smsTextArea = $("#sms-text");
                              
                              
                              Severity: Major
                              Found in datawinners/media/javascript/entity/send_sms.js - About 1 day to fix

                                File jquery.autocomplete.js has 663 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /*
                                 * jQuery Autocomplete plugin 1.1
                                 *
                                 * Copyright (c) 2009 Jörn Zaefferer
                                 *

                                  File TableTools.min.js has 656 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  // Simple Set Clipboard System
                                  // Author: Joseph Huckaby
                                  var ZeroClipboard_TableTools = {version:"1.0.4-TableTools2", clients:{}, moviePath:"", nextId:1, $:function (a) {
                                      "string" == typeof a && (a = document.getElementById(a));
                                      if (!a.addClass)a.hide = function () {
                                  Severity: Major
                                  Found in datawinners/media/javascript/data_tables/js/TableTools.min.js - About 1 day to fix

                                    Function add_unique_id_and_short_code_field has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    def add_unique_id_and_short_code_field(dbm, logger):
                                        for row in dbm.database.query(list_all_form_models, include_docs=True):
                                            try:
                                                document_data = row.doc
                                                json_data = document_data.get('json_fields')

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

                                    $.Autocompleter = function(input, options) {
                                    
                                        var KEY = {
                                            UP: 38,
                                            DOWN: 40,
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language