team-umlaut/umlaut

View on GitHub
app/controllers/resolve_controller.rb

Summary

Maintainability
B
4 hrs
Test Coverage

Method should_skip_menu has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

  def should_skip_menu
    # From usabilty test, do NOT skip if coming from A-Z list/journal lookup.
    # First, is it over-ridden in url?
    if ( params['umlaut.skip_resolve_menu'] == 'false')
      return nil
Severity: Minor
Found in app/controllers/resolve_controller.rb - About 3 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 should_skip_menu has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def should_skip_menu
    # From usabilty test, do NOT skip if coming from A-Z list/journal lookup.
    # First, is it over-ridden in url?
    if ( params['umlaut.skip_resolve_menu'] == 'false')
      return nil
Severity: Minor
Found in app/controllers/resolve_controller.rb - About 1 hr to fix

    Method init_processing has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

      def init_processing    
        # intentionally trigger creation of session if it didn't already exist
        # because we need to track session ID for caching. Can't find any
        # way to force session creation without setting a value in session,
        # so we do this weird one.
    Severity: Minor
    Found in app/controllers/resolve_controller.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