SysMO-DB/seek

View on GitHub

Showing 714 of 1,025 total issues

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

  def clean_up_and_assign_permissions
    #remove the permissions which are set on this person
    remove_permissions

    #retrieve the items that this person is contributor (owner for assay)
Severity: Minor
Found in app/models/person.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 data_io_object has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def data_io_object
    return @tmp_io_object unless @tmp_io_object.nil?
    return StringIO.new(@data) unless @data.nil? 
    return File.open(filepath,"rb") if file_exists?
    return StringIO.new(data_old) unless data_old.nil?
Severity: Minor
Found in app/models/content_blob.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 top_level_menu_tabs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def top_level_menu_tabs definitions
    selected_tab = current_top_level_tab(definitions)
    definitions.select{|d| !d[:hide]}.collect do |menu|
      attributes = ""
      attributes << "id = 'selected_tabnav'" if selected_tab == menu
Severity: Minor
Found in app/helpers/menu_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 orcid_identifier has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def orcid_identifier person
    id = person.orcid
    unless id.blank?
      id = "http://orcid.org/"+id unless id.start_with?("http://orcid.org/")
      id = link_to(id,id,:target=>"_blank").html_safe
Severity: Minor
Found in app/helpers/people_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 fancy_multiselect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def fancy_multiselect object, association, options = {}
      #skip if preview is disabled
      return super if options.delete :preview_disabled

      #skip if controller class does not define a preview method
Severity: Minor
Found in app/helpers/fancy_multiselect_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 organism_and_strain has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def organism_and_strain strain,organism=strain.organism, none_text="Not specified"
    result = ""
    if organism
      result << link_to(h(organism.title), organism)
      if strain && !strain.is_dummy? && strain.can_view?
Severity: Minor
Found in app/helpers/organisms_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 public_asset_url has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def public_asset_url(size = nil)
    size ||= 200

    if size == 'large'
      size = LARGE_SIZE
Severity: Minor
Found in app/models/avatar.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 child_single_select_options has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def child_single_select_options parent, depth=0
    result = []

    unless parent.children.empty?
      parent.children.sort { |a, b| a.title.downcase <=> b.title.downcase }.each do |child|
Severity: Minor
Found in app/helpers/projects_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 is_entirely_private? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def is_entirely_private? grouped_people_by_access_type, contributor
    entirely_private = true
    if access_type > Policy::NO_ACCESS
        entirely_private = false
    else
Severity: Minor
Found in app/models/policy.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 delayed_job_status has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def delayed_job_status
    status = ""
    begin
      pids = [0,1].collect do |n|
        Daemons::PidFile.new("#{Rails.root}/tmp/pids","delayed_job.#{n.to_s}")
Severity: Minor
Found in app/helpers/admin_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 describe_visibility has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def describe_visibility(model)
    text = '<strong>Visibility:</strong> '

    if model.policy.sharing_scope == 0
      css_class = 'private'
Severity: Minor
Found in app/helpers/application_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 author_display_list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def author_display_list publication
    if publication.publication_author_orders.empty?
       "<span class='none_text'>Not specified</span>".html_safe
    else
      author_list = []
Severity: Minor
Found in app/helpers/publications_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 fancy_multiselect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def fancy_multiselect object, association, options = {}

      if reflection = options[:object_class].reflect_on_association(association)
        required_access = reflection.options[:required_access] || :can_view?
        #get 'view' from :can_view?
Severity: Minor
Found in app/helpers/fancy_multiselect_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 classify_for_tabs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def classify_for_tabs result_collection
    results={}

    result_collection.each do |res|
      tab = res.respond_to?(:tab) ? res.tab : res.class.name
Severity: Minor
Found in app/helpers/application_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 process_privileged_people has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def process_privileged_people privileged_people, resource_name
    html = ''
    if !privileged_people.blank?
      html << "<h3> Privileged people:</h3>"
      privileged_people.each do |key, value|
Severity: Minor
Found in app/helpers/policy_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 child_type_links has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def child_type_links children,type
      unless children.empty?
        children.collect do |child|
          if child.is_a?(SuggestedAssayType) || child.is_a?(SuggestedTechnologyType)
            uris = ([child] +child.children).map(&:uri)
Severity: Minor
Found in app/helpers/assay_types_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 tagged_substances has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

   def tagged_substances resource
      tagged_substances = []
      link_table_name = (resource.class.name == 'StudiedFactor') ? 'studied_factor_links' : 'experimental_condition_links'
      if !resource.nil?
        (resource.send link_table_name).each do |ltn|
Severity: Minor
Found in app/helpers/studied_factors_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 show has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def show
    saved_search = SavedSearch.find_by_id(params[:id])

    respond_to do |format|
      if saved_search
Severity: Minor
Found in app/controllers/saved_searches_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 search_and_lazy_load_results has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def search_and_lazy_load_results
    type = params[:scale_type]
    scale = Scale.find_by_key(type)

    assets = scale ? Scale.with_scale(scale) :   everything_with_scale
Severity: Minor
Found in app/controllers/scales_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 show has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def show
    @country = white_list(params[:country_name])
    @institutions = Institution.where(["country LIKE ?", @country])
    
    respond_to do |format|
Severity: Minor
Found in app/controllers/countries_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

Severity
Category
Status
Source
Language