Code Simplification Refactoring (Feature 111)
Internal code quality maintenance release. This refactoring eliminates 16 code-quality findings — duplicate logic, dead code, unused parameters, and overly complex structures — without changing any user-visible output, CLI options, or API contracts.
♻️ Refactoring
This release is a pure internal refactoring. There are no new features, no bug fixes visible to users, and no changes to the tool's output or behaviour.
What changed internally:
- Shared AzDO mapper base class —
AzdoGroupMapper,AzdoUserMapper,AzdoProjectMapper, andAzdoRepositoryMappernow inherit from a commonAzdoEntityMapperabstract base, eliminating ~300 lines of duplicated structure. - Shared AzDO formatter helper —
AzdoGroupDescriptorFormatter,AzdoUserIdFormatter,AzdoProjectIdFormatter, andAzdoRepositoryIdFormatternow delegate to a singleAzdoFormatterHelper.TryFormatmethod, reducing each class to a thin wrapper. ApplyViewModelContextrecord — The six-parameterApplyViewModelinterface method is replaced by a single context record, removing scattered_ = paramdiscards across all factory implementations.- Eliminated dead code —
BuildDefinitionRenderer,VariableGroupFactory,BuildDefinitionFactory,ShouldUseMultilineDetailsSummary, and the unusedprincipalMapperconstructor parameter have been removed. - Reduced duplicate dispatch —
FormatAttributeValuePlainnow delegates toTryFormatSemanticValueinstead of duplicating its dispatch chain;IconProviderRegistryandValueFormatterRegistryshare aTryResolveFirsthelper inPatternMatchingRegistry<T>. - Modern C# idioms —
ServiceResolutionContextandSummaryModelconverted tosealed records;ActionSummary,SummaryModel, andResourceTypeBreakdowntightened tointernalaccess. - Single
BuildReferenceIndexcall — Configuration reference index is built once per plan render and passed down, eliminating a redundant rebuild on each resource.
All 1186 tests pass. Snapshot output is unchanged.
🔗 Commits
6cf04aerefactor: introduce ApplyViewModelContext record (Tasks 1-2)7848a1crefactor: AzDO mapper base class and formatter helper (Tasks 3-5)f3f7bf5refactor: remove BuildDefinitionRenderer, vestigial factories, add TryGetFactory, remove unused registry params (Tasks 6-9)925f789Refactor Markdown Generation and Renderer Components0bf53dbrefactor: fix pre-existing build errors from Tasks 1-16 and implement Tasks 17-22ef13637refactor: convert ServiceResolutionContext to positional record2856bd9refactor: fix code review issues — remove unused principalMapper param, fix naming, add comment