Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More dynamic caching of ImportDeclaration::importedSymbols #2020

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

oxisto
Copy link
Member

@oxisto oxisto commented Feb 2, 2025

Instead of caching importedSymbols statically once (or twice), instead we resolve the import declaration back to the namespace (declaration) and update the symbol on-chance.

This still not the perfect solution that I want, but its a step into the right direction.

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 83.67347% with 16 lines in your changes missing coverage. Please review.

Project coverage is 78.09%. Comparing base (be9a1e4) to head (56c8425).

Files with missing lines Patch % Lines
...n/de/fraunhofer/aisec/cpg/passes/ImportResolver.kt 75.00% 2 Missing and 3 partials ⚠️
...ofer/aisec/cpg/frontends/cxx/DeclarationHandler.kt 58.33% 5 Missing ⚠️
.../fraunhofer/aisec/cpg/graph/edges/scopes/Import.kt 75.00% 3 Missing and 1 partial ⚠️
...ec/cpg/graph/edges/collections/UnwrappedEdgeSet.kt 33.33% 2 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...e/fraunhofer/aisec/cpg/graph/DeclarationBuilder.kt 94.59% <100.00%> (-0.04%) ⬇️
...kotlin/de/fraunhofer/aisec/cpg/graph/Extensions.kt 63.93% <100.00%> (+0.07%) ⬆️
...isec/cpg/graph/declarations/FunctionDeclaration.kt 77.10% <100.00%> (-0.28%) ⬇️
.../aisec/cpg/graph/declarations/ImportDeclaration.kt 100.00% <100.00%> (ø)
.../de/fraunhofer/aisec/cpg/graph/edges/Extensions.kt 89.47% <100.00%> (+1.97%) ⬆️
...raunhofer/aisec/cpg/graph/scopes/NamespaceScope.kt 100.00% <100.00%> (ø)
...tlin/de/fraunhofer/aisec/cpg/graph/scopes/Scope.kt 82.66% <100.00%> (+0.97%) ⬆️
...lin/de/fraunhofer/aisec/cpg/passes/TypeResolver.kt 95.45% <ø> (-0.11%) ⬇️
...aisec/cpg/frontends/golang/SpecificationHandler.kt 81.34% <100.00%> (+0.72%) ⬆️
...tlin/de/fraunhofer/aisec/cpg/passes/GoExtraPass.kt 81.98% <ø> (+1.81%) ⬆️
... and 6 more

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oxisto oxisto changed the title Re-design of ImportDeclaration::importedSymbols More dynamic caching of ImportDeclaration::importedSymbols Feb 3, 2025
oxisto and others added 5 commits February 3, 2025 14:32
Instead of caching this once (or twice), instead we resolve the import declaration back to the namespace (declaration) and access the symbol on-demand.
@oxisto oxisto force-pushed the revamped-imported-symbols branch from 7675cb0 to da8a0fc Compare February 3, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant