Part of #455.
Duplicated helper-shaped code across analyzers, to be commonized into Helpers//Extensions/ (netstandard2.0-safe):
Verification: full test suite green, no change in the set of diagnostics produced, existing per-analyzer tests still pass unmodified (behavior is identical, only the implementation is shared).
Part of #455.
Duplicated helper-shaped code across analyzers, to be commonized into
Helpers//Extensions/(netstandard2.0-safe):GetTypeByMetadataName→ buildDictionarykeyed on SourceClass" is duplicated 4× (ProhibitedMethods:247,ProhibitedMethodInvocations:223,ProhibitedClasses:109,ProhibitedClassesInTestAssemblies:120). Extract e.g.CompilationExtensions.BuildTypeCache(...).IMethodSymbolresolution:MethodSymbolHelper.FindInvokedMemberSymbolexists and is used by 4 analyzers, but 3 more hand-roll the same shape (ProhibitedMethods:264,ProhibitedSubstituteForUsageInTestBase:176,ArgumentException:73). Either migrate them, or (better, combined with the Phase 1 sub-issue) add a name-prefilter-aware overload so the shared helper does the cheap check first for everyone.Helpers/Mapping.csexists but each*Specrecord struct re-implements its ownQualifiedNameconcat, andProhibitedMethodWithStrict:120hand-rolls the interpolation. Consolidate (this item may largely dissolve once the Phase 2 sub-issue removes string keys).GetNonNestedTypeDeclarations+ the type-name switch is duplicated nearly verbatim betweenFileNameMustMatchTypeNameDiagnosticsAnalyzer.cs:98-151andOneTypePerDocumentAnalysisDiagnosticsAnalyzer.cs:141-225. Extract a shared syntactic helper.GetFullTypeName+ per-ParameterSyntaxcache pattern is duplicated inParameterNameDiagnosticsAnalyzer.cs:129andParameterOrderingDiagnosticsAnalyzer.cs:155(the cache itself is ineffective — see the Phase 4 sub-issue). Rationalize intoHelpers/ParameterHelpers.ProhibitedClassesDiagnosticsAnalyzer.ProhibitedClassSpecis asealed class(line 230) where every sibling analyzer usesreadonly record struct.Verification: full test suite green, no change in the set of diagnostics produced, existing per-analyzer tests still pass unmodified (behavior is identical, only the implementation is shared).