Method bowl
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
def bowl(canvas = $stdout, pins: [], power: nil, hook: nil, delay: 0.1)
i = 1
while i <= @distance do
angle = (hook - 50).abs
Method run
has 66 lines of code (exceeds 25 allowed). Consider refactoring.
def run
print cursor.hide
puts cursor.clear_screen
pos = Position[(cols / 3) - 10, rows / 5]
Method bowl
has 41 lines of code (exceeds 25 allowed). Consider refactoring.
def bowl(canvas = $stdout, pins: [], power: nil, hook: nil, delay: 0.1)
i = 1
while i <= @distance do
angle = (hook - 50).abs
Method roll
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def roll(pins)
return if finish?
current_frame_scores << pins
@total += pins
Method second_roll
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def second_roll(frame)
scores = @score.frames[frame]
if scores.nil?
" "
elsif strike?(frame)