(action: string, data: any)
| 27 | |
| 28 | // Global function for logging (mixed with business logic) |
| 29 | function log(action: string, data: any) { |
| 30 | const timestamp = new Date().toISOString(); |
| 31 | DATABASE.logs.push({ |
| 32 | timestamp, |
| 33 | action, |
| 34 | data, |
| 35 | user: CURRENT_USER?.username || "system", |
| 36 | }); |
| 37 | console.log(`[${timestamp}] ${action}:`, data); |
| 38 | } |
| 39 | |
| 40 | class ProductManager { |
| 41 | // This class does way too much - violates SRP |
no test coverage detected