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

feature: Add relationship between core entities to make it persistable in database #195

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

shivasurya
Copy link
Owner

Description:

This PR adds relationship between the entities which should help to store them in relational format. Creating relationship between the entities reduces drastically search space to filter nodes while codeql query is executed. Further more adopting #190 class support further drives to implement class and filters by the end users to reduce the search space.

⚠️ One caveat I'm okay with is that if the end user crafts the query without relationship between entities will obviously trigger cartesian product and waste memory and computing time. We could warn the user by checking the cardinality of the dataset before filtering or generating cartesian product and let the user decide to run the query.

Checklist:

  • Tests passing (gradle testGo)?
  • Lint passing (golangci-lint run this requires golangci-lint)?

@shivasurya shivasurya added the enhancement New feature or request label Feb 2, 2025
@shivasurya shivasurya self-assigned this Feb 2, 2025
Copy link

codecov bot commented Feb 19, 2025

Codecov Report

Attention: Patch coverage is 0% with 1682 lines in your changes missing coverage. Please review.

Project coverage is 13.78%. Comparing base (ae4662a) to head (c2097d9).

Files with missing lines Patch % Lines
sourcecode-parser/tree/construct.go 0.00% 226 Missing ⚠️
sourcecode-parser/model/expr.go 0.00% 202 Missing ⚠️
sourcecode-parser/model/reftype.go 0.00% 187 Missing ⚠️
sourcecode-parser/tree/java/parse_expr.go 0.00% 175 Missing ⚠️
sourcecode-parser/model/member.go 0.00% 148 Missing ⚠️
sourcecode-parser/tree/java/parse_method.go 0.00% 137 Missing ⚠️
sourcecode-parser/db/db.go 0.00% 115 Missing ⚠️
sourcecode-parser/tree/query.go 0.00% 104 Missing ⚠️
sourcecode-parser/tree/java/parse_statement.go 0.00% 75 Missing ⚠️
sourcecode-parser/tree/java/parse_class.go 0.00% 68 Missing ⚠️
... and 12 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #195       +/-   ##
===========================================
- Coverage   72.42%   13.78%   -58.64%     
===========================================
  Files          16       30       +14     
  Lines        2473     2966      +493     
===========================================
- Hits         1791      409     -1382     
- Misses        639     2545     +1906     
+ Partials       43       12       -31     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant