SysMO-DB/seek

View on GitHub

Showing 1,025 of 1,025 total issues

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

    def self.uri_for_collection(resource_name, *args)
      options = args.extract_options!
      # defaults:
      options.reverse_merge!(:params => nil)        
      
Severity: Minor
Found in lib/seek/api.rb and 1 other location - About 40 mins to fix
lib/seek/api.rb on lines 14..26

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

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 res.nil?
            permissions.can_view = res["can_view"].to_s==@@expected_true_value && state_allows_manage?(user)
            permissions.can_download = res["can_download"].to_s==@@expected_true_value && state_allows_manage?(user)
            permissions.can_edit = res["can_edit"].to_s==@@expected_true_value && state_allows_manage?(user)
            permissions.can_manage = res["can_manage"].to_s==@@expected_true_value && state_allows_manage?(user)
Severity: Major
Found in lib/seek/permissions/policy_based_authorization.rb - About 40 mins to fix

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

                    setTimeout(function(a, b) { return function() { self.hideSection(a, b); } }(id_section, cnt), self.delay.hide);
    Severity: Minor
    Found in app/assets/javascripts/dropMenu.js and 1 other location - About 40 mins to fix
    app/assets/javascripts/dropMenu.js on lines 177..177

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

    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

                setTimeout(function(a, b) { return function() { self.showSection(a, b); } } (id_section, cnt), self.delay.show);
    Severity: Minor
    Found in app/assets/javascripts/dropMenu.js and 1 other location - About 40 mins to fix
    app/assets/javascripts/dropMenu.js on lines 193..193

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

    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

    Method create_job has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def self.create_job subscribable_type, subscribable_id, old_project_ids, t=5.seconds.from_now, priority=1
    Severity: Minor
    Found in app/jobs/remove_subscriptions_for_item_job.rb - About 35 mins to fix

      Method create_job has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def self.create_job subscribable_type, subscribable_id, project_ids, t=5.seconds.from_now, priority=1
      Severity: Minor
      Found in app/jobs/set_subscriptions_for_item_job.rb - About 35 mins to fix

        Method feedback has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def feedback user,topic,details,send_anonymously,base_host
        Severity: Minor
        Found in app/models/mailer.rb - About 35 mins to fix

          Function showDataTooltip has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function showDataTooltip(prefix,pagex,pagey,valuex,valuey) {
          Severity: Minor
          Found in app/assets/javascripts/spreadsheet_explorer_plot.js - About 35 mins to fix

            Function select_cells has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function select_cells(startCol, startRow, endCol, endRow, sheetNumber) {
            Severity: Minor
            Found in app/assets/javascripts/spreadsheet_explorer.js - About 35 mins to fix

              Function performSearch has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                function performSearch(data, regexps, queries, highlighters, state) {
              Severity: Minor
              Found in doc/seek/js/searcher.js - About 35 mins to fix

                Method associate_organism has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def associate_organism(organism,strain_id=nil,culture_growth_type=nil,tissue_and_cell_type_id="0",tissue_and_cell_type_title=nil)
                Severity: Minor
                Found in app/models/assay.rb - About 35 mins to fix

                  Method authorized_list has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def authorized_list all_items, attribute, sort=true, max_length=75, count_hidden_items=false
                  Severity: Minor
                  Found in app/helpers/application_helper.rb - About 35 mins to fix

                    Method node_element has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      def node_element id, name, item_info, fave_color, border_color
                    Severity: Minor
                    Found in app/helpers/i_s_a_helper.rb - About 35 mins to fix

                      Method assay_type_select_tag has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        def assay_type_select_tag form, is_modelling,element_id, selected_uri,html_options={}
                      Severity: Minor
                      Found in app/helpers/ontology_helper.rb - About 35 mins to fix

                        Method list_samples_and_assay_organisms has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          def list_samples_and_assay_organisms attribute, assay_samples, assay_organisms, html_options={}, none_text="Not Specified"
                        Severity: Minor
                        Found in app/helpers/assays_helper.rb - About 35 mins to fix

                          Method edge_element has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            def edge_element id, name, source, target, fave_color
                          Severity: Minor
                          Found in app/helpers/i_s_a_helper.rb - About 35 mins to fix

                            Method ontology_selection_list has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              def ontology_selection_list type, element_name, selected_uri, disabled_uris={}, html_options={}
                            Severity: Minor
                            Found in app/helpers/suggested_assay_types_helper.rb - About 35 mins to fix

                              Method ontology_select_tag has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                def ontology_select_tag form,type,element_id,selected_uri,html_options={}
                              Severity: Minor
                              Found in app/helpers/ontology_helper.rb - About 35 mins to fix

                                Method assets_list_xml has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                  def assets_list_xml builder,assets,tag="assets",include_core=true,include_resource=true
                                Severity: Minor
                                Found in app/helpers/api_helper.rb - About 35 mins to fix

                                  Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                        def initialize uri,label=nil,description=nil,subclasses=[],parents=[]
                                  Severity: Minor
                                  Found in lib/seek/ontologies/ontology_class.rb - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language