NUBIC/surveyor

View on GitHub

Showing 658 of 658 total issues

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

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

                        pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
        Severity: Major
        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 5 hrs to fix
        lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 12982..12982

        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 141.

        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

                        pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
        Severity: Major
        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 5 hrs to fix
        lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 12985..12985

        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 141.

        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

        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

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

                                pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
                Severity: Major
                Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 4 hrs to fix
                lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 6304..6304

                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 125.

                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

                                pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
                Severity: Major
                Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 4 hrs to fix
                lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 6307..6307

                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 125.

                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 _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

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

                            if ( this._hasScroll() ) {
                                base = this.active.offset().top;
                                height = this.element.height();
                                this.active.nextAll( ".ui-menu-item" ).each(function() {
                                    item = $( this );
                    Severity: Major
                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 4 hrs to fix
                    lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 9909..9920

                    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 121.

                    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 ( this._hasScroll() ) {
                                base = this.active.offset().top;
                                height = this.element.height();
                                this.active.prevAll( ".ui-menu-item" ).each(function() {
                                    item = $( this );
                    Severity: Major
                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 4 hrs to fix
                    lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 9885..9897

                    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 121.

                    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 ( that.orientation === "horizontal" ) {
                                            if ( i === 0 ) {
                                                that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
                                            }
                                            if ( i === 1 ) {
                    Severity: Major
                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 4 hrs to fix
                    lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 11804..11811

                    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 121.

                    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

                                        } else {
                                            if ( i === 0 ) {
                                                that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
                                            }
                                            if ( i === 1 ) {
                    Severity: Major
                    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 4 hrs to fix
                    lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 11797..11804

                    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 121.

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