I need to build a tool to perform some complicated static analysis on Java (path-, context-, flow-sensitive), and I am playing with PMD. Does PMD build a global call-graph? I couldn't find it..
Also, I wrote a simple custom rule to find all the call-site of a method (say Log.info in Hadoop). But it seems PMD cannot even recognize the function name because it is not defined in the current source file? Am I missing anything?
Thanks!
Last edit: Ding 2013-12-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PMD does create call graphs for some of its static analyses, they can also be visualized in the Eclipse plugin via its Dataflow View. Open a class in an editor, then select one of the methods that appear in the Dataflow view dropdown list.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It just pertains to the local file. I think it would be a challenge to make the right associations across classes in a static analysis tool. Local static methods probably ok but its all conjecture when it comes to abstract methods and interfaces.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to build a tool to perform some complicated static analysis on Java (path-, context-, flow-sensitive), and I am playing with PMD. Does PMD build a global call-graph? I couldn't find it..
Also, I wrote a simple custom rule to find all the call-site of a method (say Log.info in Hadoop). But it seems PMD cannot even recognize the function name because it is not defined in the current source file? Am I missing anything?
Thanks!
Last edit: Ding 2013-12-11
PMD does create call graphs for some of its static analyses, they can also be visualized in the Eclipse plugin via its Dataflow View. Open a class in an editor, then select one of the methods that appear in the Dataflow view dropdown list.
Thanks a lot for the prompt response Brian! Is the call graph a global call graph on the entire project or it's a local one from the current file?
It just pertains to the local file. I think it would be a challenge to make the right associations across classes in a static analysis tool. Local static methods probably ok but its all conjecture when it comes to abstract methods and interfaces.
Good to know. Thanks a lot!