docs(pc0038,fc0007,lc0089) Document shared flow-terminating built-ins across rules - #164
Open
MODUSCarstenScholling wants to merge 2 commits into
Open
Conversation
- Relates to ALCops/Analyzers#463 and ALCops/Analyzers#468 - Document FieldError handling for PC0038, FC0007, and LC0089 - Explain the collectible ErrorInfo limitation
- Relates to ALCops/Analyzers#463 - Document CurrReport and CurrXMLport guard-clause behavior - Distinguish metric-specific guard exits from general procedure terminators
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
Document shared flow-terminating built-ins across PC0038, FC0007, and LC0089.
This documentation change accompanies ALCops/Analyzers#505, which implements the described behavior.
Changes
PC0038
forbounds, andforeachcollections.casehandling.Error(...)Record.FieldError(...)FieldRef.FieldError(...)ErrororFieldErrordo not terminate a path.FC0007
Record.FieldError(...)andFieldRef.FieldError(...)as scope-leaving statements forErrorOnlyandExitAndError.if-branch behavior unchanged: branch statements are not sibling statements for FC0007 spacing analysis.LC0089
Error(...),Record.FieldError(...), andFieldRef.FieldError(...)as guard-clause exits.CurrReport.Break()CurrReport.Skip()CurrReport.Quit()CurrXMLport.Break()CurrXMLport.Skip()CurrXMLport.Quit()CurrReportandCurrXMLportmethods are Cognitive Complexity guard exits only; they are not general procedure terminators.ErrorandFieldErrormethods remain normal calls.Known limitation
Error(ErrorInfo)is currently documented as flow-terminating even whenErrorInfo.Collectibleistrueand execution happens inside anErrorBehavior::Collectscope.AL can continue after a collectible error in that context. Identifying this precisely requires data-flow analysis of the
ErrorInfovalue and surrounding collection behavior, which is outside the current invocation-level analysis.Dependency
Depends on ALCops/Analyzers#505. Merge the analyzer implementation before releasing documentation that describes this behavior.
Replaces existing #153