Skip to content

Clean up tech debt: remove dead code, fix SQL injection - #12

Draft
mpchenette with Copilot wants to merge 2 commits into
mainfrom
copilot/cleanup-code-structure
Draft

Clean up tech debt: remove dead code, fix SQL injection#12
mpchenette with Copilot wants to merge 2 commits into
mainfrom
copilot/cleanup-code-structure

Conversation

CopilotAI commented Nov 25, 2025

Copy link
Copy Markdown

Repository-wide cleanup to eliminate unused code and fix a critical SQL injection vulnerability.

Removed Dead Code

  • Empty files: python/point.py, python/tests/test_calculator.py, terraform/iac.tf (and their empty parent directories)
  • Unused imports: System.IO, Microsoft.Extensions.FileProviders from DotnetApp/Program.cs; os, re, defaultdict from scripts/report_bofa_emu_versions.py

Security Fix

Fixed SQL injection in python/sql.py by converting string concatenation to parameterized queries:

# Before (vulnerable)query="SELECT * FROM users WHERE username = '"+username+"'"cursor.execute(query)
# After (safe)query="SELECT * FROM users WHERE username = %s"cursor.execute(query, (username,))

Also fixed broken add_user() function where mysql.connector.connect was missing call parentheses.

Module Completion

  • Added rust/tcp.rs to provide the missing module referenced by server.rs (std-only per repo conventions)
Original prompt

Go clean up my code

Custom agent used: Janitor
Perform janitorial tasks on any codebase including cleanup, simplification, and tech debt remediation.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…njection
Co-authored-by: mpchenette <98562887+mpchenette@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate FailedQuality Gate failed

Failed conditions
E Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

CopilotAI changed the title [WIP] Clean up code for improved readabilityClean up tech debt: remove dead code, fix SQL injectionNov 25, 2025
CopilotAI requested a review from mpchenetteNovember 25, 2025 20:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mpchenette