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

Open
wants to merge 1 commit 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.

This also speeds up the ResolveMemberExpressionAmbiguityPass.

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 77.58621% with 26 lines in your changes missing coverage. Please review.

Project coverage is 78.22%. Comparing base (edd5068) to head (43565b3).

Files with missing lines Patch % Lines
...n/de/fraunhofer/aisec/cpg/passes/ImportResolver.kt 76.92% 2 Missing and 4 partials ⚠️
...ofer/aisec/cpg/frontends/cxx/DeclarationHandler.kt 58.33% 5 Missing ⚠️
...sec/cpg/graph/declarations/ParameterDeclaration.kt 50.00% 3 Missing and 1 partial ⚠️
.../fraunhofer/aisec/cpg/graph/edges/scopes/Import.kt 75.00% 3 Missing and 1 partial ⚠️
...ain/kotlin/de/fraunhofer/aisec/cpg/ScopeManager.kt 0.00% 0 Missing and 3 partials ⚠️
...ec/cpg/graph/edges/collections/UnwrappedEdgeSet.kt 33.33% 2 Missing ⚠️
...kotlin/de/fraunhofer/aisec/cpg/graph/Extensions.kt 0.00% 1 Missing ⚠️
...raunhofer/aisec/cpg/graph/scopes/NamespaceScope.kt 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
...e/fraunhofer/aisec/cpg/graph/DeclarationBuilder.kt 94.59% <100.00%> (-0.04%) ⬇️
...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%) ⬆️
...tlin/de/fraunhofer/aisec/cpg/graph/scopes/Scope.kt 82.66% <100.00%> (+0.97%) ⬆️
...isec/cpg/graph/scopes/StructureDeclarationScope.kt 68.75% <ø> (ø)
...er/aisec/cpg/graph/scopes/ValueDeclarationScope.kt 50.00% <ø> (ø)
...cpg/passes/ResolveMemberExpressionAmbiguityPass.kt 96.15% <100.00%> (-0.63%) ⬇️
...lin/de/fraunhofer/aisec/cpg/passes/TypeResolver.kt 95.45% <ø> (-0.11%) ⬇️
...aisec/cpg/frontends/golang/SpecificationHandler.kt 81.34% <100.00%> (+0.72%) ⬆️
... and 11 more

... and 3 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 oxisto force-pushed the revamped-imported-symbols branch 3 times, most recently from 6d7ad11 to e5acb25 Compare February 5, 2025 22:47
@oxisto oxisto marked this pull request as ready for review February 6, 2025 12:29
@oxisto oxisto force-pushed the revamped-imported-symbols branch 2 times, most recently from ea50c42 to faf7f9e Compare February 6, 2025 20:14
…d we resolve the import declaration back to the namespace (declaration) and update the symbol on-chance.

Adding an 'import' edge
@oxisto oxisto force-pushed the revamped-imported-symbols branch from faf7f9e to 43565b3 Compare February 6, 2025 20:22
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