feat(AC0033,AC0034): report Rest Client and Telemetry usage without a required interface implementation - #568
Merged
Arthurvdv merged 5 commits intoSep 27, 2026
Conversation
…ixtures Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… required interface implementation Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ember walk per object A CodeunitSubtypeKind member missing from the loaded SDK resolved to Normal (0), so the Test/TestRunner exemption would have matched every codeunit. The members now fall back to an out-of-range value, like SymbolKind does. The analyzer also walks an object's declared members once for both rules instead of once per rule. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… consequence in messages Both messages now name the object as 'the "X" codeunit' like the other ApplicationCop messages, and AC0034 states what actually happens without a registered logger: the message is discarded and only warning 0000G7K is logged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Arthurvdv
deleted the
feat/ac0033-ac0034-required-interface-implementation
branch
September 27, 2026 10:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two new ApplicationCop rules on one shared analyzer (
RequiredInterfaceImplementation), implementing Rule 3 of discussion #405 (the per-app existence check). Rules 1 and 2 of that discussion stay out of scope; Rule 2 (per-variableInitialize(Handler)flow tracking) is a separate follow-up because it needs a different, body-walking mechanism.RestClientRequiresHttpClientHandlerCodeunit "Rest Client"(2350) and no codeunit in the app implements"Http Client Handler". Without one, the System Application's default handler sends the request, so the external-call permission and outgoing web service telemetry are attributed to the System Application instead of the app.TelemetryRequiresTelemetryLoggerCodeunit Telemetry(8711) /"Feature Telemetry"(8703) versus"Telemetry Logger". Without a registered logger for the publisher,Telemetry Loggers Impl.logs warning0000G7Kand discards the message.Design
SemanticFacts.IsSameName). Only codeunits declared in the compiling app count as implementations; dependencies never do.Subtype = TestorTestRunner(mock handlers/loggers usually live in test libraries).CompilationStartcreates a per-compilation read-onlyLazyindex of implemented interfaces fromGetDeclaredApplicationObjectSymbols(); a self-contained symbol action per object walks the object's declared symbols (GetMembers()with a descent allow-list) without any syntax walking or binding, and only consults the index when the object actually uses a trigger codeunit. No accumulate-then-report state, so partial-analysis passes are safe.EnumProvider.CodeunitSubtypeKindgainsTestRunner.Deliberate non-reports
Codeunit::"Rest Client"object references without a variable, arrays/lists of the codeunit, interface-typed variables, implementations provided by a dependency app (suppress via ruleset or pragma), and whether the handler/logger is actually passed toInitialize/registered (existence only).Verification
Failed: 26, Passed: 20(all 26 HasDiagnostic cases failing, all 20 NoDiagnostic passing); after the implementation commitPassed: 46on net10.0 and on the net8.0 leg (GITHUB_ACTIONS=true … -p:NavTargetFramework=net8.0).dotnet build ALCops.slnclean; ApplicationCop and Common Release builds withContinuousIntegrationBuild=true(netstandard2.1 / net8.0 / net10.0) clean;dotnet format ALCops.sln --verify-no-changesclean; fulldotnet test ALCops.slngreen;Validate-Rules.ps1OK.NoExceptionpass over all 46 fixtures (markers stripped) showed no swallowed analyzer exceptions.CodeunitSubtypeKindfallback that resolved toNormal, and a duplicated member walk) are addressed in the last commit.Docs: companion pages in ALCops/alcops.dev#193.
🤖 Generated with Claude Code