fix(python): cover assignment/return value-refs, broaden shadow guard to full scope - #79
Merged
Conversation
The RelReferences relation kind was dropped during the rebase merge with upstream's RelCalls-based value-ref fix; these two MCP tool-description strings still advertised it as a valid relation_kinds filter value.
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
Follow-up to #72/#74 (indirect-reference resolution and the resolveCall
shadow guard). Two aspects I identified while testing:
return (
cb = handler; return cb,return handler). This is a common patternfor factories/registries/DI-by-return. These functions had no incoming
edge and were misreported as dead code.
paramNames) only excluded function parameters. A loopvariable, local assignment,
with ... asalias, or walrus binding thathappens to share a name with an unrelated top-level def would still be
credited as a call to that def.
This replaces the parameter-only guard with
localBound: every name boundanywhere in the enclosing function's own scope (not just parameters),
applied uniformly to both direct-call resolution (
resolveCall) andvalue-ref resolution (
valueRefTarget).Also includes an unrelated, additive change to
pkg/explain: arelation-kind count breakdown (declares/imports/calls/.../has_method) in
the
--explainReport and rendered output, for visibility into the edgemix of a snapshot. Which is quite useful in my opinion.
cacheVersion bumped v95 → v96 since Python extractor output changes for
existing source (new edges + fewer false-positive edges); registered in
cachecov's versionCoverage per repo convention.