SysMO-DB/seek

View on GitHub

Showing 1,025 of 1,025 total issues

Method index has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def index
    if (params[:discipline_id])
      @discipline=Discipline.find(params[:discipline_id])
      #FIXME: strips out the disciplines that don't match
      @people=Person.where(["disciplines.id=?",@discipline.id]).includes(:disciplines)
Severity: Minor
Found in app/controllers/people_controller.rb - About 1 hr to fix

    Method builder has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def builder
        saved_file=params[:saved_file]
        error=nil
        supported=false
        begin
    Severity: Minor
    Found in app/controllers/models_controller.rb - About 1 hr to fix

      Method handle_download_zip has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def handle_download_zip asset
              #get the list of filename and filepath, {:filename => filepath}
              files_to_download = {}
              #store content_type for the case of 1 file
              content_type = nil
      Severity: Minor
      Found in lib/seek/download_handling/data_download.rb - About 1 hr to fix

        Method create_from_existing has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def create_from_existing
            experimental_condition_ids = []
            new_experimental_conditions = []
            #retrieve the selected FSes
            params.each do |key, value|
        Severity: Minor
        Found in app/controllers/experimental_conditions_controller.rb - About 1 hr to fix

          Method add_breadcrumbs has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def add_breadcrumbs
                #Home
                add_breadcrumb "Home", :root_path
                #process for nested attributes
                if controller_name == 'studied_factors'
          Severity: Minor
          Found in lib/seek/breadcrumbs.rb - About 1 hr to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              def create
                @group = WorkGroup.new(params[:group])
            
                respond_to do |format|
                  if @group.save
            Severity: Major
            Found in app/controllers/work_groups_controller.rb and 1 other location - About 1 hr to fix
            app/controllers/institutions_controller.rb on lines 57..67

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 53.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                if @specimen.save
                  if @specimen.from_biosamples=='true'
                    #reload to get updated nested attributes,e.g. genotypes/phenotypes
                    @specimen.reload
                    render :partial => "biosamples/back_to_biosamples", :locals => {:action => 'create', :object => @specimen}
            Severity: Major
            Found in app/controllers/specimens_controller.rb and 1 other location - About 1 hr to fix
            app/controllers/specimens_controller.rb on lines 108..122

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 53.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              def create
                @institution = Institution.new(params[:institution])
            
                respond_to do |format|
                  if @institution.save
            Severity: Major
            Found in app/controllers/institutions_controller.rb and 1 other location - About 1 hr to fix
            app/controllers/work_groups_controller.rb on lines 51..61

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 53.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                if @specimen.save
                  if @specimen.from_biosamples=='true'
                    #reload to get updated nested attributes,e.g. genotypes/phenotypes
                    @specimen.reload
                    render :partial => "biosamples/back_to_biosamples", :locals => {:action => 'update', :object => @specimen}
            Severity: Major
            Found in app/controllers/specimens_controller.rb and 1 other location - About 1 hr to fix
            app/controllers/specimens_controller.rb on lines 65..80

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 53.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function select_cells has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function select_cells(startCol, startRow, endCol, endRow, sheetNumber) {
                var minRow = startRow;
                var minCol = startCol;
                var maxRow = endRow;
                var maxCol = endCol;
            Severity: Minor
            Found in app/assets/javascripts/spreadsheet_explorer.js - About 1 hr to fix

              Method authorized_list has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def authorized_list all_items, attribute, sort=true, max_length=75, count_hidden_items=false
                  items = all_items.select &:can_view?
                  if Seek::Config.is_virtualliver
                    title_only_items = (all_items - items).select &:title_is_public?
                  else
              Severity: Minor
              Found in app/helpers/application_helper.rb - About 1 hr to fix

                Method create has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def create
                    if handle_upload_data
                      @model = Model.new(params[:model])
                
                      @model.policy.set_attributes_with_sharing params[:sharing], @model.projects
                Severity: Minor
                Found in app/controllers/models_controller.rb - About 1 hr to fix

                  Method existing_specimens has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def existing_specimens
                      specimens_of_strains = []
                      strains = []
                      specimens_with_default_strain =[]
                      if params[:strain_ids]
                  Severity: Minor
                  Found in app/controllers/biosamples_controller.rb - About 1 hr to fix

                    Method preview_permissions has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def preview_permissions
                          policy = sharing_params_to_policy
                          current_person = User.current_user.try(:person)
                          contributor_person = (params['is_new_file'] == 'false') ?  User.find_by_id(params['contributor_id'].to_i).try(:person) : current_person
                          creators = (params["creators"].blank? ? [] : ActiveSupport::JSON.decode(params["creators"])).uniq
                    Severity: Minor
                    Found in app/controllers/policies_controller.rb - About 1 hr to fix

                      Method resource_in_tab has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def resource_in_tab
                          resource_type = params[:resource_type]
                          view_type = params[:view_type]
                          scale_title = params[:scale_title] || ''
                      
                      
                      Severity: Minor
                      Found in app/controllers/application_controller.rb - About 1 hr to fix

                        Method included has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def self.included klass
                                klass.class_eval do
                                  searchable do
                                    text :title do
                                      if self.respond_to?(:title)
                        Severity: Minor
                        Found in lib/seek/search/search_sunspot.rb - About 1 hr to fix

                          Method populate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def populate      
                                begin
                                  @translucent_id = @node.find_first("id").content unless @node.find_first("id").nil?
                                  @author_seek_id = @node.find_first("submitter").content unless @node.find_first("submitter").nil?
                                  if @type=="Model"
                          Severity: Minor
                          Found in lib/jerm/translucent_resource.rb - About 1 hr to fix

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                        slider.maxThreshold = (slider.settings.maxSlides * slider.settings.slideWidth) + ((slider.settings.maxSlides - 1) * slider.settings.slideMargin);
                            Severity: Major
                            Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jquery.bxslider.js on lines 140..140

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 58.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                        slider.minThreshold = (slider.settings.minSlides * slider.settings.slideWidth) + ((slider.settings.minSlides - 1) * slider.settings.slideMargin);
                            Severity: Major
                            Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 1 hr to fix
                            app/assets/javascripts/jquery.bxslider.js on lines 141..141

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 58.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Similar blocks of code found in 2 locations. Consider refactoring.
                            Open

                                if cls.nil?
                                  flash.now[:error] = "Unrecognised assay type"
                                elsif !params[:label].blank? && params[:label].downcase != cls.label.downcase
                                  flash.now[:notice] = "Undefined assay type with label <b> #{params[:label]} </b>. Did you mean #{view_context.link_to(cls.label, assay_types_path(:uri=>uri, :label=> cls.label),{:style=> "font-style:italic;font-weight:bold;"})}?".html_safe
                                else
                            Severity: Major
                            Found in app/controllers/assay_types_controller.rb and 1 other location - About 1 hr to fix
                            app/controllers/technology_types_controller.rb on lines 17..23

                            Duplicated Code

                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                            Tuning

                            This issue has a mass of 52.

                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                            Refactorings

                            Further Reading

                            Severity
                            Category
                            Status
                            Source
                            Language