strongqa/howitzer

View on GitHub

Showing 5 of 36 total issues

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

def w3c_selenium_browserstack_caps # rubocop:disable Metrics/AbcSize
  caps = CapybaraHelpers.required_w3c_cloud_caps
  caps[:platformName] = Howitzer.cloud_platform unless Howitzer.cloud_platform.casecmp?('any')
  tb_options = {
    name: "#{(Howitzer.current_rake_task || 'ALL').upcase} #{Howitzer.cloud_browser_name}",
Severity: Minor
Found in generators/config/templates/drivers/testingbot.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 w3c_selenium_browserstack_caps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def w3c_selenium_browserstack_caps # rubocop:disable Metrics/AbcSize
  caps = CapybaraHelpers.required_w3c_cloud_caps
  bstack_options = {
    sessionName: "#{(Howitzer.current_rake_task || 'ALL').upcase} #{Howitzer.cloud_browser_name}",
    projectName: Howitzer.cloud_bstack_project,
Severity: Minor
Found in generators/config/templates/drivers/browserstack.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 w3c_selenium_browserstack_caps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def w3c_selenium_browserstack_caps # rubocop:disable Metrics/AbcSize
  caps = CapybaraHelpers.required_w3c_cloud_caps
  caps['platform'] = Howitzer.cloud_platform unless Howitzer.cloud_platform.casecmp?('any')
  sauce_options = {
    name: "#{(Howitzer.current_rake_task || 'ALL').upcase} #{Howitzer.cloud_browser_name}",
Severity: Minor
Found in generators/config/templates/drivers/sauce.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 validate_by_element_presence has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def validate_by_element_presence(element_name, *args, **options)
          validations[:element_presence] =
            lambda do |web_page, sync|
              if element_name.present? && !private_method_defined?("#{element_name}_element")
                raise(Howitzer::UndefinedElementError, ':element_presence validation refers to ' \
Severity: Minor
Found in lib/howitzer/web/page_validator.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 classic_selenium_browserstack_caps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def classic_selenium_browserstack_caps # rubocop:disable Metrics/AbcSize
  caps = CapybaraHelpers.required_cloud_caps.merge(
    project: Howitzer.cloud_bstack_project,
    build: Howitzer.cloud_bstack_build
  )
Severity: Minor
Found in generators/config/templates/drivers/browserstack.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