Projectile Factory + Copy/Paste Detector

Controls

Mode: Before (Copy/Paste)
Duplication score
Why this matters
In Before, Laser/FireBall/Missile repeat the same logic (copy/paste).

In After, shared behavior moves into Projectile and subclasses only specify what’s different.
duplicated line
unique line

Inheritance Tree (After)

Switch to “After” to view.

Live Demo + Code Comparison

Code shown is Java-like pseudocode (teaching artifact)
Laser
FireBall
Missile