vegantech/sims

View on GitHub

Showing 223 of 433 total issues

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

  def intervention_probe_assignment=(params)
    intervention_probe_assignments.update_all(:enabled => false) #disable all others
    params.stringify_keys! unless params.blank? #fix for LH #392
    return if params.blank? or (params['probe_definition_id']=='' and params['probe_definition_attributes'].blank? )

Severity: Minor
Found in app/models/intervention.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 verify_externally has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def verify_externally(student,district)

#   curl "https://uaapps.dpi.wi.gov/SIMS_Student_Location_Confirm/SIMS/nonsecure"
 #  -d wsn=9000000099 -d district=3456 -H "Accept: text/xml"

Severity: Minor
Found in lib/verify_student_in_district_externally.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 destroy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def destroy
    #really_destroy if confirm is true or used_at_all?
    @tier = current_district.tiers.find(params[:id])

    if current_district.tiers.count < 2
Severity: Minor
Found in app/controllers/tiers_controller.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 selected_navigation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def selected_navigation
    if multiple_selected_students?
      index = selected_student_ids.index(current_student_id)
      ret = "Student #{index+1} of #{selected_student_ids.size} &nbsp;&nbsp; "

Severity: Minor
Found in app/helpers/students_helper.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 save_or_update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def save_or_update redirect_action, result_verb
    respond_to do |format|
      if @element_definition.save
        @element_definition.answer_definitions.create!(:value=>0) unless @element_definition.answer_definitions.count >0
        flash[:notice] = "Element Definition was successfully #{result_verb}"
Severity: Minor
Found in app/controllers/checklist_builder/elements_controller.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
    #FIXME should be skinnier model
    @checklist = current_student.checklists.build(params.slice("commit","save_draft","element_definition"))
    @checklist.teacher = current_user

Severity: Minor
Found in app/controllers/checklists_controller.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 score_in_range has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def score_in_range
    if score.present? and self.probe_definition.present?
      if probe_definition.minimum_score.present? and score < probe_definition.minimum_score
        errors.add(:score, "below minimum") and return false
      end
Severity: Minor
Found in app/models/probe.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 valid_password? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def valid_password?(password)
      if self.passwordhash.present?
        if legacy_hashes(password).include?(self.passwordhash_before_type_cast.downcase[0..39])
          self.password = password
          self.passwordhash = nil
Severity: Minor
Found in app/models/devise/legacy_password.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 element_definition= has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def element_definition=(element_definition_hash)
    @answer_definition_ids = []
    element_definition_hash.each do |element_definition_id, answer|
      element_definition = ElementDefinition.find(element_definition_id)
      if ['scale','applicable'].include?(element_definition.kind)
Severity: Minor
Found in app/models/checklist.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 pdf_headers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def pdf_headers
    if request.env['HTTP_USER_AGENT'] =~ /msie/i
      headers['Pragma'] ||= ''
      headers['Cache-Control'] ||= ''
    else
Severity: Minor
Found in app/controllers/reports_controller.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 ignore_flag has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def ignore_flag
    if params[:category] then
      @ignore_flag=current_student.ignore_flags.build(:category=>params[:category], :user_id => current_user.id)
      respond_to do |format|
        format.html {render :action=> "_ignore_flag"}
Severity: Minor
Found in app/controllers/custom_flags_controller.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 save_assets has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def save_assets
    assets.each do |asset|
      @touch_me = true if asset.frozen? or asset.changed?
      asset.save(:validate => false) if !asset.frozen? and asset.changed?
    end
Severity: Minor
Found in lib/link_and_attachment_assets.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 existing_asset_attributes= has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def existing_asset_attributes=(asset_attributes)
    @touch_me=false
    claim_assets(asset_attributes.keys) if new_record?
    assets.reject(&:new_record?).each do |asset|
      attributes = asset_attributes[asset.id.to_s]
Severity: Minor
Found in lib/link_and_attachment_assets.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 generate_recommended_monitors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def generate_recommended_monitors
    CSV.table("#{path}/recommended_monitors.csv").each do |ck|
      next unless ckhash = prephash(ck)
      ckhash[:intervention_definition_id]= definitionhash[ck[:intervention_definition_id]]
      ckhash[:probe_definition_id]= probe_hash[ck[:probe_definition_id]]
Severity: Minor
Found in lib/training_district/intervention.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 validate_within_probe_definition_range has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def validate_within_probe_definition_range

    if probe_definition && benchmark.present?
      if self.probe_definition.minimum_score && benchmark < self.probe_definition.minimum_score
        errors.add(:benchmark, "must be greater than the minimum score. for the progress monitor definition")
Severity: Minor
Found in app/models/probe_definition_benchmark.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

Avoid too many return statements within this function.
Open

            return "Failed to format result: " + e.message;
Severity: Major
Found in app/assets/javascripts/ie-console.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return "" + result;
    Severity: Major
    Found in app/assets/javascripts/ie-console.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                          return "object";
      Severity: Major
      Found in app/assets/javascripts/ie-console.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return false;
        Severity: Major
        Found in app/assets/javascripts/datepicker.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                  if ( kc < 37 || kc > 40 ) return true;
          Severity: Major
          Found in app/assets/javascripts/datepicker.js - About 30 mins to fix
            Severity
            Category
            Status
            Source
            Language