NUBIC/surveyor

View on GitHub

Showing 658 of 658 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

                    if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
Severity: Major
Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 2 hrs to fix
lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 12676..12676

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 76.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File redcap_parser.rb has 252 lines of code (exceeds 250 allowed). Consider refactoring.
Open

%w(survey survey_section question_group question dependency dependency_condition answer validation validation_condition).each {|model| require model }
require 'active_support' # for humanize
module Surveyor
  class RedcapParserError < StandardError; end
  class RedcapParser
Severity: Minor
Found in lib/surveyor/redcap_parser.rb - About 2 hrs to fix

    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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                  top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop)
                  Severity: Major
                  Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 2 hrs to fix
                  lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 12333..12333

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 75.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          $.fn[method].call(endTime, $.extend({
                              onClose: function(dateText, inst) {
                                  checkDates(this, startTime, dateText);
                              },
                              onSelect: function(selectedDateTime) {
                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 1853..1860

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 75.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                                  left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft),
                  Severity: Major
                  Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 2 hrs to fix
                  lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 12334..12334

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 75.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          $.fn[method].call(startTime, $.extend({
                              onClose: function(dateText, inst) {
                                  checkDates(this, endTime, dateText);
                              },
                              onSelect: function(selectedDateTime) {
                  lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 1861..1868

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 75.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                                  if ( oRange === "max" && this.orientation === "horizontal" ) {
                                      this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
                                  }
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 1 hr to fix
                      lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 11834..11836

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 74.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                                  if ( oRange === "max" && this.orientation === "vertical" ) {
                                      this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
                                  }
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 1 hr to fix
                      lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 11828..11830

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 74.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                        function showElement(id){
                          group = id.match('^g_') ? true : false;
                          if (group) {
                            jQuery('#' + id).removeClass("g_hidden");
                          } else {
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery.surveyor.js and 1 other location - About 1 hr to fix
                      lib/assets/javascripts/surveyor/jquery.surveyor.js on lines 117..124

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 74.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                        function hideElement(id){
                          group = id.match('^g_') ? true : false;
                          if (group) {
                            jQuery('#' + id).addClass("g_hidden");
                          } else {
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery.surveyor.js and 1 other location - About 1 hr to fix
                      lib/assets/javascripts/surveyor/jquery.surveyor.js on lines 108..115

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 74.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      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
                        Severity
                        Category
                        Status
                        Source
                        Language