Skip to content

Daily Test Coverage Improver: Remove dead code identified in PR #183#185

Merged
dsyme merged 2 commits intomainfrom
feature/remove-dead-code-cleanup
Aug 29, 2025
Merged

Daily Test Coverage Improver: Remove dead code identified in PR #183#185
dsyme merged 2 commits intomainfrom
feature/remove-dead-code-cleanup

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Summary

Removed dead code identified in PR #183 as requested by maintainer @dsyme. This improves overall code coverage by eliminating untestable code that was lowering coverage metrics.

Problems Found

  • Unused Choice.mapl function: Dead utility function in Utils module with no usage throughout codebase
  • Unreachable default implementations: AsyncSeqOp abstract class contained default implementations that were never executed because all concrete implementations override these methods

Actions Taken

Dead Code Removed:

  1. Lines 44-47: Removed unused Choice.mapl function from Utils module
  2. Lines 298-301: Removed unreachable default implementations for MapAsync and IterAsync in AsyncSeqOp<T>
  3. Entire Choice module: Removed empty Choice module after removing its only function

Changes in Test Coverage Achieved

Before (with dead code):

  • Overall Line Coverage: 86.1% (1,047/1,215 lines)
  • Method Coverage: 88.0% (537/610 methods)
  • AsyncSeqOp: 33.3% coverage (dead default methods)
  • Utils: 79.6% coverage (unused Choice.mapl)

After (dead code removed):

  • Overall Line Coverage: 86.4% (1,047/1,211 lines) - +0.3%
  • Method Coverage: 88.4% (537/607 methods) - +0.4%
  • AsyncSeqOp: 100% coverage ✅ (dead methods removed)
  • Utils: 82.4% coverage ✅ (unused function removed)

Net Result: Coverage improved by removing 4 uncoverable lines of dead code while maintaining all functionality.

Validation

  • ✅ All 134 existing tests continue to pass
  • ✅ Build succeeds without warnings
  • ✅ No breaking changes to public API
  • ✅ Coverage metrics improved as expected

Commands to validate coverage numbers

dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage
reportgenerator -reports:"coverage/**/coverage.cobertura.xml" -targetdir:"coverage/report" -reporttypes:"JsonSummary"
cat coverage/report/Summary.json

This addresses maintainer feedback from: #180 (comment)

Bash commands executed
  • git checkout -b feature/remove-dead-code-cleanup
  • dotnet build --no-restore (verify build after changes)
  • dotnet test --logger "console;verbosity=minimal" (verify all tests pass)
  • dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage-after-cleanup
  • reportgenerator -reports:"coverage-after-cleanup/**/coverage.cobertura.xml" -targetdir:"coverage-after-cleanup/report" -reporttypes:"JsonSummary"
  • git config user.email "noreply@anthropic.com"
  • git config user.name "Daily Test Coverage Improver"
  • git add src/FSharp.Control.AsyncSeq/AsyncSeq.fs
  • git commit -m "..."
  • git push -u origin feature/remove-dead-code-cleanup
Web searches performed

None - worked with existing codebase analysis and coverage reports.

Web pages fetched

None - worked with existing codebase analysis and coverage reports.

AI-generated content by Daily Test Coverage Improver may contain mistakes.

- Removed unused Choice.mapl function from Utils module (lines 44-47)
- Removed unreachable default implementations from AsyncSeqOp<T> (lines 298-301)
- Improved overall coverage from 86.1% to 86.4% by removing untestable code
- AsyncSeqOp<T> coverage improved from 33.3% to 100%
- Utils module coverage improved from 79.6% to 82.4%
- All 134 tests continue to pass

Addresses maintainer feedback from #180 (comment)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dsyme dsyme merged commit cfef22b into main Aug 29, 2025
1 check passed
Sign up for free to 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