SysMO-DB/seek

View on GitHub

Showing 714 of 1,025 total issues

Method indented_tree_child_options has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def indented_tree_child_options parent, depth=0, show_edit=true, show_delete=true, selected_id=nil, related_resource_type="Person",selected_display_items=nil, foldable=true
Severity: Major
Found in app/helpers/projects_helper.rb - About 1 hr to fix

    Function relativeRows has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    function relativeRows(minRow, maxRow, sheetNumber){
        var current_page = null;
        if (sheetNumber != null)
            current_page = currentPage(sheetNumber);
    
    
    Severity: Minor
    Found in app/assets/javascripts/spreadsheet_explorer.js - 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

    Function additionalFieldForItem has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    function additionalFieldForItem(form_id, fs_or_ec_id){
        var elements =  $(form_id).getElements();
        var item;
        var substance_autocomplete;
        for (var i=0;i<elements.length;i++)
    Severity: Minor
    Found in app/assets/javascripts/studied_factor.js - 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 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 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 check_url_content_type has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      def check_url_content_type
        unless url.nil?
          begin
            response = RestClient.head url
            type = response.headers[:content_type] || ""
    Severity: Minor
    Found in app/models/content_blob.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 get_all_as_json has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.get_all_as_json
        all_people = Person.order("ID asc")
        names_emails = all_people.collect{ |p| {"id" => p.id,
            "name" => (p.first_name.blank? ? (logger.error("\n----\nUNEXPECTED DATA: person id = #{p.id} doesn't have a first name\n----\n"); "(NO FIRST NAME)") : h(p.first_name)) + " " +
                      (p.last_name.blank? ? (logger.error("\n----\nUNEXPECTED DATA: person id = #{p.id} doesn't have a last name\n----\n"); "(NO LAST NAME)") : h(p.last_name)),
    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 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 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 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 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 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 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 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 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 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 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

    Severity
    Category
    Status
    Source
    Language