SysMO-DB/seek

View on GitHub

Showing 1,025 of 1,025 total issues

Method people_i_may_know has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def people_i_may_know
    res=[]
    institutions.each do |i|
      i.people.each do |p|
        res << p unless p==self or res.include? p
Severity: Minor
Found in app/models/person.rb - About 55 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 send_subscription_mails has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def send_subscription_mails logs, frequency
    if Seek::Config.email_enabled
      #strip the logs down to those that are relevant
      logs.reject! do |log|
        log.activity_loggable.nil? || !log.activity_loggable.subscribable?
Severity: Minor
Found in app/jobs/send_periodic_emails_job.rb - About 55 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 perform has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def perform
    item = item_type_name.constantize.find_by_id(item_id)
    unless item.nil?
      begin
        if item.rdf_repository_configured?
Severity: Minor
Found in app/jobs/rdf_generation_job.rb - About 55 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 internationalized_resource_name has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def internationalized_resource_name resource_type,pluralize=true
    resource_type = resource_type.singularize
    if resource_type == "Speciman"
      result = t('biosamples.sample_parent_term')
    elsif resource_type == "Assay"
Severity: Minor
Found in app/helpers/application_helper.rb - About 55 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 list_organisms_and_strains has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def list_organisms_and_strains organism_and_strains, none_text="Not specified"
    result=""
    result="<span class='none_text'>#{none_text}</span>" if organism_and_strains.empty?
    organism_and_strains.each do |os|
      organism=os[0]
Severity: Minor
Found in app/helpers/organisms_helper.rb - About 55 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 fix_run_input_ports_mime_types has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def fix_run_input_ports_mime_types
      self.inputs.each do |input|
        input.metadata = {:size => nil, :type => ''} if input.metadata.nil?
        port = executed_workflow.input_ports.detect { |i| i.name == input.name }
        if port && !port.mime_type.blank?
Severity: Minor
Found in app/models/taverna_player/run.rb - About 55 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 rows_to_flot_data has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def rows_to_flot_data rows
    data = {}
    labels = []
    rows.each_with_index do |row,y|
      t=nil
Severity: Minor
Found in app/helpers/data_fuse_helper.rb - About 55 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 specimen_organism_list has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def specimen_organism_list organism,strain,culture_growth_type=nil,none_text="Not Specified"
    result=""
    result ="<span class='none_text'>#{none_text}</span>".html_safe if organism.nil?
    if organism
      result = link_to organism.title,organism,{:class => "assay_organism_info"}
Severity: Minor
Found in app/helpers/specimens_helper.rb - About 55 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 recent_changes_hash has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def recent_changes_hash

    item_hash=classify_for_tabs(Person.order('updated_at DESC').limit(RECENT_SIZE))
    item_hash.merge! classify_for_tabs(Project.order('updated_at DESC').limit(RECENT_SIZE))

Severity: Minor
Found in app/helpers/homes_helper.rb - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    def fancy_multiselect object, association, options = {}
      if options[:project_possibilities]  &&  options[:other_projects_checkbox]
        type = object.class.name.underscore
        default_checked = Seek::Config.is_virtualliver ? true : false
        check_box_and_alternative_list = "".html_safe
Severity: Minor
Found in app/helpers/fancy_multiselect_helper.rb - About 55 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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def update
    
    # extra check required to see if any avatar was actually selected (or it remains to be the default one)
    avatar_id = params[:project].delete(:avatar_id).to_i
    @project.avatar_id = ((avatar_id.kind_of?(Numeric) && avatar_id > 0) ? avatar_id : nil)
Severity: Minor
Found in app/controllers/projects_controller.rb - About 55 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_model_parameter_keys has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def resolve_model_parameter_keys parameter_keys, csv

    matching_columns = {}
    matched_keys = []
    matching_csv = []
Severity: Minor
Found in app/controllers/data_fuse_controller.rb - About 55 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 auth has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def auth
    action = translate_action(action_name)
    unless is_auth?(@sweep, action)
      if User.current_user.nil?
        flash[:error] = "You are not authorized to #{action} this Sweep, you may need to login first."
Severity: Minor
Found in app/controllers/sweeps_controller.rb - About 55 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 simulate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

 def simulate
    error=nil
    begin
      if @display_model.is_jws_supported?
        @modelname = Seek::JWS::Simulator.new.simulate(@display_model.jws_supported_content_blobs.first)
Severity: Minor
Found in app/controllers/models_controller.rb - About 55 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 find_avatar_auth has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def find_avatar_auth
    # can show avatars to anyone (given that avatar ID belongs to the avatar owner in the URL);
    # for all other actions some validation is required
    unless self.action_name.to_s == "show"
      if @avatar_for.downcase == "person"
Severity: Minor
Found in app/controllers/avatars_controller.rb - About 55 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_strains has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def existing_strains
      strains_of_organisms = []
      organisms = []
      if params[:organism_ids]
        organism_ids = params[:organism_ids].split(',')
Severity: Minor
Found in app/controllers/biosamples_controller.rb - About 55 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 compare_versions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def compare_versions
    if params[:file_id]
      @blob1 = @display_model.sbml_content_blobs.find{|b| b.id.to_s == params[:file_id]}
    else
      @blob1 = @display_model.sbml_content_blobs.first
Severity: Minor
Found in app/controllers/models_controller.rb - About 55 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 activate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def activate
    self.current_user = params[:activation_code].blank? ? false : User.find_by_activation_code(params[:activation_code])
    if logged_in? && !current_user.active?
      current_user.activate      
      if (current_user.person.projects.empty? && User.count>1)
Severity: Minor
Found in app/controllers/users_controller.rb - About 55 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 upload_for_tool has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def upload_for_tool

    if handle_upload_data
      params[:data_file][:project_ids] = [params[:data_file].delete(:project_id)] if params[:data_file][:project_id]
      @data_file = DataFile.new params[:data_file]
Severity: Minor
Found in app/controllers/data_files_controller.rb - About 55 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 auth has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def auth
    @content_blob = nil
    @annotation = nil

    if action_name == "create"
Severity: Minor
Found in app/controllers/spreadsheet_annotations_controller.rb - About 55 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