NUBIC/surveyor

View on GitHub

Showing 371 of 658 total issues

Function _createWidget has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _createWidget: function( options, element ) {
        element = $( element || this.defaultElement || this )[ 0 ];
        this.element = $( element );
        this.uuid = uuid++;
        this.eventNamespace = "." + this.widgetName + this.uuid;
Severity: Minor
Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

    Function _makeDraggable has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _makeDraggable: function() {
            var that = this,
                options = this.options;
    
            function filteredUi( ui ) {
    Severity: Minor
    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

      Function finish has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          finish: function( type ) {
              if ( type !== false ) {
                  type = type || "fx";
              }
              return this.each(function() {
      Severity: Minor
      Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 hr to fix

        Function looseParse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                var looseParse = function(f,s,o){
                    try{
                        var d = new Date('2012-01-01 '+ s);
                        if(isNaN(d.getTime())){
                            d = new Date('2012-01-01T'+ s);
        Severity: Minor
        Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 1 hr to fix

          Function caret has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              caret: function(begin, end) {
                  var range;
          
                  if (this.length === 0 || this.is(":hidden")) {
                      return;
          Severity: Minor
          Found in lib/assets/javascripts/surveyor/jquery.maskedinput.js - About 1 hr to fix

            Method to_csv has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                  def to_csv(access_code = false, print_header = true)
                    result = Surveyor::Common.csv_impl.generate do |csv|
                      if print_header
                        csv << (access_code ? ["response set access code"] : []) +
                          csv_question_columns.map{|qcol| "question.#{qcol}"} +
            Severity: Minor
            Found in lib/surveyor/models/response_set_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 parse has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def parse(str, filename)
                  csvlib = Surveyor::Common.csv_impl
                  begin
                    csvlib.parse(str, :headers => :first_row, :return_headers => true, :header_converters => :symbol) do |r|
                      if r.header_row? # header row
            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 _setupHeightStyle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _setupHeightStyle: function( heightStyle ) {
                    var maxHeight,
                        parent = this.element.parent();
            
                    if ( heightStyle === "fill" ) {
            Severity: Minor
            Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

              Function _updateVirtualBoundaries has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _updateVirtualBoundaries: function(forceAspectRatio) {
                      var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
                          o = this.options;
              
                      b = {
              Severity: Minor
              Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                Function left has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        left: function( position, data ) {
                            var within = data.within,
                                withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
                                outerWidth = within.width,
                                collisionPosLeft = position.left - data.collisionPosition.marginLeft,
                Severity: Minor
                Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                  Function top has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          top: function( position, data ) {
                              var within = data.within,
                                  withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
                                  outerHeight = data.within.height,
                                  collisionPosTop = position.top - data.collisionPosition.marginTop,
                  Severity: Minor
                  Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                    Function stop has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        stop: function( event ) {
                            var that = $(this).data("ui-resizable"),
                                o = that.options,
                                pr = that._proportionallyResizeElements,
                                ista = pr.length && (/textarea/i).test(pr[0].nodeName),
                    Severity: Minor
                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                      Function getDimensions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getDimensions( elem ) {
                          var raw = elem[0];
                          if ( raw.nodeType === 9 ) {
                              return {
                                  width: elem.width(),
                      Severity: Minor
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                        Function refresh has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            refresh: function() {
                                //See #8237 & #8828
                                var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
                        
                                if ( isDisabled !== this.options.disabled ) {
                        Severity: Minor
                        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                          Function _createPlaceholder has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              _createPlaceholder: function(that) {
                                  that = that || this;
                                  var className,
                                      o = that.options;
                          
                          
                          Severity: Minor
                          Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

                            Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    setup: function() {
                            
                                        if ( rformElems.test( this.nodeName ) ) {
                                            // IE doesn't fire change on a check/radio until blur; trigger it on click
                                            // after a propertychange. Eat the blur-change in special.change.handle.
                            Severity: Minor
                            Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 hr to fix

                              Function propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function propFilter( props, specialEasing ) {
                                  var index, name, easing, value, hooks;
                              
                                  // camelCase, specialEasing and expand cssHook pass
                                  for ( index in props ) {
                              Severity: Minor
                              Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 1 hr to fix

                                Function _parseTime has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        _parseTime: function(timeString, withDate) {
                                            if (!this.inst) {
                                                this.inst = $.datepicker._getInst(this.$input[0]);
                                            }
                                
                                
                                Severity: Minor
                                Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 1 hr to fix

                                  Function set has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                              set: function( elem, value ) {
                                                  var parsed, curElem,
                                                      backgroundColor = "";
                                  
                                                  if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
                                  Severity: Minor
                                  Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 1 hr to fix

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

                                        resize: function (event, ui) {
                                            var that = $(this).data("ui-resizable"),
                                                o = that.options,
                                                os = that.originalSize,
                                                op = that.originalPosition,
                                    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