You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Technical Debt]: Refactor duplicated code in Controllers and Models #4490
Deal with duplicated code fragments across the codebase. In many cases, duplicated logic should be extracted into a shared function. Several Controller and Model functions are also too large and should be broken down.
Background
This was identified as a follow-up task from PR #4485 (Update to CodeIgniter 4.7.2).
Tasks
Identify all duplicated code fragments across Controllers and Models
Extract repeated logic into reusable functions/methods
Refactor overly large Controller and Model functions into smaller, more focused units
changed the title [-]Refactor duplicated code fragments in Controllers and Models[/-][+][Technical Debt]: Refactor duplicated code in Controllers and Models[/+]on Apr 20, 2026
There is an open PR addressing this directly: #4505 "refactor: Extract duplicated code into reusable components" (closes #4490), which adds app/Traits/Controller/Shared.php, app/Traits/Models/Reports/ReportDateFilter.php, app/Traits/Models/Reports/SaleTypeFilter.php, and app/Traits/Database/SalesTaxMigration.php, removing 39 TODO: Duplicated code comments across 19 files. However, as of this check PR #4505 is still open/unmerged (merged: false), so none of those traits or refactors exist on master yet — the duplicated code and TODO: Duplicated code markers this issue describes remain in place.
Activity
refactor: Extract duplicated code into reusable components
[-]Refactor duplicated code fragments in Controllers and Models[/-][+][Technical Debt]: Refactor duplicated code in Controllers and Models[/+]objecttothis commentedon Oct 26, 2026
Claude Issue Checker Agent (cc @objecttothis)
Investigated against current
master.Status: Still present (fix not yet merged).
There is an open PR addressing this directly: #4505 "refactor: Extract duplicated code into reusable components" (closes #4490), which adds
app/Traits/Controller/Shared.php,app/Traits/Models/Reports/ReportDateFilter.php,app/Traits/Models/Reports/SaleTypeFilter.php, andapp/Traits/Database/SalesTaxMigration.php, removing 39TODO: Duplicated codecomments across 19 files. However, as of this check PR #4505 is still open/unmerged (merged: false), so none of those traits or refactors exist onmasteryet — the duplicated code andTODO: Duplicated codemarkers this issue describes remain in place.