There are quite a few different tools to help in analyzing your code. You may want to start by checking out some of the programs in this list of tools for static code analysis.

Jim