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
Pattern: The signal-handler test suite and a targeted branch-coverage test independently define the same Promise flush helper, process signal-handler registry, and Jest spies with matching beforeEach/afterEach lifecycle setup.
Locations: src/commands/signal-handler.test.ts:7-30 and src/coverage-branch-gaps-3.test.ts:20-42.
Impact: 24 duplicated lines; changes to signal registration mocking, spy cleanup, or handler storage must be maintained in two suites. This is an easy test-infrastructure extraction, and the duplicated setup directly exercises process signal and cleanup behavior.
Extract a shared signal-handler Jest fixture/helper containing flushPromises, handler capture, process/console spies, and teardown. Import it from both suites, allowing each test to retain only scenario-specific setup and assertions.
A related completed detector issue tracked overlapping signal-handler test cleanup scenarios: #5655. This finding concerns the duplicated cross-file mocking fixture and should be reassessed against that implementation.
Affected Files
src/commands/signal-handler.test.ts — lines 7-30
src/coverage-branch-gaps-3.test.ts — lines 20-42
Effort Estimate
Low
Detected by Duplicate Code Detector workflow. Run date: 2026-07-12
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
awmgmcpg
To allow these domains, add them to the network.allowed list in your workflow frontmatter:
Duplicate Code Opportunity
Summary
src/commands/signal-handler.test.ts:7-30andsrc/coverage-branch-gaps-3.test.ts:20-42.Evidence
src/commands/signal-handler.test.ts:7-30:src/coverage-branch-gaps-3.test.ts:20-42repeats the same structure:Suggested Refactoring
Extract a shared signal-handler Jest fixture/helper containing
flushPromises, handler capture, process/console spies, and teardown. Import it from both suites, allowing each test to retain only scenario-specific setup and assertions.A related completed detector issue tracked overlapping signal-handler test cleanup scenarios: #5655. This finding concerns the duplicated cross-file mocking fixture and should be reassessed against that implementation.
Affected Files
src/commands/signal-handler.test.ts— lines 7-30src/coverage-branch-gaps-3.test.ts— lines 20-42Effort Estimate
Low
Detected by Duplicate Code Detector workflow. Run date: 2026-07-12
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
awmgmcpgSee Network Configuration for more information.