What it is...

codegraph (project page) is a tool for monitor the functional dependences within PHP-, Perl- and Bash-libraries. Even the internal Functions of PHP and Perl can be found. Simple Scripts can be scanned too, but they must start with the main body, only followed by function definitions.

Screenshot of example files

This is the output of ./codegraph -F "../examples/*.php" -p example.ps in $YOUR_PATH_TO_CODEGRAPH/src.

example pic
Try to find unused functions!

Dependences

codegraph depends on ruby and 3 extra packages :
- Ruby Graph Library RGL can easily be installed via rubygems: gem install rgl.
- ctags: Choose a version that supports PHP and Perl, eg. 5.1.
- graphviz by AT&T displays the resulting graph

Documentation

See the man-page for details. For latest options, try codegraph --help

Installation

Download the latest version from here. This is a generated package from the rubyforge project page. codegraph comes with an install.rb file for automatic installtion. You can change the path for the executable or you will need root access to put it under /usr/local/bin. Same for the library, which will be copied into the ruby CONFIG['sitelibdir']. Only the man-page has must be copied manually.

Enviroment

codegraph is developed under Linux. It should work on (Open|Net|Free)BSD too. Windows support is NOT explicitly included. The Ruby Graph Library is pure ruby, whereas inside the codegraph library unix-shell snippets are used. So codegraph should at least work under cygwin. For the graphviz software there exists a special Windows-Installer, but the automatical display function will probably not work. You can generate a .dot and load it into the Windows version of graphviz instead.

Comments on codegraph

are welcome. Send a mail to stark.dreamdetective(-,-)gmail.com

About me

I'm an theoretical physicist now working as product developer. 'Spares' by Michael Marshall Smith is one of my favorite books and for relaxing i play snooker and do horseback archery.

(-,-)...zZ