Mosallamy / refdiff-python

Python refactoring extraction tool for GitHub commit history
6 stars 4 forks source link

Added a file called test-parser in resources #5

Closed QassemNa closed 3 years ago

QassemNa commented 3 years ago

Hello @Mosallamy and @rodrigo-brito, I have added a new file called test-parser it can extract the name of the file, namespace and also calls inside a function. However, I haven't added namespace to the JSON yet as I haven't fully understood when it changes it can only add the namespace of the file. If you want to test the file this you must add the path of the example.py for it to work correctly.

rodrigo-brito commented 3 years ago

Hi @QassemNa, great job.

About the namespace, it is necessary only for the high-level (root) node. For python, it is the File. For the file, the namespace is the package name.

Mosallamy commented 3 years ago

Hello @rodrigo-brito, we just wanted to know what are the remaining steps so that the plugin work , could you please explain it to us and we will try to write the code 😁 We have read the RefDiff paper so we know a little how it works, but face a problem when trying to understand why certain parts of the code are written.

rodrigo-brito commented 3 years ago

There is some work to do. In this part, you need to discover a good way to execute a Python code inside Java module. https://github.com/Mosallamy/refdiff-python/blob/main/src/main/java/refdiff/parsers/python/PythonPlugin.java#L30-L57

The main problem is the dependencies, maybe it can be used as a global Python code, and the dependencies will be installed on global pip. But, we have other alternatives like https://www.jython.org/, but i don't have time to test it yet.

After it, do you need to adjust this part to create the nodes in CST Tree, i this step the RefDiff create the relationship with node and its parent. https://github.com/Mosallamy/refdiff-python/blob/main/src/main/java/refdiff/parsers/python/PythonPlugin.java#L178-L200

Unit tests is a good way to validate it

Mosallamy commented 3 years ago

Hello @rodrigo-brito,

Also we created a repo containing a file that has been refactored and when running the program it returns that a MOVE refactoring has been detected although there was no MOVE refactoring in the file.

Can you please tell us what should we adjust in this part https://github.com/Mosallamy/refdiff-python/blob/main/src/main/java/refdiff/parsers/python/PythonPlugin.java#L178-L200 so that the tool can detect the refactoring?

Thank you 😃

rodrigo-brito commented 3 years ago

Hi @Mosallamy, I will try to check it today. I think we are close to finishing it.

Mosallamy commented 3 years ago

Ok thanks! Also I updated the parser file

Mosallamy commented 3 years ago

Hello @rodrigo-brito, is there anything that we can do in order to finish the CST conversion? we tried to edit some parts in the plugin that is responsible for converting AST to CST but it did not work unfortianeyl Thanks 😃

QassemNa commented 3 years ago

Hi @rodrigo-brito, I have been able to exctract only the rename method but I can't figure out why it only shows the rename method, do you have any ideas on how to solve it? Thanks!