NUBIC/surveyor

View on GitHub

Showing 371 of 658 total issues

Function ajaxConvert has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function ajaxConvert( s, response ) {

    var conv, conv2, current, tmp,
        converters = {},
        i = 0,
Severity: Major
Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 2 hrs to fix

    Function internalData has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function internalData( elem, name, data, pvt /* Internal Use Only */ ){
        if ( !jQuery.acceptData( elem ) ) {
            return;
        }
    
    
    Severity: Major
    Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 2 hrs to fix

      Function formatTime has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.datepicker.formatTime = function(format, time, options) {
              options = options || {};
              options = $.extend({}, $.timepicker._defaults, options);
              time = $.extend({
                  hour: 0,
      Severity: Major
      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor !== Array) {
                    c = $(o.containment);
                    ce = c[0];
        
                    if(!ce) {
        Severity: Critical
        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 2 hrs to fix

          Function animateClass has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          $.effects.animateClass = function( value, duration, easing, callback ) {
              var o = $.speed( duration, easing, callback );
          
              return this.queue( function() {
                  var animated = $( this ),
          Severity: Minor
          Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                            if ( ( mappedTypes || origType === handleObj.origType ) &&
                                ( !handler || handler.guid === handleObj.guid ) &&
                                ( !tmp || tmp.test( handleObj.namespace ) ) &&
                                ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
                                handlers.splice( j, 1 );
            Severity: Critical
            Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 2 hrs to fix

              Function remove has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  remove: function( elem, types, handler, selector, mappedTypes ) {
              
                      var j, origCount, tmp,
                          events, t, handleObj,
                          special, handlers, type, namespaces, origType,
              Severity: Minor
              Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 2 hrs to fix

                Function blind has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                $.effects.effect.blind = function( o, done ) {
                    // Create element
                    var el = $( this ),
                        props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
                        mode = $.effects.setMode( el, o.mode || "hide" ),
                Severity: Minor
                Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                  Function _setOption has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _setOption: function( key, value ) {
                          /*jshint maxcomplexity:15*/
                          var isDraggable, isResizable,
                              uiDialog = this.uiDialog;
                  
                  
                  Severity: Minor
                  Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                    Function _animate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _animate: function( toShow, toHide, data ) {
                            var total, easing, duration,
                                that = this,
                                adjust = 0,
                                down = toShow.length &&
                    Severity: Minor
                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                      Function _mouseCapture has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _mouseCapture: function( event ) {
                              var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
                                  that = this,
                                  o = this.options;
                      
                      
                      Severity: Minor
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                        Function _determineDate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _determineDate: function(inst, date, defaultDate) {
                                var offsetNumeric = function(offset) {
                                        var date = new Date();
                                        date.setDate(date.getDate() + offset);
                                        return date;
                        Severity: Minor
                        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                          Function _toggle has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              _toggle: function( event, eventData ) {
                                  var that = this,
                                      toShow = eventData.newPanel,
                                      toHide = eventData.oldPanel;
                          
                          
                          Severity: Minor
                          Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                            Function internalRemoveData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function internalRemoveData( elem, name, pvt /* For internal use only */ ){
                                if ( !jQuery.acceptData( elem ) ) {
                                    return;
                                }
                            
                            
                            Severity: Minor
                            Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 hr to fix

                              Method to_hash has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                              Open

                                    def to_hash(response_set)
                                      # all responses to associated question
                                      responses = question.blank? ? [] : response_set.responses.where("responses.answer_id in (?)", question.answer_ids)
                                      if self.operator.match /^count(>|>=|<|<=|==|!=)\d+$/
                                        op, i = self.operator.scan(/^count(>|>=|<|<=|==|!=)(\d+)$/).flatten
                              Severity: Minor
                              Found in lib/surveyor/models/dependency_condition_methods.rb - 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

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

                                def build_and_set(context, r)
                                  case r[:field_type]
                                  when "text"
                                    self.attributes = {
                                      :response_class => "string",
                              Severity: Minor
                              Found in lib/surveyor/redcap_parser.rb - 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 scale has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              $.effects.effect.scale = function( o, done ) {
                              
                                  // Create element
                                  var el = $( this ),
                                      options = $.extend( true, {}, o ),
                              Severity: Minor
                              Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                                Function resize has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    resize: function() {
                                        var that = $(this).data("ui-resizable"),
                                            o = that.options,
                                            cs = that.size,
                                            os = that.originalSize,
                                Severity: Minor
                                Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                                  Function fold has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  $.effects.effect.fold = function( o, done ) {
                                  
                                      // Create element
                                      var el = $( this ),
                                          props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
                                  Severity: Minor
                                  Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                                    Function _generatePosition has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        _generatePosition: function(event) {
                                    
                                            var top, left,
                                                o = this.options,
                                                pageX = event.pageX,
                                    Severity: Minor
                                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language