jbmeerkat/pong

View on GitHub

Showing 28 of 32 total issues

Complex method Pong::SetupWorld#call (34.2)
Open

def call
create_net
 
create_player(:left)
create_player(:right)
Severity: Minor
Found in lib/pong/setup_world.rb by flog

Complex method Pong::Systems::Ball#rectangle_collision? (29.5)
Open

def rectangle_collision?(first, second) # rubocop:disable Metrics/AbcSize
first.x < second.x + second.width &&
first.x + first.width > second.x &&
first.y < second.y + second.height &&
first.y + first.height > second.y
Severity: Minor
Found in lib/pong/systems/ball.rb by flog

Pong::SetupWorld#racket_x is controlled by argument 'side'
Open

case side
Severity: Minor
Found in lib/pong/setup_world.rb by reek

ECS::World#add_system has approx 7 statements
Open

def add_system(system)
Severity: Minor
Found in lib/ecs/world.rb by reek

ECS::EntityRegistry#create_entity has approx 7 statements
Open

def create_entity(tag = nil)
Severity: Minor
Found in lib/ecs/entity_registry.rb by reek

ECS::World has at least 7 instance variables
Open

class World
Severity: Minor
Found in lib/ecs/world.rb by reek

TZInfo relative path traversal vulnerability allows loading of arbitrary files
Open

tzinfo (1.2.7)
Severity: Critical
Found in Gemfile.lock by bundler-audit

ECS::World#registry_for is controlled by argument 'step'
Open

case step
Severity: Minor
Found in lib/ecs/world.rb by reek

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

Pong::Game has at least 6 instance variables
Open

class Game
Severity: Minor
Found in lib/pong/game.rb by reek

ReDoS based DoS vulnerability in Active Support’s underscore
Open

activesupport (5.2.4.3)
Severity: Minor
Found in Gemfile.lock by bundler-audit

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

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

Pong::MenuWindow#draw_info refers to 'font' more than self (maybe move it to another class?)
Open

x = (width / 2) - (font.text_width(text) / 2)
font.draw_text(text, x, height - font.height, 1, 1.0, 1.0,
Severity: Minor
Found in lib/pong/menu_window.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

Pong::MenuWindow#initialize calls 'game.config' 3 times
Open

width = game.config.window_width
height = game.config.window_height
 
super width, height
 
 
Severity: Minor
Found in lib/pong/menu_window.rb by reek

Pong::Systems::Ball#collides_with_horizontal_bounds? calls 'rectangle.y' 2 times
Open

rectangle.y + rectangle.height > world.height || rectangle.y.negative?
Severity: Minor
Found in lib/pong/systems/ball.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 = 'Pong'
x = (width / 2) - (font.text_width(text) / 2)
 
 
Severity: Minor
Found in lib/pong/menu_window.rb and 1 other location - About 35 mins to fix
lib/games.rb on lines 52..57

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

Pong::Systems::Movement#process_collision calls 'velocity.y = 0' 2 times
Open

velocity.y = 0
elsif crossing_lower_bound?(rectangle)
position.y = world.height - rectangle.height
velocity.y = 0
Severity: Minor
Found in lib/pong/systems/movement.rb by reek

Pong::Systems::RenderNet#process_entity calls 'net.section_length' 2 times
Open

index * net.section_length * 2,
net.section_width,
net.section_length,
Severity: Minor
Found in lib/pong/systems/render_net.rb by reek
Severity
Category
Status
Source
Language