SoftwareUnderstanding / inspect4py

Static code analysis package for Python repositories
https://inspect4py.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
27 stars 10 forks source link

Error in extracting functions #409

Closed dgarijo closed 1 year ago

dgarijo commented 1 year ago

In this project: https://github.com/oeg-upm/Chowlk

I see this file: https://github.com/oeg-upm/Chowlk/blob/webservice/converter.py which has a main function, a body and a print_errors function. However, when I ran inspect4py I find the following: image

There is no print_errors and the transform_ontology function is not declared in this file, it's imported. I think the problem is that the function is imported like this: from source.chowlk.transformations import transform_ontology and therefore inspect4py thinks it's a local function, when it isn't

What I don't understand is why print_errors is deleted.

rosafilgueira commented 1 year ago

I have run inspect4py -i Chowlk -o Chowlk_out -cl -si -html -sc And I got a different output for converter. I just goint open Chowlk/json_files/converter.json . See here:

![Uploading Screenshot 2023-02-17 at 19.41.13.png…]()

Screenshot 2023-02-17 at 19 41 24 Screenshot 2023-02-17 at 19 41 31
rosafilgueira commented 1 year ago

Just going to put the screenshot for the functions and body - of converters.json. You can see that I get the printer_errors, and I dont get the transform_ontology:

Screenshot 2023-02-17 at 19 41 24 Screenshot 2023-02-17 at 19 48 47
dgarijo commented 1 year ago

The problem is that I ran it on an old version of the code, where there is a transform_ontology and there is no printer_errors function. But then I looked into the latest version of the repo to verify everything.

My bad, inspect4py is working appropriately. I'll close the issue/