NUBIC/surveyor

View on GitHub

Showing 658 of 658 total issues

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

        if ( factor.from.x !== factor.to.x ) {
            props = props.concat( hProps );
            el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
            el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
        }
Severity: Major
Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 3 hrs to fix
lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 9044..9048

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

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

            child.to = {
                height: c_original.height * factor.to.y,
                width: c_original.width * factor.to.x,
                outerHeight: c_original.height * factor.to.y,
                outerWidth: c_original.width * factor.to.x
Severity: Major
Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js and 1 other location - About 3 hrs to fix
lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js on lines 9104..9109

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

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 Datepicker has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Datepicker() {
    this._curInst = null; // The current instance in use
    this._keyEvent = false; // If the last event was a key event
    this._disabledInputs = []; // List of date picker inputs that have been disabled
    this._datepickerShowing = false; // True if the popup picker is showing , false if not
Severity: Major
Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 2 hrs to fix

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

        _mouseDrag: function(event) {
    
            this.dragged = true;
    
            if (this.options.disabled) {
    Severity: Major
    Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 2 hrs to fix

      File jquery.maskedinput.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
          Masked Input plugin for jQuery
          Copyright (c) 2007-2013 Josh Bush (digitalbush.com)
          Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
          Version: 1.3.1
      Severity: Minor
      Found in lib/assets/javascripts/surveyor/jquery.maskedinput.js - About 2 hrs to fix

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

            _create: function() {
                this.activeMenu = this.element;
                // flag used to prevent firing of the click handler
                // as the event bubbles up through nested menus
                this.mouseHandled = false;
        Severity: Major
        Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 2 hrs to fix

          Function buildFragment has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              buildFragment: function( elems, context, scripts, selection ) {
                  var contains, elem, tag, tmp, wrap, tbody, j,
                      l = elems.length,
          
                      // Ensure a safe fragment
          Severity: Major
          Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 2 hrs to fix

            Method parse_and_build has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
            Open

              def parse_and_build(context, args, original_method, reference_identifier)
                # clear context
                [ :question,
                  :dependency,
                  :dependency_condition,
            Severity: Minor
            Found in lib/surveyor/parser.rb - About 2 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 widget has 72 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            $.widget = function( name, base, prototype ) {
                var fullName, existingConstructor, constructor, basePrototype,
                    // proxiedPrototype allows the provided prototype to remain unmodified
                    // so that it can be used as a mixin for multiple widgets (#8876)
                    proxiedPrototype = {},
            Severity: Major
            Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 2 hrs to fix

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

                      $.extend(this.offset, {
                          click: { //Where the click happened, relative to the element
                              left: event.pageX - this.offset.left,
                              top: event.pageY - this.offset.top
                          },
              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 12097..12104

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

              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

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

                      $.extend(this.offset, {
                          click: { //Where the click happened, relative to the element
                              left: event.pageX - this.offset.left,
                              top: event.pageY - this.offset.top
                          },
              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 5935..5942

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

              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._helper && !o.animate && (/relative/).test(ce.css("position"))) {
                          $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
                      }
              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 10866..10868

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

              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._helper && !o.animate && (/static/).test(ce.css("position"))) {
                          $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
                      }
              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 10862..10864

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

              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

              Class PermittedParams has 25 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class PermittedParams < Struct.new(:params)
                # per http://railscasts.com/episodes/371-strong-parameters
                def strong_parameters
                  ActionController::Parameters.new(params)
                end
              Severity: Minor
              Found in app/models/permitted_params.rb - About 2 hrs to fix

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

                    _create: function() {
                        var i, handleCount,
                            o = this.options,
                            existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
                            handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
                Severity: Major
                Found in lib/assets/javascripts/surveyor/jquery-ui-1.10.0.custom.js - About 2 hrs to fix

                  Function Timepicker has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var Timepicker = function() {
                          this.regional = []; // Available regional settings, indexed by language code
                          this.regional[''] = { // Default regional settings
                              currentText: 'Now',
                              closeText: 'Done',
                  Severity: Major
                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 2 hrs to fix

                    Function add has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        add: function( elem, types, handler, data, selector ) {
                    
                            var handleObjIn, eventHandle, tmp,
                                events, t, handleObj,
                                special, handlers, type, namespaces, origType,
                    Severity: Major
                    Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 2 hrs to fix

                      Function domManip has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          domManip: function( args, table, callback ) {
                      
                              // Flatten any nested arrays
                              args = core_concat.apply( [], args );
                      
                      
                      Severity: Major
                      Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 2 hrs to fix

                        Function matcherFromGroupMatchers has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                            // A counter to specify which element is currently being matched
                            var matcherCachedRuns = 0,
                                bySet = setMatchers.length > 0,
                                byElement = elementMatchers.length > 0,
                        Severity: Major
                        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

                                  if (tp_inst) {
                                      if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
                                          try {
                                              $.datepicker._updateDatepicker(inst);
                                          } catch (err) {
                          lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js on lines 824..832

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

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language