jbmeerkat/pong

View on GitHub
lib/games.rb

Summary

Maintainability
A
35 mins
Test Coverage

Showing 4 of 7 total issues

Games::Menu#draw_text has 4 parameters
Confirmed

def draw_text(text, x, y, state: :active)
Severity: Minor
Found in lib/games.rb by reek

Games::Window#button_down is controlled by argument 'id'
Confirmed

case id
Severity: Minor
Found in lib/games.rb by reek

Games::Window#button_down calls 'select_sound.play' 2 times
Confirmed

select_sound.play
when Gosu::KB_UP
menu.previous
select_sound.play
Severity: Minor
Found in lib/games.rb by reek

Games::Menu#draw_text has the parameter name 'y'
Wontfix

def draw_text(text, x, y, state: :active)
Severity: Minor
Found in lib/games.rb by reek

Games::Menu#draw_centered has the parameter name 'y'
Wontfix

def draw_centered(text, y, state: :active)
Severity: Minor
Found in lib/games.rb by reek

Games::Menu#draw_text has the parameter name 'x'
Wontfix

def draw_text(text, x, y, state: :active)
Severity: Minor
Found in lib/games.rb by reek

Similar blocks of code found in 2 locations. Consider refactoring.
Confirmed

def draw_header
font = Gosu::Font.new(80, name: FONT_PATH)
text = 'Old school games'
x = (width / 2) - (font.text_width(text) / 2)
 
 
Severity: Minor
Found in lib/games.rb and 1 other location - About 35 mins to fix
lib/pong/menu_window.rb on lines 32..37
Category
Status