NUBIC/surveyor

View on GitHub

Showing 371 of 658 total issues

File jquery-ui-1.10.0.custom.js has 11613 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*! jQuery UI - v1.10.0 - 2013-01-17
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.effect.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.progressbar.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.slider.js, jquery.ui.sortable.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
* Copyright (c) 2013 jQuery Foundation and other contributors Licensed MIT */

Severity: Major
Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 mo to fix

    File jquery-1.9.0.js has 6540 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * jQuery JavaScript Library v1.9.0
     * http://jquery.com/
     *
     * Includes Sizzle.js
    Severity: Major
    Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 2 wks to fix

      File jquery-ui-timepicker-addon.js has 1470 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * jQuery timepicker addon
       * By: Trent Richardson [http://trentrichardson.com]
       * Version 1.2
       * Last Modified: 02/02/2013
      Severity: Major
      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 3 days to fix

        Function ajax has 237 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;
        Severity: Major
        Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 day to fix

          Function setDocument has 232 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          setDocument = Sizzle.setDocument = function( node ) {
              var doc = node ? node.ownerDocument || node : preferredDoc;
          
              // If no document and documentElement is available, return
              if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
          Severity: Major
          Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 day to fix

            Function mask has 231 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                mask: function(mask, settings) {
                    var input,
                        defs,
                        tests,
                        partialPosition,
            Severity: Major
            Found in lib/assets/javascripts/surveyor/jquery.maskedinput.js - About 1 day to fix

              Function _create has 191 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _create: function() {
                      // Some browsers only repeat keydown events, not keypress events,
                      // so we use the suppressKeyPress flag to determine if we've already
                      // handled the keydown event. #7269
                      // Unfortunately the code for & in keypress is the same as the up arrow,
              Severity: Major
              Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 7 hrs to fix

                Function _generateHTML has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _generateHTML: function(inst) {
                        var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
                            controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
                            monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
                            selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
                Severity: Major
                Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 6 hrs to fix

                  Function selectToUISlider has 162 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  jQuery.fn.selectToUISlider = function(settings){
                      var selects = jQuery(this);
                  
                      //accessible slider options
                      var options = jQuery.extend({
                  Severity: Major
                  Found in lib/assets/javascripts/surveyor/jquery.selectToUISlider.js - About 6 hrs to fix

                    Function size has 156 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    $.effects.effect.size = function( o, done ) {
                    
                        // Create element
                        var original, baseline, factor,
                            el = $( this ),
                    Severity: Major
                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 6 hrs to fix

                      Function parseTime has 154 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.datepicker.parseTime = function(timeFormat, timeString, options) {        
                              var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {});
                      
                              // Strict parse requires the timeString to match the timeFormat exactly
                              var strictParse = function(f, s, o){
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 6 hrs to fix

                        Function parseDate has 148 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            parseDate: function (format, value, settings) {
                                if (format == null || value == null) {
                                    throw "Invalid arguments";
                                }
                        
                        
                        Severity: Major
                        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 5 hrs to fix

                          Function position has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          $.fn.position = function( options ) {
                              if ( !options || !options.of ) {
                                  return _position.apply( this, arguments );
                              }
                          
                          
                          Severity: Major
                          Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 5 hrs to fix

                            Function _injectTimePicker has 146 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    _injectTimePicker: function() {
                                        var $dp = this.inst.dpDiv,
                                            o = this.inst.settings,
                                            tp_inst = this,
                                            litem = '',
                            Severity: Major
                            Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 5 hrs to fix

                              Function _create has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  _create: function() {
                                      this.element.closest( "form" )
                                          .unbind( "reset" + this.eventNamespace )
                                          .bind( "reset" + this.eventNamespace, formResetHandler );
                              
                              
                              Severity: Major
                              Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 5 hrs to fix

                                Method build_and_set has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def build_and_set(context, r)
                                    # text_validation_type text_validation_min text_validation_max
                                    min = r[:text_validation_min].to_s.blank? ? nil : r[:text_validation_min].to_s
                                    max = r[:text_validation_max].to_s.blank? ? nil : r[:text_validation_max].to_s
                                    type = r[:text_validation_type].to_s.blank? ? nil : r[:text_validation_type].to_s
                                Severity: Minor
                                Found in lib/surveyor/redcap_parser.rb - About 5 hrs 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 Callbacks has 127 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                jQuery.Callbacks = function( options ) {
                                
                                    // Convert options from String-formatted to Object-formatted if needed
                                    // (we check in cache first)
                                    options = typeof options === "string" ?
                                Severity: Major
                                Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 5 hrs to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if ( event.pageX == null && original.clientX != null ) {
                                                  eventDoc = event.target.ownerDocument || document;
                                                  doc = eventDoc.documentElement;
                                                  body = eventDoc.body;
                                  
                                  
                                  Severity: Critical
                                  Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 5 hrs to fix

                                    Function support has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    jQuery.support = (function() {
                                    
                                        var support, all, a, select, opt, input, fragment, eventName, isSupported, i,
                                            div = document.createElement("div");
                                    
                                    
                                    Severity: Major
                                    Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 4 hrs to fix

                                      Function strictParse has 114 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              var strictParse = function(f, s, o){
                                      
                                                  // pattern for standard and localized AM/PM markers
                                                  var getPatternAmpm = function(amNames, pmNames) {
                                                      var markers = [];
                                      Severity: Major
                                      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 4 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language