jbmeerkat/pong

View on GitHub

Showing 28 of 32 total issues

Pong::GameWindow#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/game_window.rb by reek

ECS::World assumes too much for instance variable '@elapsed_time'
Open

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

ECS::World assumes too much for instance variable '@times_called'
Open

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

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

module Systems
# Basic movement system
class RightRacketControl < ECS::System
watch_components :right_racket, :velocity
run_on :update
Severity: Minor
Found in lib/pong/systems/right_racket_control.rb and 1 other location - About 35 mins to fix
lib/pong/systems/left_racket_control.rb on lines 4..19

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

module Systems
# Basic movement system
class LeftRacketControl < ECS::System
watch_components :left_racket, :velocity
run_on :update
Severity: Minor
Found in lib/pong/systems/left_racket_control.rb and 1 other location - About 35 mins to fix
lib/pong/systems/right_racket_control.rb on lines 4..19

Pong::Systems::Movement takes parameters ['rectangle', 'velocity'] to 3 methods
Open

def process_entity(_entity, velocity, rectangle)
delta_sec = world.time_delta / 1000.0
position = rectangle.position
 
position.x += (velocity.x * delta_sec).round
Severity: Minor
Found in lib/pong/systems/movement.rb by reek

Pong::MenuWindow#milliseconds_elapsed doesn't depend on instance state (maybe move it to another class?)
Open

def milliseconds_elapsed
Severity: Minor
Found in lib/pong/menu_window.rb by reek

Complex method Pong::SetupWorld#create_ball (20.3)
Open

def create_ball
ball = world.create_entity(:ball)
width = world.width
height = world.height
 
 
Severity: Minor
Found in lib/pong/setup_world.rb by flog
Severity
Category
Status
Source
Language