SysMO-DB/seek

View on GitHub
lib/acts_as_ontology_view_helper.rb

Summary

Maintainability
C
7 hrs
Test Coverage

Method indented_child_options has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

        def indented_child_options type, parent, depth=0, selected_id

          result = []
          unless parent.children.empty?
            parent.children.sort { |a, b| a.title.downcase <=> b.title.downcase }.each do |child|
Severity: Minor
Found in lib/acts_as_ontology_view_helper.rb - About 5 hrs 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 ontology_select_tag_old has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def ontology_select_tag_old form, type, root_id, element_id, selected_id=nil, html_options={}
Severity: Minor
Found in lib/acts_as_ontology_view_helper.rb - About 45 mins to fix

    Method ontology_editor_display has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

            def ontology_editor_display type, root_id=nil, selected_id=nil
    
              # login users can edit new defined assay/technology types
              # only admin can edit/delete new defined assay/technology types
              show_edit = false
    Severity: Minor
    Found in lib/acts_as_ontology_view_helper.rb - About 35 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 child_select_options has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

            def child_select_options parent, depth=0
              result = []
              unless parent.children.empty?
                parent.children.sort { |a, b| a.title.downcase <=> b.title.downcase }.each do |child|
                  result << ["---"*depth + child.title, child.id]
    Severity: Minor
    Found in lib/acts_as_ontology_view_helper.rb - About 25 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

    There are no issues that match your filters.

    Category
    Status