Add demo-03: CSV data processor with intentional code smells
- Add employee_data_processor.py: functional but ugly code with god function, globals, hardcoded values, mixed concerns - Add employees.csv: sample data with 10 records (4 invalid for testing) - Generates report.json and report.html output files - Perfect candidate for refactoring demo
This commit is contained in:
parent
ae8c09013c
commit
2f2be8e1a0
4 changed files with 265 additions and 0 deletions
1
demo-03/report.html
Normal file
1
demo-03/report.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<html><head><title>Employee Report</title></head><body><h1>Employee Data Report</h1><h2>Summary</h2><ul><li>Total Employees: 6</li><li>Skipped Records: 4</li><li>Total Annual Payroll: $3,984,000</li></ul><h2>Employees by Department</h2><ul><li>Engineering: 2</li><li>Human Resources: 2</li><li>Sales: 1</li><li>Marketing: 1</li></ul><h2>Employee Details</h2><table border='1' cellpadding='5'><tr><th>Name</th><th>Email</th><th>Department</th><th>Annual Salary</th><th>Hire Date</th><th>Years Exp</th></tr><tr><td>Alice Smith</td><td>alice@example.com</td><td>Engineering</td><td>$900,000</td><td>2023-01-15</td><td>3.0</td></tr><tr><td>Diana Prince</td><td>diana@example.com</td><td>Engineering</td><td>$984,000</td><td>2022-05-20</td><td>3.66</td></tr><tr><td>Eve Wilson</td><td>eve@example.com</td><td>Human Resources</td><td>$696,000</td><td>2023-04-10</td><td>2.77</td></tr><tr><td>Grace Lee</td><td>grace@example.com</td><td>Sales</td><td>$0</td><td>2023-06-01</td><td>2.63</td></tr><tr><td>Ivy Chen</td><td>ivy@example.com</td><td>Marketing</td><td>$744,000</td><td>2023-07-15</td><td>2.51</td></tr><tr><td>Jack Brown</td><td>jack@example.com</td><td>Human Resources</td><td>$660,000</td><td>2023-08-01</td><td>2.46</td></tr></table><h2>Skipped Records</h2><ul><li>Bob Jones: Negative salary</li><li>Charlie: Invalid email</li><li>Frank Miller: Invalid department</li><li>Henry Davis: Invalid hire_date</li></ul></body></html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue