NUBIC/surveyor

View on GitHub

Showing 371 of 658 total issues

Function remove has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    remove: function( elem, types, handler, selector, mappedTypes ) {
Severity: Minor
Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 35 mins to fix

    Function Tween has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function Tween( elem, options, prop, end, easing ) {
    Severity: Minor
    Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 35 mins to fix

      Function parseDateTimeInternal has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          var parseDateTimeInternal = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
      Severity: Minor
      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 35 mins to fix

        Function on has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
        Severity: Minor
        Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 35 mins to fix

          Function condense has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function condense( unmatched, map, filter, context, xml ) {
          Severity: Minor
          Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 35 mins to fix

            Function add has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                add: function( elem, types, handler, data, selector ) {
            Severity: Minor
            Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 35 mins to fix

              Function superMatcher has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      superMatcher = function( seed, context, xml, results, expandContext ) {
              Severity: Minor
              Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 35 mins to fix

                Function augmentWidthOrHeight has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
                Severity: Minor
                Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 35 mins to fix

                  Function options has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                                  options: function(tp_inst, obj, unit, opts, val){
                  Severity: Minor
                  Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 35 mins to fix

                    Function CHILD has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            "CHILD": function( type, what, argument, first, last ) {
                    Severity: Minor
                    Found in lib/assets/javascripts/surveyor/jquery-1.9.0.js - About 35 mins to fix

                      Function options has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                                      options: function(tp_inst, obj, unit, opts, val){
                      Severity: Minor
                      Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 35 mins to fix

                        Function parseDateTime has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            $.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
                        Severity: Minor
                        Found in lib/assets/javascripts/surveyor/jquery-ui-timepicker-addon.js - About 35 mins to fix

                          Method survey_check_box has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                def survey_check_box(object_name, method, options = {}, checked_value = "1", unchecked_value = "0")
                          Severity: Minor
                          Found in app/helpers/survey_form_builder.rb - About 35 mins to fix

                            Method as has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def as(type_symbol)
                                  return case type_symbol.to_sym
                                  when :string, :text, :integer, :float, :datetime
                                    self.send("#{type_symbol}_value".to_sym)
                                  when :date
                            Severity: Minor
                            Found in lib/surveyor/acts_as_response.rb - About 35 mins 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 resolve_dependency_condition_references has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def resolve_dependency_condition_references
                                  self.context[:dependency_conditions].each do |dc|
                                    # Looking up references to questions and answers for linking the dependency objects
                                    self.context[:bad_references].push "q_#{dc.question_reference}" unless (dc.question = self.context[:question_references][dc.question_reference])
                                    self.context[:answer_references][dc.question_reference] ||= {}
                            Severity: Minor
                            Found in lib/surveyor/parser.rb - About 35 mins 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 unparse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def unparse(dsl)
                                with_defaults = DependencyCondition.new
                                attrs = self.attributes.delete_if{|k,v| with_defaults[k] == v or %w(created_at updated_at question_id question_group_id rule_key rule operator id dependency_id answer_id).include? k}.symbolize_keys!
                                dsl << "  " if dependency.question.part_of_group?
                                dsl << "    condition"
                            Severity: Minor
                            Found in lib/surveyor/unparser.rb - About 35 mins 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 questions_and_groups has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                  def questions_and_groups
                                    qs = []
                                    questions.each_with_index.map do |q,i|
                                      if q.part_of_group?
                                        if (i+1 >= questions.size) or (q.question_group_id != questions[i+1].question_group_id)
                            Severity: Minor
                            Found in lib/surveyor/models/survey_section_methods.rb - About 35 mins 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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def create
                                  surveys = Survey.where(:access_code => params[:survey_code]).order("survey_version DESC")
                                  if params[:survey_version].blank?
                                    @survey = surveys.first
                                  else
                            Severity: Minor
                            Found in lib/surveyor/surveyor_controller_methods.rb - About 35 mins 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 unparse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              def unparse(dsl)
                                with_defaults = QuestionGroup.new(:text => text)
                                attrs = self.attributes.delete_if{|k,v| with_defaults[k] == v or %w(created_at updated_at id api_id).include?(k) or (k == "display_type" && %w(grid repeater default).include?(v))}.symbolize_keys!
                                method = (%w(grid repeater).include?(display_type) ? display_type : "group")
                                dsl << "\n"
                            Severity: Minor
                            Found in lib/surveyor/unparser.rb - About 35 mins 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 migrations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def migrations
                                  unless options[:skip_migrations]
                                    check_for_orphaned_migration_files
                            
                                    # increment migration timestamps to prevent collisions. copied functionality from RAILS_GEM_PATH/lib/rails_generator/commands.rb
                            Severity: Minor
                            Found in lib/generators/surveyor/install_generator.rb - About 35 mins 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

                            Severity
                            Category
                            Status
                            Source
                            Language