Is there a tool that is able to measure the frequency of function calls in a project and counts other aspects (for statistics purposes) of Python code?
thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I guess you want to do static code analysis. How many locations in your code
call a function.
This is very hard to do in dynamic languages like python, because there are so many
ways functions may be called otherwise than by proper name, and even the python bytecode compiler
won’t know always which function is going to be called in a place, and it may even change
during execution. And there’s standard OO polymorphism too.
Consider:
No way any static analyses tool will find out which functions in math.* are going to
be called by this code. Even the first example would be very hard to reason about,
the second is impossible.
The following tool does some static analysis regarding complexity.
Other analysis tools like PyLint and PyChecker rather focus on style and probable
errors.