Skip to content

Remove Unused Code Ahead of Expanding Test Coverage - #1170

Merged
ptr727 merged 5 commits into
developfrom
coverage-dead-code
Nov 2, 2026
Merged

ptr727 merged 5 commits into
developfrom
coverage-dead-code

Conversation

@ptr727

@ptr727 ptr727 commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

First step toward 80% code coverage: delete code that nothing calls, rather than write tests for it.

Why

A per-line coverage analysis mapped every uncovered line to the member that holds it, then searched for callers of each fully uncovered member. These had no caller anywhere in the product, the plugins, the tests, Sandbox/, RegressionTests/, the docs, or the workflows, by name or by string:

  • MediaInfoXmlParser.MediaInfoXmlToJson and the typed XML chain behind it (MediaInfoFromXml, ParseMediaInfo, ParseMedia, ParseTrack), and MediaInfoToolXmlSchema.cs, which only that chain reached.
  • MediaTool.ExecuteStreamStdOut. Only ExecuteStreamStdErr is used.
  • ProcessFile.TestMediaProps.
  • The builder options FfProbeBuilder.LogLevelQuiet/ShowFrames, MediaInfoBuilder.OutputFormatXml, and MkvMergeBuilder.Quiet.

GenericXmlToJson stays, since the sidecar v4 to v5 upgrade uses it. Extensions.LogAndPropagate is also unused but stays, since the carried .NET code style teaches it as the pattern.

Changes

  • Deletes the code above. The ARCHITECTURE.md parser section now describes only the remaining parser.
  • Drops the Xml2CSharp credit from the README, since no generated XML schema class remains.
  • Bumps version.json to 3.24 for the coverage work, and opens the 3.24 release notes in README.md and HISTORY.md.

Verification

  • Build: 0 warnings, 0 errors. CSharpier and dotnet format style --verify-no-changes are clean.
  • Tests: all 498 unit tests pass.
  • Coverage, read from the local Cobertura output and limited to repository source: the hit-line count matches Codecov's main report exactly. The coverable total drops by the deleted lines, which moves the overall figure from 58.15% to about 59.5%.
  • A local strict review pass found one issue, the stale Xml2CSharp credit, which is fixed in this PR. A second pass over the fix found nothing.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Release
    • Updated the application version to 3.24. Media processing behavior remains unchanged.
  • Documentation
    • Updated the release notes and XML conversion documentation to reflect current functionality.
    • Removed the prior version’s release notes and an unused third-party tool listing.
    • Clarified that generic XML-to-JSON conversion remains available for sidecar upgrades.
  • Maintenance
    • Removed unused functionality. These changes do not alter media processing.

ptr727 and others added 2 commits November 2, 2026 08:12
Coverage analysis found members with no caller anywhere in the product,
plugins, tests, or the sandbox. Testing them would raise the coverage
number without testing anything that runs, so they are deleted instead:
the typed MediaInfo XML parser and its schema types, a streamed-stdout
tool execution path, a media props self-test, and unused command-line
builder options. The sidecar v4 to v5 upgrade keeps its generic XML to
JSON conversion.

Bump the version to 3.24 for the coverage work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 2, 2026 16:15
@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 16a4d389471aad4d040d7a883080ed5c738a7ec4, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You'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 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: e71e932c-50dd-4611-a7aa-a475d2450b9a
Commits

Reviewing files that changed from the base of the PR and between 6a1636f and 6018343.

Files selected for processing: 1
  • ARCHITECTURE.md
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4c5d08d4-b72c-4257-8da4-5d67bd0773f6
Commits

Reviewing files that changed from the base of the PR and between 16a4d38 and 6a1636f.

Files selected for processing: 1
  • ARCHITECTURE.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

The change removes the typed MediaInfo XML parser and several tool and media-property APIs. Documentation now describes the retained generic XML-to-JSON parser, and release information and version metadata are updated to 3.24.

Changes: Unused-code removal and 3.24 release updates

Layer / File(s) Summary
Remove typed MediaInfo XML parsing
PlexCleaner/MediaInfoToolXmlSchema.cs, PlexCleaner/MediaInfoXmlParser.cs, ARCHITECTURE.md
The typed MediaInfo XML schema and parser methods are removed. The architecture documentation describes GenericXmlToJson() and its use in sidecar upgrades.
Remove unused tool and media-property APIs
PlexCleaner/MediaTool.cs, PlexCleaner/FfProbeBuilder.cs, PlexCleaner/MediaInfoBuilder.cs, PlexCleaner/MkvMergeBuilder.cs, PlexCleaner/ProcessFile.cs
The stdout-streaming execution method, command-builder methods, and media-property self-test method are removed.
Update 3.24 release information
HISTORY.md, README.md, version.json
Release information describes the removals and states that processing behavior is unchanged. The version changes from 3.23 to 3.24, and the Xml2CSharp entry is removed from the README.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Other

Possibly related PRs

Suggested labels: chore

Merge Risk: Minimal · previous review 6a163

The change is mergeable on the available evidence. The remaining documentation clarification concerns pre-existing wording and does not affect parser behavior.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Remove Unused Code Ahead of Expanding Test Coverage" matches the main change. The PR deletes unused product code, including the typed MediaInfo XML parsing chain and its schema file, MediaT…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Remove Unused Code Ahead of Expanding Test Coverage" matches the main change. The PR deletes unused product code, including the typed MediaInfo XML parsing chain and its schema file, MediaTool.ExecuteStreamStdOut, ProcessFile.TestMediaProps, and several builder options. The title states the purpose (removal of unused code) and the motivation (future test coverage). It is specific enough for a teammate scanning history to understand the primary change.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Remove unused media tooling and typed XML parsing code

✨ Enhancement 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Remove uncalled typed MediaInfo XML parsing, tool execution, self-test, and builder options.
Diagram

graph TD
    Files["Media files"] --> Builders["Tool builders"] --> Tools["Media tools"] --> Processing["Media processing"]
    Legacy["Legacy sidecars"] --> Parser["Generic XML parser"] --> Sidecar["Sidecar JSON"] --> Processing
Loading
High-Level Assessment

Removing uncalled code is preferable to adding tests solely to cover it. Retaining the generic parser preserves the sidecar v4-to-v5 upgrade; retaining or testing the separate typed parser would add maintenance work without covering a product call path.

Files changed (10) +11 / -308

Refactor (6) +0 / -290
FfProbeBuilder.csRemove unused ffprobe option helpers +0/-4

Remove unused ffprobe option helpers

• Deletes the LogLevelQuiet and ShowFrames convenience methods; the remaining command-building options are unchanged.

PlexCleaner/FfProbeBuilder.cs

MediaInfoBuilder.csRemove unused MediaInfo XML output helper +0/-2

Remove unused MediaInfo XML output helper

• Deletes OutputFormatXml while retaining the JSON output option used by MediaInfoTool.

PlexCleaner/MediaInfoBuilder.cs

MediaInfoXmlParser.csRemove the uncalled typed MediaInfo parsing path +0/-171

Remove the uncalled typed MediaInfo parsing path

• Deletes typed XML parsing and its MediaInfoXmlToJson bridge. GenericXmlToJson remains available for the sidecar v4-to-v5 upgrade.

PlexCleaner/MediaInfoXmlParser.cs

MediaTool.csRemove unused streamed-stdout execution +0/-77

Remove unused streamed-stdout execution

• Deletes ExecuteStreamStdOut. The streamed-stderr method used by media verification remains.

PlexCleaner/MediaTool.cs

MkvMergeBuilder.csRemove unused mkvmerge quiet option +0/-2

Remove unused mkvmerge quiet option

• Deletes the uncalled Quiet convenience method from global command options.

PlexCleaner/MkvMergeBuilder.cs

ProcessFile.csRemove uncalled media properties self-test +0/-34

Remove uncalled media properties self-test

• Deletes TestMediaProps, which refreshed media information and checked for unsupported properties but had no callers.

PlexCleaner/ProcessFile.cs

Documentation (3) +10 / -17
ARCHITECTURE.mdDocument the remaining XML parser +3/-9

Document the remaining XML parser

• Removes descriptions of the deleted typed parser and XML-to-JSON bridge. Clarifies that GenericXmlToJson remains for legacy sidecar upgrades.

ARCHITECTURE.md

HISTORY.mdAdd 3.24 cleanup release history +5/-0

Add 3.24 cleanup release history

• Records the unused parser, execution path, builder options, and self-test removals while noting that generic sidecar conversion remains.

HISTORY.md

README.mdOpen 3.24 release notes and remove obsolete credit +2/-8

Open 3.24 release notes and remove obsolete credit

• Replaces the 3.23 release summary with the 3.24 cleanup summary. Removes the Xml2CSharp credit and link after deletion of the generated XML schema.

README.md

Other (1) +1 / -1
version.jsonAdvance project version to 3.24 +1/-1

Advance project version to 3.24

• Changes the Nerdbank.GitVersioning version from 3.23 to 3.24 for the coverage-work release.

version.json

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread ARCHITECTURE.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

ptr727 and others added 2 commits November 2, 2026 08:49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 6a1636f26e7ac4e23c648be81ce1d51fa690e9a9, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread ARCHITECTURE.md Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 60183439fe8f233acad3aac4197311a9224a7164, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit 9797ad2 into develop Nov 2, 2026
23 checks passed
@ptr727
ptr727 deleted the coverage-dead-code branch November 2, 2026 18:10
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