Showing 15 of 15 total issues
Method parse
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse
begin
OptionParser.new do |opts|
opts.banner = ' '
Method launch
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def launch
launch_sinatra_app if options[:web]
launch_signal_handler
tdb "config: #{config.to_h}" if Turnstile.config.trace
- Read upRead up
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 method_missing
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(m, *args, &block)
if redis.respond_to?(m)
t1 = Time.now
result = redis.send(m, *args, &block)
delta = Time.now - t1
- Read upRead up
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
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def parse
begin
OptionParser.new do |opts|
opts.banner = ' '
- Read upRead up
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 _logging
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _logging(level = :info, *args, &_block)
message = args.join(' ')
log(level, message) unless block_given?
return unless block_given?
- Read upRead up
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 execute!
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def execute!
exit_code = begin
Colored2.disable! unless stdout.tty?
$stderr = stderr
- Read upRead up
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 read
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def read(&_block)
file.tail do |line|
token = matcher.tokenize(line) if matcher
yield(token) if block_given? && token
break if stopping?
- Read upRead up
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 execute!
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute!
exit_code = begin
Colored2.disable! unless stdout.tty?
$stderr = stderr
Method start
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def start
self.thread = create_thread(self, sleep_when_idle) do |actor, sleep_period|
loop do
items_remaining = actor.execute
break if actor.stopping?
- Read upRead up
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 with_retries
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def with_retries(tries = 3)
yield(tries)
rescue Errno::EINVAL => e
on_error e
rescue ::Redis::BaseConnectionError => e
- Read upRead up
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 build_string
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_string(data,
joiner = "\n",
prefix = nil,
suffix = nil,
&_block)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(argv, stdin = STDIN, stdout = STDOUT, stderr = STDERR, kernel = Kernel)
Method method_missing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def method_missing(method, *args, &block)
return super unless method.to_s =~ /^redis_/
prop = method.to_s.gsub(/^redis_/, '').to_sym
if self.redis.respond_to?(prop)
prop.to_s.end_with?('=') ? self.redis.send(prop, *args, &block) : self.redis.send(prop)
- Read upRead up
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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute
self.read do |token|
self.queue << token if token
end
rescue IOError
- Read upRead up
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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(*args)
self.options = args.last.is_a?(Hash) ? args.pop : {}
options.verbose ? Turnstile::Logger.enable : Turnstile::Logger.disable
- Read upRead up
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"