piotrmurach/tenpin

View on GitHub

Showing 5 of 7 total issues

Method bowl has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

def bowl(canvas = $stdout, pins: [], power: nil, hook: nil, delay: 0.1)
i = 1
 
while i <= @distance do
angle = (hook - 50).abs
Severity: Minor
Found in lib/tenpin/bowler.rb - About 2 hrs to fix

Method run has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def run
print cursor.hide
puts cursor.clear_screen
 
pos = Position[(cols / 3) - 10, rows / 5]
Severity: Major
Found in lib/tenpin/game.rb - About 2 hrs to fix

    Method bowl has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def bowl(canvas = $stdout, pins: [], power: nil, hook: nil, delay: 0.1)
    i = 1
     
    while i <= @distance do
    angle = (hook - 50).abs
    Severity: Minor
    Found in lib/tenpin/bowler.rb - About 1 hr to fix

      Method roll has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def roll(pins)
      return if finish?
       
      current_frame_scores << pins
      @total += pins
      Severity: Minor
      Found in lib/tenpin/score.rb - About 1 hr to fix

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

      def second_roll(frame)
      scores = @score.frames[frame]
      if scores.nil?
      " "
      elsif strike?(frame)
      Severity: Minor
      Found in lib/tenpin/scoreboard.rb - About 25 mins to fix
      Severity
      Category
      Status
      Source
      Language