NUBIC/surveyor

View on GitHub

Showing 371 of 658 total issues

Function _newInst has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _newInst: function($input, o) {
            var tp_inst = new Timepicker(),
                inlineSettings = {},
                fns = {},
                overrides, i;
Severity: Major
Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 4 hrs to fix

    Function _limitMinMaxDateTime has 111 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            _limitMinMaxDateTime: function(dp_inst, adjustSliders) {
                var o = this._defaults,
                    dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
    
                if (!this._defaults.showTimepicker) {
    Severity: Major
    Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 4 hrs to fix

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

          _create: function() {
      
              var n, i, handle, axis, hname,
                  that = this,
                  o = this.options;
      Severity: Major
      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 4 hrs to fix

        File parser.rb has 345 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        %w(survey survey_translation survey_section question_group question dependency dependency_condition answer validation validation_condition).each {|model| require model }
        
        require 'yaml'
        
        module Surveyor
        Severity: Minor
        Found in lib/surveyor/parser.rb - About 4 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                      if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
                          if(inst.snapElements[i].snapping) {
                              (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
                          }
                          inst.snapElements[i].snapping = false;
          Severity: Critical
          Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 4 hrs to fix

            Function defaultPrefilter has 95 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function defaultPrefilter( elem, props, opts ) {
                /*jshint validthis:true */
                var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
                    anim = this,
                    style = elem.style,
            Severity: Major
            Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 3 hrs to fix

              Function send has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              send: function( headers, complete ) {
              
                                  // Get a new xhr
                                  var handle, i,
                                      xhr = s.xhr();
              Severity: Major
              Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 3 hrs to fix

                Function _refresh has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _refresh: function() {
                        var maxHeight,
                            options = this.options,
                            heightStyle = options.heightStyle,
                            parent = this.element.parent(),
                Severity: Major
                Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 3 hrs to fix

                  Function trigger has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      trigger: function( event, data, elem, onlyHandlers ) {
                  
                          var i, cur, tmp, bubbleType, ontype, handle, special,
                              eventPath = [ elem || document ],
                              type = event.type || event,
                  Severity: Major
                  Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 3 hrs to fix

                    Function _doKeyDown has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _doKeyDown: function(event) {
                            var onSelect, dateStr, sel,
                                inst = $.datepicker._getInst(event.target),
                                handled = true,
                                isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
                    Severity: Major
                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 3 hrs to fix

                      Function Animation has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function Animation( elem, properties, options ) {
                          var result,
                              stopped,
                              index = 0,
                              length = animationPrefilters.length,
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 3 hrs to fix

                        Function _keydown has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _keydown: function( event ) {
                                /*jshint maxcomplexity:20*/
                                var match, prev, character, skip, regex,
                                    preventDefault = true;
                        
                        
                        Severity: Major
                        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 3 hrs to fix

                          Function formatDate has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              formatDate: function (format, date, settings) {
                                  if (!date) {
                                      return "";
                                  }
                          
                          
                          Severity: Major
                          Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 3 hrs to fix

                            Method unparse has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def unparse(dsl)
                                with_defaults = Answer.new(:text => text)
                                attrs = self.attributes.delete_if{|k,v| with_defaults[k] == v or %w(created_at updated_at reference_identifier response_class id question_id api_id).include? k}.symbolize_keys!
                                attrs.delete(:is_exclusive) if text == "Omit" && is_exclusive == true
                                attrs.merge!({:is_exclusive => false}) if text == "Omit" && is_exclusive == false
                            Severity: Minor
                            Found in lib/surveyor/unparser.rb - About 3 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 Sizzle has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function Sizzle( selector, context, results, seed ) {
                                var match, elem, m, nodeType,
                                    // QSA vars
                                    i, groups, old, nid, newContext, newSelector;
                            
                            
                            Severity: Major
                            Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 3 hrs to fix

                              Function _clear has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  _clear: function(event, noPropagation) {
                              
                                      this.reverting = false;
                                      // We delay all events that have to be triggered to after the point where the placeholder has been removed and
                                      // everything else normalized again
                              Severity: Major
                              Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 3 hrs to fix

                                Function _onTimeChange has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        _onTimeChange: function() {
                                            var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
                                                minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
                                                second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
                                                millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
                                Severity: Major
                                Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 3 hrs to fix

                                  Function _mouseStart has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      _mouseStart: function(event, overrideHandle, noActivation) {
                                  
                                          var i,
                                              o = this.options;
                                  
                                  
                                  Severity: Major
                                  Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 3 hrs to fix

                                    Function _mouseDrag has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        _mouseDrag: function(event) {
                                            var i, item, itemElement, intersection,
                                                o = this.options,
                                                scrolled = false;
                                    
                                    
                                    Severity: Major
                                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 3 hrs to fix

                                      Function _optionDatepicker has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          $.datepicker._optionDatepicker = function(target, name, value) {
                                              var inst = this._getInst(target),
                                                  name_clone;
                                              if (!inst) {
                                                  return null;
                                      Severity: Major
                                      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 3 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language