Menu

Call graph in PMD?

Ding
2013-12-11
2013-12-11
  • Ding

    Ding - 2013-12-11

    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
  • Brian R

    Brian R - 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.

     
  • Ding

    Ding - 2013-12-11

    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?

     
  • Brian R

    Brian R - 2013-12-11

    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.

     
  • Ding

    Ding - 2013-12-11

    Good to know. Thanks a lot!

     

Log in to post a comment.