mangroveorg/datawinners

View on GitHub

Showing 1,567 of 3,608 total issues

File questionnaire_helper.js has 643 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//DW is the global name space for DataWinner
DW.init_inform_datasender_about_changes = function () {
    var kwargs = {container: "#inform_datasender_about_changes",
        is_continue: true,
        title: gettext('Inform Your Data Senders about the Changes'),
Severity: Major
Found in datawinners/media/javascript/entity/questionnaire_helper.js - About 1 day to fix

    Function daterangepicker has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring.
    Open

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

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

    document.getElementsBySelector = function(selector) {
      // Attempt to fail gracefully in lesser browsers
      if (!document.getElementsByTagName) {
        return new Array();
      }
    Severity: Minor
    Found in datawinners/media/admin/js/getElementsBySelector.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 daterangepicker.jQuery.custom.js has 631 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * --------------------------------------------------------------------
     * jQuery-Plugin "daterangepicker.jQuery.js"
     * by Scott Jehl, scott@filamentgroup.com
     * http://www.filamentgroup.com

      Function api has 278 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var api = (function () {
      
          var isInitialized = 0,
              configuration = ko.validation.configuration,
              utils = ko.validation.utils;
      Severity: Major
      Found in datawinners/media/javascript/Knockout-Validation/Src/api.js - About 1 day to fix

        Function api has 278 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        }());;var api = (function () {
        
            var isInitialized = 0,
                configuration = kv.configuration,
                utils = kv.utils;

          Function get_edited_details_for_field_set has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
          Open

          def get_edited_details_for_field_set(edit_details, questionnaire, code, value):
              if len(value['new_data']) == len(value['old_data']):
                  if value['old_data'] != value['new_data']:
                      for index, i in enumerate(value['new_data']):
                          for key, val in i.items():
          Severity: Minor
          Found in datawinners/blue/view.py - 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 jquery-textntags.js has 617 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * Text'N'Tags (textntags)
           * Version 0.1.2
           * Written by: Daniel Zahariev
           *
          Severity: Major
          Found in datawinners/media/javascript/jquery-textntags/jquery-textntags.js - About 1 day to fix

            File jquery-2.0.3.intellisense.js has 614 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            intellisense.annotate(jQuery, {
              'ajax': function() {
                /// <signature>
                ///   <summary>Perform an asynchronous HTTP (Ajax) request.</summary>
                ///   <param name="url" type="String">A string containing the URL to which the request is sent.</param>

              File daterangepicker.jQuery.js has 614 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * --------------------------------------------------------------------
               * jQuery-Plugin "daterangepicker.jQuery.js"
               * by Scott Jehl, scott@filamentgroup.com
               * http://www.filamentgroup.com

                Function load_sms_data_for_cli001 has 267 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def load_sms_data_for_cli001(manager):
                    FEB = datetime(2011, 02, 28, hour=12, minute=00, second=00, tzinfo=UTC)
                    MARCH = datetime(2011, 03, 01, tzinfo=UTC)
                    DEC_2010 = datetime(2010, 12, 28, hour=00, minute=00, second=59, tzinfo=UTC)
                    NOV_2010 = datetime(2010, 11, 26, hour=23, minute=59, second=59, tzinfo=UTC)
                Severity: Major
                Found in datawinners/main/ut_couch_fixtures.py - About 1 day to fix

                  Function daterangepicker has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                  Open

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

                  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

                  AllDataSendersPage has 70 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class AllDataSendersPage(Page):
                      def __init__(self, driver):
                          Page.__init__(self, driver)
                  
                      def navigate_to_add_a_data_sender_page(self):
                  Severity: Major
                  Found in func_tests/pages/alldatasenderspage/all_data_senders_page.py - About 1 day to fix

                    Function json_parse has 253 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    var json_parse = (function () {
                        "use strict";
                    
                    // This function creates a JSON parse function that uses a state machine rather
                    // than the dangerous eval function to parse a JSON text.
                    Severity: Major
                    Found in datawinners/media/javascript/JSON_fix/json_parse_state.js - About 1 day to fix

                      Function inlineEdit has 245 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      $.inlineEdit = function(urls, options){
                      
                          var editableUrls = urls;
                      
                          var options = jQuery.extend({
                      Severity: Major
                      Found in datawinners/media/javascript/jquery_inline/jquery.inlineEdit.js - About 1 day to fix

                        File questionnaire_tab_page.py has 575 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        from time import sleep
                        from selenium.common.exceptions import NoSuchElementException
                        from selenium.webdriver.support.select import Select
                        
                        from framework.utils.common_utils import by_css, by_id, generateId, CommonUtilities, by_xpath, by_name
                        Severity: Major
                        Found in func_tests/pages/questionnairetabpage/questionnaire_tab_page.py - About 1 day to fix

                          Function ajax has 240 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              ajax: function( url, options ) {
                          
                                  // If url is an object, simulate pre-1.5 signature
                                  if ( typeof url === "object" ) {
                                      options = url;

                            Function highlightTextarea has 235 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                $.highlightTextarea = function(element, options) {
                                    this.options = options;
                                    
                                    if (element instanceof jQuery) {
                                        this.$textarea = element;
                            Severity: Major
                            Found in datawinners/media/javascript/jquery.highlighttextarea.js - About 1 day to fix

                              File dataTables.colVis.js has 556 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /*! ColVis 1.1.2
                               * ©2010-2015 SpryMedia Ltd - datatables.net/license
                               */
                              
                              /**
                              Severity: Major
                              Found in datawinners/media/javascript/data_tables/js/dataTables.colVis.js - About 1 day to fix

                                Function _init has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    _init: function () {
                                        var self = this;
                                        var q = this.options;
                                        this.newly_added_question = ko.observable(q.newly_added_question);
                                        this.range_min = DW.ko.createValidatableObservable({value: q.range.min});
                                Severity: Minor
                                Found in datawinners/media/javascript/entity/questionnaire_helper.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

                                Severity
                                Category
                                Status
                                Source
                                Language