SysMO-DB/seek

View on GitHub

Showing 1,025 of 1,025 total issues

Method image_tag_for_key has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def image_tag_for_key(key, url=nil, alt=nil, html_options={}, label=key.humanize, remote=false, size=nil)
Severity: Major
Found in app/helpers/images_helper.rb - About 50 mins to fix

    Method generate_triples has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def generate_triples subject, method, property,uri_or_literal,transformation,collection_transform,rdf_graph
    Severity: Major
    Found in lib/seek/rdf/rdf_generation.rb - About 50 mins to fix

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

          if session[possible_unsaved_data]
            # if user was redirected to this 'edit' page from avatar upload page - use session
            # data; alternatively, user has followed some other route - hence, unsaved session
            # data is most probably not relevant anymore
            if params[:use_unsaved_session_data]
      Severity: Minor
      Found in app/controllers/projects_controller.rb and 1 other location - About 50 mins to fix
      app/controllers/projects_controller.rb on lines 137..159

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

      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

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

          if session[possible_unsaved_data]
            # if user was redirected to this 'edit' page from avatar upload page - use session
            # data; alternatively, user has followed some other route - hence, unsaved session
            # data is most probably not relevant anymore
            if params[:use_unsaved_session_data]
      Severity: Minor
      Found in app/controllers/projects_controller.rb and 1 other location - About 50 mins to fix
      app/controllers/projects_controller.rb on lines 107..129

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

      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 project_role_list person
          unless person.project_roles.empty?
            text=""
            person.project_roles.each do |r|
              text += link_to(h(r.title),people_path(:project_role_id=>r.id))
      Severity: Minor
      Found in app/helpers/people_helper.rb and 1 other location - About 50 mins to fix
      app/helpers/people_helper.rb on lines 31..41

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

      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 discipline_list person
          unless person.disciplines.empty?
            text=""
            person.disciplines.each do |d|
              text += link_to(h(d.title),people_path(:discipline_id=>d.id))
      Severity: Minor
      Found in app/helpers/people_helper.rb and 1 other location - About 50 mins to fix
      app/helpers/people_helper.rb on lines 44..54

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

      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.settings.onSlideBefore(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
      Severity: Minor
      Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 50 mins to fix
      app/assets/javascripts/jquery.bxslider.js on lines 804..804

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

      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.settings.onSlideAfter(slider.children.eq(slider.active.index), slider.oldIndex, slider.active.index);
      Severity: Minor
      Found in app/assets/javascripts/jquery.bxslider.js and 1 other location - About 50 mins to fix
      app/assets/javascripts/jquery.bxslider.js on lines 1113..1113

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

      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 deactivate_previous_tab has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function deactivate_previous_tab(tab_element){
              var previous_active_tab = tab_element.up("ul.tabbernav").getElementsByClassName('tabberactive')[0];
              previous_active_tab.className = '';
              //Then hide the content of the tab
              var scale_and_type = previous_active_tab.childNodes[0].className;
      Severity: Minor
      Found in app/assets/javascripts/tab_lazy_load.js - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function updateDataFiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function updateDataFiles() {
          data_file_text='<ul class="related_asset_list">'
          
          for (var i=0;i<data_files_assets.length;i++) {        
              data_file=data_files_assets[i];
      Severity: Minor
      Found in app/assets/javascripts/assays.js - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function updatePublications has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function updatePublications() {
          publication_text='<ul class="related_asset_list">'
          
          for (var i=0;i<publication_array.length;i++) {        
              publication=publication_array[i];
      Severity: Minor
      Found in app/assets/javascripts/publication.js - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function checkItem has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      function checkItem(id, source, resource_type) {
          if (source == "target") {
              if (allLinks[resource_type][id] == true){
                  checkedTargetMap[resource_type][id] = false;
                  allLinks[resource_type][id] = false;
      Severity: Minor
      Found in app/assets/javascripts/link_adder.js - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method to_presentation has a Cognitive Complexity of 8 (exceeds 5 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 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function annotation has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function annotation(id, type, sheet_number, cell_range, content, date_created) {
      Severity: Minor
      Found in app/assets/javascripts/spreadsheet_explorer.js - About 45 mins to fix

        Method deep_parse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def deep_parse(types, output, zip, index = [])
            content = "<ol>"
            i = 0
            types.each do |type|
              if type.is_a?(Array)
        Severity: Minor
        Found in app/helpers/result_helper.rb - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method studies_link_list has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def studies_link_list studies,sorted=true
            #FIXME: make more generic and share with other model link list helper methods
            studies=studies.select{|s| !s.nil?} #remove nil items
            return "<span class='none_text'>Not associated with any #{t('study').pluralize}</span>".html_safe if studies.empty?
        
        
        Severity: Minor
        Found in app/helpers/studies_helper.rb - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method list_item_with_icon has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def list_item_with_icon(icon_type, item, caption, truncate_to, custom_tooltip=nil, size=nil)
        Severity: Minor
        Found in app/helpers/application_helper.rb - About 45 mins to fix

          Method policy_and_permissions_for_public_scope has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def policy_and_permissions_for_public_scope(policy, permissions, privileged_people, resource_name, updated_can_publish_immediately, send_request_publish_approval)
          Severity: Minor
          Found in app/helpers/policy_helper.rb - About 45 mins to fix

            Method related_items_method has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def related_items_method(resource, item_type)
                if item_type == "TavernaPlayer::Run"
                  method_name = 'runs'
                else
                  method_name = item_type.underscore.pluralize
            Severity: Minor
            Found in app/helpers/assets_helper.rb - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method cytoscape_edge_elements has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

              def cytoscape_edge_elements edges
                cytoscape_edge_elements = []
                edges.each do |edge|
                  source, target = edge.split('--')
                  source.strip!
            Severity: Minor
            Found in app/helpers/i_s_a_helper.rb - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Severity
            Category
            Status
            Source
            Language