elastic / elastic/docs-builder
chore: Delete dead C# code
- Dominant language
- C#
- Stars
- 24
- Forks
- 44
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 146
Description
## What
Remove code with zero callers, zero usages, or that is written but never read.
## Items to delete
### Svg `tokens/` icon set — 56 files + all plumbing
`GetToken`, `TryGetToken`, and `Tokens` have zero references outside `EuiSvgIcons.cs`. Delete the 56 embedded token SVGs (`svgs/tokens/*.svg`) plus `LazyTokenMap`, the 57-entry `TokenAliases` dictionary, `LoadTokens`, and the tokens `EmbeddedResource` include in the csproj.
Files: `src/Elastic.Documentation.Svg/EuiSvgIcons.cs`, `src/Elastic.Documentation.Svg/svgs/tokens/`, `src/Elastic.Documentation.Svg/Elastic.Documentation.Svg.csproj` (~90 lines + 56 files)
### `IConversionCollector` — zero implementations
Always null; the "used primarily for testing" comment is stale. Remove the interface and the null-threading (field, ctor param, `ConversionCollector` property, `collector?.Collect(...)` call) through `DocumentationGenerator`/`HtmlWriter`/`DocumentationFileExporter`.
File: `src/Elastic.Markdown/DocumentationGenerator.cs:27` (~18 lines)
### `ICodexModel` + `ICodexPageRenderer` — never implemented, never called
The `RenderAsync` calls in `CodexGenerator` are `RazorSlices.RenderAsync`, not this interface. Fully dead.
File: `src/Elastic.Codex/CodexGenerator.cs:22` (~16 lines)
### `IValidator` interface — entire file
Zero implementations and zero usages; pure dead letter.
File: `src/api/Elastic.Documentation.Api/Validation/IValidator.cs` (~12 lines)
### `ElasticsearchEndpoint` — 4 unread properties
Set by the configurator but never read anywhere:
- `SearchNumThreads`
- `IndexNumThreads`
- `BufferSize`
- `NoElasticInferenceService`
File: `src/Elastic.Documentation.Configuration/DocumentationEndpoints.cs:43-61` (~8 lines + assignments)
### `ConfigurationFile.DevelopmentDocs` — unread property
Set from YAML field `DevDocs`, never read by any consumer. Delete the property, its assignment, and the `DevDocs` YAML field if unused elsewhere.
File: `src/Elastic.Documentation.Configuration/Builder/ConfigurationFile.cs:88`
### `CrossLinkValidator.GetExcludedSchemes()` — zero callers
The field it would return is accessed directly everywhere; this method is never called.
File: `src/Elastic.Documentation/Links/CrossLinkValidator.cs:68`
~150 lines + 56 files removed across the batch.
> [!NOTE]
> Re-audited 2026-07-07: added the Svg token set, `IConversionCollector`, and `ICodexModel`/`ICodexPageRenderer` (all grep-verified dead).
Part of the broader ponytail over-engineering audit tracked in #3574.
Contributor guide
Assessment
This issue has not been assessed yet.