SysMO-DB/seek

View on GitHub

Showing 1,025 of 1,025 total issues

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

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

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

      def to_presentation
        presentation_attrs = attributes.delete_if { |k, v| !(::Presentation.new.attributes.include?(k))}
    
        Presentation.new(presentation_attrs).tap do |presentation|
          DataFile.reflect_on_all_associations.select { |a| [:has_many, :has_and_belongs_to_many, :has_one].include?(a.macro) && !a.through_reflection }.each do |a|
    Severity: Minor
    Found in app/models/data_file.rb - About 1 hr to fix

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

          tipShow : function() {        
              var scrX = Number(this.xCord);
              var scrY = Number(this.yCord);
              var tp = parseInt(scrY+15);
              var lt = parseInt(scrX+10);
      Severity: Minor
      Found in app/assets/javascripts/jws/sweetTitles.js - About 1 hr to fix

        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 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 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 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 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 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

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

                              this.SetCurrentWidth2 = function(value)
                              {
                                value = parseInt(value);
                                if(isNaN(value))
                                  value = 0;
                            app/assets/javascripts/jws/Resizeable_Container/javascript.js on lines 558..567
                            app/assets/javascripts/jws/Resizeable_Textbox/javascript.js on lines 533..542
                            app/assets/javascripts/jws/Resizeable_Textbox/javascript.js on lines 568..577

                            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 56.

                            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 4 locations. Consider refactoring.
                            Open

                              this.SetCurrentHeight = function(value)
                              {
                                value = parseInt(value);
                                if(isNaN(value))
                                  value = 0;
                            app/assets/javascripts/jws/Resizeable_Container/javascript.js on lines 523..532
                            app/assets/javascripts/jws/Resizeable_Textbox/javascript.js on lines 533..542
                            app/assets/javascripts/jws/Resizeable_Textbox/javascript.js on lines 568..577

                            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 56.

                            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 4 locations. Consider refactoring.
                            Open

                              this.SetCurrentHeight = function(value)
                              {
                                value = parseInt(value);
                                if(isNaN(value))
                                  value = 0;
                            app/assets/javascripts/jws/Resizeable_Container/javascript.js on lines 523..532
                            app/assets/javascripts/jws/Resizeable_Container/javascript.js on lines 558..567
                            app/assets/javascripts/jws/Resizeable_Textbox/javascript.js on lines 533..542

                            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 56.

                            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 4 locations. Consider refactoring.
                            Open

                              this.SetCurrentWidth = function(value)
                              {
                                value = parseInt(value);
                                if(isNaN(value))
                                  value = 0;
                            app/assets/javascripts/jws/Resizeable_Container/javascript.js on lines 523..532
                            app/assets/javascripts/jws/Resizeable_Container/javascript.js on lines 558..567
                            app/assets/javascripts/jws/Resizeable_Textbox/javascript.js on lines 568..577

                            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 56.

                            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 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

                              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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language