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

Major overhaul of the python language frontend #513

Merged
merged 96 commits into from
Oct 6, 2021
Merged

Conversation

maximiliankaul
Copy link
Contributor

@maximiliankaul maximiliankaul commented Aug 13, 2021

This is a WIP PR. The aim is to rewrite the python frontend to use a similar approach as the other frontends (handle_statement / handle_expresssion / ... instead of recursively traversing the AST). The old approach made some changes quiet difficult to implement.

TODOs before this can be merged:

  • add comments
  • transfer all old functionality to this branch
  • add source code to CPG nodes
  • fix the last test (9 out of 10 currently pass)
  • move more stuff into handle_xxx() functions
  • find an elegant solution to build and install the python package
  • ...

How to try out this PR on your system:
Just make sure to have JEP installed (currently version 4.0.0). If you tried out an old version of this PR before and have the "CPGPython" package locally installed -> remove it.

@maximiliankaul maximiliankaul marked this pull request as ready for review October 5, 2021 15:08
Copy link
Member

@oxisto oxisto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to extract more of the if/elif constructs into individual handle_XXX functions, but let's keep that for the second round of refactoring. Let's merge it as experimental in order to progress.

@oxisto oxisto enabled auto-merge (squash) October 6, 2021 16:17
@sonarcloud
Copy link

sonarcloud bot commented Oct 6, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

48.7% 48.7% Coverage
0.0% 0.0% Duplication

@oxisto oxisto merged commit 959d7a5 into master Oct 6, 2021
@oxisto oxisto deleted the mk/python-rework branch October 6, 2021 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants