sshaw/itunes_store_transporter_web

View on GitHub

Showing 23 of 23 total issues

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

  def file_browser_field(name, options = {})
    prompt = options.delete(:prompt) || "Select #{name.to_s.titleize}"

    value = object.send(name)
    options[:value] = File.basename(value) if value
Severity: Minor
Found in lib/transporter_form_builder.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 as_json has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def as_json(options = nil)
    return super if options

    json = super(:except => [:job_id, :target, :output_log_file])
    if json["options"]
Severity: Minor
Found in models/transporter_job.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 ls has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def ls(path, options = {})
    roots = options[:root] ? Array(options[:root]) : root_directory
    return roots if path.to_s.empty?

    # Make sure path starts with one of the roots, checking the longest one first.
Severity: Minor
Found in lib/fs_util.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