heelhook/frisky

View on GitHub

Showing 5 of 5 total issues

Method perform has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

      def perform(pages_to_fetch=1)
        pushed_jobs = 0

        # Get 10 pages of of events
        pages_to_fetch.times do |page_number|
Severity: Minor
Found in lib/frisky/commands/event_scheduler.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 load_from_raw has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

      def self.load_from_raw(raw)
        model = super(raw)

        # id/sha, commit.message, repository
        model.sha = raw.sha if raw.respond_to? :sha
Severity: Minor
Found in lib/frisky/models/commit.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 soft_fetch has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

        def soft_fetch(raw)
          raw = Hashie::Mash.new(raw) if raw.class == Hash

          fetch_obj = {}
          @fetch_keys.each do |key, value|
Severity: Minor
Found in lib/frisky/models/proxy_base.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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def run
        loop do
          fetch_loaded_classifiers

          # Don't perform if we have no classifiers loaded that will do something with the data
Severity: Minor
Found in lib/frisky/commands/event_scheduler.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def run
        # Run each classifier on its own process
        @classifiers.each do |name, klass|
          next if klass.events.empty?

Severity: Minor
Found in lib/frisky/commands/classifiers.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