jdantonio/concurrent-ruby

View on GitHub

Showing 303 of 498 total issues

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

      def each
        return to_enum unless block_given?

        curr = @head

Severity: Minor
Found in lib/concurrent-ruby-edge/concurrent/edge/lock_free_linked_set.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 zip has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def self.zip(*promises)
      opts = promises.last.is_a?(::Hash) ? promises.pop.dup : {}
      opts[:executor] ||= ImmediateExecutor.new
      zero = if !opts.key?(:execute) || opts.delete(:execute)
        fulfill([], opts)
Severity: Minor
Found in lib/concurrent-ruby/concurrent/promise.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 get_year_end_closing has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def get_year_end_closing(symbol, year, api_key)
    uri = "https://www.alphavantage.co/query?function=TIME_SERIES_MONTHLY&symbol=#{symbol}&apikey=#{api_key}&datatype=csv"
    data = []
    csv = URI.parse(uri).read
    if csv.include?('call frequency')
Severity: Minor
Found in docs-source/future.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