Posts Tagged “static code analysis”

You know how there are “man crushes” and “girl crushes?”  I’ve got a serious code crush on Hudson.  My latest manifestation of this infatuation with this wonderful tool is that I have convinced my co-workers in a vastly C#/ASP.NET shop to stop using CruiseControl.net and Visual Source Safe and to switch to Hudson and Subversion.

This group used to have a huge, single, magic NAnt script that would check one of six projects out of VSS based on parameters sent in, build the project, and publish it to a development server.  Now, Hudson does the checkout from Subversion and the deployment, and the NAnt script just calls MSBuild or zips things up into deployable units.  Next we are going to hook in FXCop to do static code analysis on their stuff and have the problems reported and graphed using the violations plugin (which also reports our Checkstyle and PMD violations on the Java side), and show trends for their NUnit tests.

And the really nice thing is that everyone can use one dashboard to view both the Java and the .NET development efforts.  Great for transparency and accountability.

Comments 1 Comment »

Sometimes you may find your team continually doing something that you wish they wouldn’t do. For example, you may find them continually hardcoding references to their c: drive in code, when the code eventually needs to run on a Linux box, but they never work on anything but Windows.

When cases like this arise, it’s almost obscenely easy to write a custom PMD rule to do code reviews for you to look for and flag these problems. PMD (pmd.sourceforge.net) is a tool for doing static code analysis and producing XML output files which can be transformed into useful outputs (such as HTML reports) for later perusal. Plug-ins for most major IDEs are also available.

Read the rest of this entry »

Comments No Comments »