Files
helia/todos/005-completed-p3-code-cleanup.md
Santiago Martinez-Avial 5ef0fc0ccc DEL
2025-12-22 18:46:58 +01:00

70 lines
1.8 KiB
Markdown

---
status: pending
priority: p3
issue_id: "005"
tags: ["cleanup", "quality", "python"]
dependencies: []
---
# General Code Quality Cleanup
Address various code quality issues including unused arguments, type ignores, and list optimizations.
## Problem Statement
Multiple reviewers identified smaller code quality issues that accumulate to technical debt. These include unused arguments in `workflow.py`, specific type ignores in `db.py`, and list comprehension optimizations in `core.py`.
## Findings
1. **`src/helia/assessment/core.py`**:
- Optimize list comprehension.
2. **`src/helia/agent/workflow.py`**:
- Rename unused `state` arguments to `_state`.
3. **`src/helia/assessment/core.py`**:
- Use dependency injection for `PHQ8Evaluator`.
4. **`src/helia/db.py`**:
- PGH003: Narrow `type: ignore` to `type: ignore[arg-type]`.
5. **General**:
- Recommends generator expression for join operations.
## Proposed Solutions
### Option 1: Batch Cleanup
**Approach:** Go through each file and apply the specific fix.
**Pros:**
- Cleans up "broken windows".
- Improves linting scores.
## Recommended Action
**To be filled during triage.**
## Technical Details
**Affected files:**
- `src/helia/assessment/core.py`
- `src/helia/agent/workflow.py`
- `src/helia/db.py`
## Resources
- **Source:** Kieran Python Reviewer, Security Sentinel, Pattern Recognition Specialist
## Acceptance Criteria
- [ ] `src/helia/assessment/core.py`: List comprehension optimized.
- [ ] `src/helia/agent/workflow.py`: Unused args renamed to `_state`.
- [ ] `src/helia/db.py`: `type: ignore` narrowed.
- [ ] `src/helia/assessment/core.py`: Dependency injection pattern reviewed/applied.
## Work Log
### 2025-12-20 - Initial Creation
**By:** Claude Code
**Actions:**
- Created todo based on aggregated code review findings.