pantsu/anifier

View on GitHub

Showing 4 of 4 total issues

Method append has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def append(*elements)
      elements.each do |e|
        next unless e.instance_of?(Treetop::Runtime::SyntaxNode)
        append *e.elements unless e.elements.nil?

Severity: Minor
Found in lib/api/release.rb - About 1 hr 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 create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    build_resource

    if resource.save
      if resource.active_for_authentication?
Severity: Minor
Found in app/controllers/registrations_controller.rb - About 1 hr 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 import has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def self.import(data)
    create do |release|
      data.to_hash.each do |k,v|
        if columns_hash.key?(k.to_s)
          release[k] = v
Severity: Minor
Found in app/models/release.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 parse_release has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def parse_release(entry)
    return unless release = API::Release.build(entry.title, @parser)
    release.details_url = entry.entry_id
    release.valid? ? release : nil
  rescue Exception => e
Severity: Minor
Found in lib/api/grabber.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

Severity
Category
Status
Source
Language