-
Notifications
You must be signed in to change notification settings - Fork 73
Export cpg as json via Neo4j OGM #1215
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
Conversation
dd078ff
to
22d60fc
Compare
The current implementation does not create any Neo4j Session object, which allows the json export to be used without a connection to the database server, which is of course desirable. Update: I now implemented option (c). |
Good point! I created a separate function to export in the proposed json format ( |
SonarCloud Quality Gate failed.
|
|
ebb4d88
to
125ca8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change some names and add more explicit explanations in the form of function comments. Just to make it a bit more maintainable. I did also think whether or not it would be good to extract the export to json functionality into its own class to not overload the Application.kt
but for now its fine so that is optional.
cpg-neo4j/src/main/kotlin/de/fraunhofer/aisec/cpg_vis_neo4j/Application.kt
Outdated
Show resolved
Hide resolved
cpg-neo4j/src/main/kotlin/de/fraunhofer/aisec/cpg_vis_neo4j/Application.kt
Outdated
Show resolved
Hide resolved
5a961a6
to
23285c2
Compare
Kudos, SonarCloud Quality Gate passed! |
This PR adds the functionality to export the cpg as json.
The serialization is done via the Neo4j OGM.
Basically the same as when importing to Neo4j Database, just without Database.
So the json export will suffer from known problems, like recursion and bigInt.
Json format might be useful for machine learning or other data science projects.
Proposed json format:
Example json file:
cpg.txt
Closes #247 #776 #935