SysMO-DB/seek

View on GitHub

Showing 1,025 of 1,025 total issues

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

  def create
    if handle_upload_data
      @presentation = Presentation.new(params[:presentation])

      @presentation.policy.set_attributes_with_sharing params[:sharing], @presentation.projects
Severity: Minor
Found in app/controllers/presentations_controller.rb - About 1 hr to fix

    Method edit_tag has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def edit_tag
        if request.post?
          @tag=TextValue.find(params[:id])
          replacement_tags = []
    
    
    Severity: Minor
    Found in app/controllers/admins_controller.rb - About 1 hr to fix

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

        def create
          @publication = Publication.new(params[:publication])
          @publication.pubmed_id=nil if @publication.pubmed_id.blank?
          @publication.doi=nil if @publication.doi.blank?
          pubmed_id,doi = preprocess_doi_or_pubmed @publication.pubmed_id,@publication.doi
      Severity: Minor
      Found in app/controllers/publications_controller.rb - About 1 hr to fix

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

              case 40: //Event.KEY_DOWN:
                if (e.keyCode == 40 || e.ctrlKey) {
                  if (this.moveDown()) e.preventDefault();
                  this.startMoveTimeout(true);
                }
        Severity: Major
        Found in doc/seek/js/navigation.js and 1 other location - About 1 hr to fix
        doc/seek/js/navigation.js on lines 46..51

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

        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

              case 38: //Event.KEY_UP:
                if (e.keyCode == 38 || e.ctrlKey) {
                  if (this.moveUp()) e.preventDefault();
                  this.startMoveTimeout(false);
                }
        Severity: Major
        Found in doc/seek/js/navigation.js and 1 other location - About 1 hr to fix
        doc/seek/js/navigation.js on lines 55..60

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

        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

        Consider simplifying this complex logical expression.
        Open

                  unless sample.specimen == specimen &&
                      sample.sample_type == sample_type &&
                      (sample.tissue_and_cell_types.member?(tissue_and_cell_type) || tissue_and_cell_type_title == "") &&
                      sample.donation_date == Time.zone.parse(donation_date).utc &&
                      sample.institution == institution &&
        Severity: Critical
        Found in lib/seek/data/bio_samples.rb - About 1 hr to fix

          Function validateResourceFields has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function validateResourceFields(is_new_file, resource_name, is_managed) {
              // check if sharing rights are defined
              if (!($(document.getElementById('sharing_scope_0')).checked) &&
                  !($(document.getElementById('sharing_scope_2')).checked) &&
                  !($(document.getElementById('sharing_scope_4')).checked))
          Severity: Minor
          Found in app/assets/javascripts/resource.js - About 1 hr to fix

            Function init has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    var init = function(){
                        // merge user-supplied options with the defaults
                        slider.settings = $.extend({}, defaults, options);
                        // parse slideWidth setting
                        slider.settings.slideWidth = parseInt(slider.settings.slideWidth);
            Severity: Minor
            Found in app/assets/javascripts/jquery.bxslider.js - About 1 hr to fix

              Method list_samples_and_assay_organisms has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def list_samples_and_assay_organisms attribute, assay_samples, assay_organisms, html_options={}, none_text="Not Specified"
              
                  result= "<p class='#{html_options[:class]}' id='#{html_options[:id]}'> <b>#{attribute}</b>: "
              
                  result +="<span class='none_text'>#{none_text}</span>" if assay_samples.blank? and assay_organisms.blank?
              Severity: Minor
              Found in app/helpers/assays_helper.rb - About 1 hr to fix

                Method cytoscape_node_elements has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def cytoscape_node_elements nodes
                    cytoscape_node_elements = []
                    nodes.each do |node|
                      item_type, item_id = node.split('_')
                      item = item_type.constantize.find_by_id(item_id)
                Severity: Minor
                Found in app/helpers/i_s_a_helper.rb - About 1 hr to fix

                  Method update has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def update
                      data_file_ids = (params[:sample_data_file_ids].nil? ? [] : params[:sample_data_file_ids].reject(&:blank?)) || []
                      model_ids = (params[:sample_model_ids].nil? ? [] : params[:sample_model_ids].reject(&:blank?)) || []
                      sop_ids = (params[:sample_sop_ids].nil? ? [] : params[:sample_sop_ids].reject(&:blank?)) || []
                      @sample.attributes = params[:sample]
                  Severity: Minor
                  Found in app/controllers/samples_controller.rb - About 1 hr to fix

                    Method paginate_after_fetch has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def paginate_after_fetch(collection, *args)
                          options=args.pop unless args.nil?
                          options ||= {}
                          reorder = options[:reorder].nil? ? true : options[:reorder]
                    
                    
                    Severity: Minor
                    Found in lib/grouped_pagination.rb - About 1 hr to fix

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

                              var clickNextBind = function(e){
                                  // if auto show is running, stop it
                                  if (slider.settings.auto) el.stopAuto();
                                  el.goToNextSlide();
                                  e.preventDefault();
                      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 713..718

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

                      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

                              var clickPrevBind = function(e){
                                  // if auto show is running, stop it
                                  if (slider.settings.auto) el.stopAuto();
                                  el.goToPrevSlide();
                                  e.preventDefault();
                      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 700..705

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

                      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(document.form.plotGraphPanel.checked==true) {
                          rc.SetCurrentWidth2(cookieToArray('rc')[0]);
                          rc.SetCurrentHeight(cookieToArray('rc')[1]);
                          };
                      Severity: Major
                      Found in app/assets/javascripts/jws/JWSconstructor_panels.js and 1 other location - About 1 hr to fix
                      app/assets/javascripts/jws/JWSconstructor_panels.js on lines 233..233

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

                      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(document.form.plotKineticsPanel.checked==true) {rc2.SetCurrentWidth2(cookieToArray('rc2')[0]);rc2.SetCurrentHeight(cookieToArray('rc2')[1]);};
                      Severity: Major
                      Found in app/assets/javascripts/jws/JWSconstructor_panels.js and 1 other location - About 1 hr to fix
                      app/assets/javascripts/jws/JWSconstructor_panels.js on lines 229..232

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

                      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 onTouchEnd has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              var onTouchEnd = function(e){
                                  slider.viewport.unbind('touchmove', onTouchMove);
                                  var orig = e.originalEvent;
                                  var value = 0;
                                  // record end x, y positions
                      Severity: Minor
                      Found in app/assets/javascripts/jquery.bxslider.js - About 1 hr to fix

                        Function getViewportHeight has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                var getViewportHeight = function(){
                                    var height = 0;
                                    // first determine which children (slides) should be used in our height calculation
                                    var children = $();
                                    // if mode is not "vertical" and adaptiveHeight is false, include all children
                        Severity: Minor
                        Found in app/assets/javascripts/jquery.bxslider.js - About 1 hr to fix

                          Function updateEvents has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function updateEvents() {
                              event_text = '<ul class="related_asset_list">'
                              for (var i = 0; i < events_array.length; i++) {
                                  var event = events_array[i];
                                  var title = event[0];
                          Severity: Minor
                          Found in app/assets/javascripts/associate_events.js - About 1 hr to fix

                            Method set_attributes_with_sharing has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def set_attributes_with_sharing sharing, projects
                                # if no data about sharing is given, it should be some user (not the owner!)
                                # who is editing the asset - no need to do anything with policy / permissions: return success
                                self.tap do |policy|
                                  if sharing
                            Severity: Minor
                            Found in app/models/policy.rb - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language