SysMO-DB/seek

View on GitHub

Showing 714 of 1,025 total issues

Function imageSwapZoomIn has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function imageSwapZoomIn(curImage, newImage) {
            $(curImage).css({'opacity':'1'});
            $(newImage).css({'opacity':'0'});
            $(newImage).css({'height':'25%', 'marginLeft':'200px', 'marginTop':'105px'});
            $(curImage).css({'display':'inline'});
Severity: Minor
Found in app/assets/javascripts/scales/scales.js - About 1 hr to fix

    Method create_or_update_attributions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.create_or_update_attributions(resource, attributions_from_params, predicate = Relationship::ATTRIBUTED_TO)
    
        # added this branching on .nil? because of the danger of loosing all attributions for a model (for example) if due to an incomplete post request attributions is nil
        # the former code interpreted a nil parameter as an empty list => remove all attributions from an asset
        unless attributions_from_params.nil?
    Severity: Minor
    Found in app/models/relationship.rb - About 1 hr to fix

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

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

        Method set_runlet_parameters has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def set_runlet_parameters
        
            shared_input_values_for_all_runs = params[:sweep].delete(:shared_input_values_for_all_runs)
            params[:sweep][:runs_attributes].each_with_index do |(run_id, run_attributes), iteration_index|
              run_attributes[:workflow_id] = params[:sweep][:workflow_id]
        Severity: Minor
        Found in app/controllers/sweeps_controller.rb - About 1 hr to fix

          Method new_object_based_on_existing_one has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def new_object_based_on_existing_one
              @existing_sample =  Sample.find(params[:id])
              @sample = @existing_sample.clone_with_associations
          
              unless @sample.specimen.can_view?
          Severity: Minor
          Found in app/controllers/samples_controller.rb - About 1 hr to fix

            Method update_params_for_batch has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def update_params_for_batch(params)
                    data = []
                    data_urls = []
                    original_filenames = []
                    make_local_copy = []
            Severity: Minor
            Found in lib/seek/upload_handling/parameter_handling.rb - About 1 hr to fix

              Method url_response_code has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def url_response_code asset_url
                      url = URI.parse(URI.encode(asset_url.strip))
                      code=""
                      begin
                        if (["http","https"].include?(url.scheme))
              Severity: Minor
              Found in lib/seek/download_handling/data_download.rb - About 1 hr to fix

                Method get_compound_annotation has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def get_compound_annotation compound_name
                      url=URI.encode(webservice_base_url + "compounds?compoundName=")
                      compound_name = URI.escape(compound_name, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
                      url.concat(compound_name)
                      doc = get_xml_doc url
                Severity: Minor
                Found in lib/seek/sabiork_webservices.rb - About 1 hr to fix

                  Method fix_file_extensions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def fix_file_extensions(run)
                    Dir.mktmpdir("#{run.id}", Rails.root.join("tmp")) do |tmp_dir|
                      tmp_zip = File.join(tmp_dir, "all.zip")
                      Zip::File.open(run.results.path) do |old_zip|
                        Zip::File.open(tmp_zip, Zip::File::CREATE) do |new_zip|
                  Severity: Minor
                  Found in lib/taverna_player_callbacks.rb - About 1 hr to fix

                    Method get_contents has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def get_contents uri,user,password,recursive=false
                       
                        found=[]
                    
                        content = propfind uri,user,password,1
                    Severity: Minor
                    Found in lib/jerm/web_dav.rb - About 1 hr to fix

                      Function relativeRows has 26 lines of code (exceeds 25 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 1 hr to fix

                        Function check_show_existing_items has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function check_show_existing_items(organism_element_id, existing_items_element_id, url) {
                            var selected_ids = $F(organism_element_id).join();
                            if (selected_ids == '0') {
                                if ($(existing_items_element_id + "_spinner") != null)
                                    Effect.Fade(existing_items_element_id + "_spinner");
                        Severity: Minor
                        Found in app/assets/javascripts/biosample.js - About 1 hr to fix

                          Function additionalFieldForItem has 26 lines of code (exceeds 25 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 1 hr to fix

                            Method sharing_params_to_policy has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def sharing_params_to_policy params=params
                                  policy =Policy.new()
                                  policy.sharing_scope = params["sharing_scope"].to_i unless params[:sharing_scope].blank?
                                  policy.access_type = params[:access_type].blank? ? 0 : params["access_type"].to_i
                                  policy.use_whitelist = params["use_whitelist"] == 'true' ? true : false
                            Severity: Minor
                            Found in app/controllers/policies_controller.rb - About 1 hr to fix

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

                                def create
                                  unless params[:avatar].blank? || params[:avatar][:image_file].blank?
                                    file_specified = true
                                    
                                    # the creation of the new Avatar instance needs to have only one parameter - therefore, the rest should be set separately
                              Severity: Minor
                              Found in app/controllers/avatars_controller.rb - About 1 hr to fix

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

                                   def create
                                       unless params[:model_image].blank? || params[:model_image][:image_file].blank?
                                         file_specified = true
                                         @model_image = ModelImage.new params[:model_image]
                                         @model_image.model_id = params[:model_id]
                                Severity: Minor
                                Found in app/controllers/model_images_controller.rb - About 1 hr to fix

                                  Method detect_for_filter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def detect_for_filter(filter, resource, value)
                                      case
                                        #first the special cases
                                        when filter == 'investigation' && resource.respond_to?(:assays)
                                          resource.assays.collect { |a| a.study.investigation_id }.include? value.id
                                  Severity: Minor
                                  Found in app/controllers/application_controller.rb - About 1 hr to fix

                                    Method format_csv has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    def format_csv(output, index = [])
                                      row_limit = 500
                                      html = ''
                                    
                                      begin
                                    Severity: Minor
                                    Found in lib/taverna_player_renderers.rb - About 1 hr to fix

                                      Function dragObject has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)
                                      Severity: Major
                                      Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js - About 1 hr to fix

                                        Function dragObject has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                        function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)
                                        Severity: Major
                                        Found in app/assets/javascripts/jws/Resizeable_Container/javascript.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language