Repository navigation
Remove Unreachable Branches and Unused Members Found by Coverage - #1189
Conversation
The coverage work found code no input reaches. The language lookup returns "und" for an unknown tag and never an empty string, so the empty-lookup branches in TrackProps.SetLanguage never ran, and SetLanguage never failed. The builder seek, metadata, format, and input overloads, the unused LogFailedResult overload, the string overloads of SidecarFile.IsSidecarFile and GetMkvName, MediaProps.RemoveCoverArt, and TrackProps.GetFlags() have no caller. Behavior is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GetIsoFromIetf returns null for an IETF tag whose ISO 639-3 language has no ISO 639-2 code, such as pcm, so its empty-result branches do run. Only GetIetfFromIso always returns a value. Restore the two ISO branches and cover them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
|
A recorded local strict-review pass covers head |
PR Summary by QodoRemove unused members and unreachable language branch
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain, and the changes are narrowly scoped to removing unreachable or unused code while adding regression coverage for unmappable language tags.
No open issues 🎉
What changed in this PR
This pull request removes unreachable branches and unused members identified through coverage analysis while preserving existing behavior. It also adds regression coverage for IETF language tags without ISO 639-2 equivalents.
Changes:
- Simplifies
TrackProps.SetLanguageand removes its ineffective return-value guard. - Adds theory coverage for unmappable IETF language tags.
- Removes unused sidecar, media, logging, and command-builder members.
- Serializes logging-sensitive tests.
| File | Description |
|---|---|
PlexCleanerTests/TrackPropsCreateTests.cs |
Adds coverage for unmappable IETF language tags and serializes logging-sensitive tests. |
PlexCleaner/TrackProps.cs |
Removes unreachable language handling and the unused flags overload. |
PlexCleaner/SidecarFile.cs |
Removes unused string-based sidecar helper overloads. |
PlexCleaner/MkvMergeBuilder.cs |
Removes unused output seek and snippet helpers. |
PlexCleaner/MediaTool.cs |
Removes the unused string-based failure logging overload. |
PlexCleaner/MediaProps.cs |
Removes the unused cover-art removal method. |
PlexCleaner/HandBrakeBuilder.cs |
Removes unused input seek and three-argument output helpers. |
PlexCleaner/FfProbeBuilder.cs |
Removes unused format, input, seek, and quick-scan helpers. |
PlexCleaner/FfMpegBuilder.cs |
Removes unused progress, seek, video, and metadata helpers. |
Review effort: Lite
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships |
Removes code that no input reaches or that has no caller, as found by the coverage work (#1171). Behavior is unchanged. This is the work #1185 tracks.
Removed:
TrackProps.SetLanguage:GetIetfFromIsoempty-result branch.GetIetfFromIsoalways returns a value,undfor an unknown tag.SetLanguagenow returnsvoid, since it never returned false, andCreate's guard on it is gone.GetIsoFromIetfempty-result branches stay.GetIsoFromIetfreturns null for an IETF tag whose ISO 639-3 language has no ISO 639-2 code, such aspcm. A new theory covers both branches.TrackProps.GetFlags(), the no-argument overload.MediaProps.RemoveCoverArt(). Cover art removal runs throughProcessFile.RemoveCoverArt(ref bool)andProcessDriver.SidecarFile.IsSidecarFile(string)andGetMkvName(string). TheFileInfooverloads are the ones in use.MediaTool.LogFailedResult(int, string, string, string). Every caller uses theBufferedCommandResultoverload.Add.Progress, input and output seek,NoVideo,MapMetadata.TestSnippets.Format,Input, seek,QuickScan.Plugins use none of the removed members, and the plugin loader looks only for
IProcessPlugin. README "Process Plugins" already says the public API a plugin calls can change in any release.The
commentslabel is on because one existing comment line, "ReMux will conditionally check for SetIetfLanguageTags", is re-indented.Local strict review: the first pass raised 1 finding. My premise that the language lookup never returns empty was wrong for
GetIsoFromIetf. I confirmed it with a probe, restored those branches, and added a test. The second pass raised none.Verification: the .NET Format chain is clean, and the unit suite passes (540 tests).
🤖 Generated with Claude Code