convio/watirmark

View on GitHub

Showing 25 of 25 total issues

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

    def search_for_record
      if @search
        search_controller = @search.new(@supermodel)
        if search_controller.respond_to?(:current_record_visible?)
          return if search_controller.current_record_visible?
Severity: Minor
Found in lib/watirmark/controller/actions.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

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

    def active?
      page = active_page
      return true if in_submenu(page, underscored_name)
      aliases.each { |a| return true if in_submenu(page, underscored_name(a)) } unless aliases.empty?
      false
Severity: Minor
Found in lib/watirmark/page/process_page.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

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

        def inherited(klass)
          klass.view ||= @view if @view
          klass.model ||= @model if @model
          klass.search ||= @search if @search
        end
Severity: Minor
Found in lib/watirmark/controller/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

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

    def compare_values(element, expected, actual)
      if Matcher.exists?(expected)
        fail(element, expected, actual) unless Matcher.matches?(element, expected, actual)
      else
        fail(element, expected, actual) unless matches?(expected, actual)
Severity: Minor
Found in lib/watirmark/controller/assertions.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

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

    def autoload_files(directory)
      mod = "Watirmark::#{product}"
      each_file_in directory do |file|
        libpath = library_path(file)
        IO.readlines(file).each do |line|
Severity: Minor
Found in lib/watirmark/loader.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

Severity
Category
Status
Source
Language