<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Stephen&#039;s Thoughts &#187; JDepend</title>
	<atom:link href="http://www.stephendowney.net/blog/category/jdepend/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stephendowney.net/blog</link>
	<description>Java &#38; Android Developer &#124; Dublin Ireland</description>
	<lastBuildDate>Mon, 19 Dec 2011 19:33:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Java Code Style and some Handy Plugins for Eclipse</title>
		<link>http://www.stephendowney.net/blog/2007/01/12/java-code-style-and-some-handy-plugins-for-eclipse/</link>
		<comments>http://www.stephendowney.net/blog/2007/01/12/java-code-style-and-some-handy-plugins-for-eclipse/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 10:29:47 +0000</pubDate>
		<dc:creator>Stephen Downey</dc:creator>
				<category><![CDATA[CheckStyle]]></category>
		<category><![CDATA[coding conventions]]></category>
		<category><![CDATA[CPD]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JDepend]]></category>
		<category><![CDATA[Metrics]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://www.stephendowney.net/blog/2007/01/12/java-code-style-and-some-handy-plugins-for-eclipse/</guid>
		<description><![CDATA[Here are some handy plugins for Eclipse that I came across via an IBM Developerworks article by Paul Duvall. CheckStyle: For coding standardsPMD&#39;s CPD: Enables discovering code duplicationCoverlipse: Measures code coverageJDepend: Provides dependency analysisEclipse Metrics plugin: Effectively spots complexity I have used the Checkstyle plugin for a few years now and found it extremely useful.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some handy plugins for <a href="http://www.eclipse.org/" target="_blank">Eclipse </a>that I came across via an <a href="http://www-128.ibm.com/developerworks/" target="_blank">IBM Developerworks</a> <a href="http://www-128.ibm.com/developerworks/java/library/j-ap01117/index.html?ca=drs-" target="_blank">article </a>by <a href="http://www-128.ibm.com/developerworks/java/library/j-ap01117/index.html?ca=drs-#author" target="_blank">Paul Duvall</a>. </p>
<blockquote><p><a href="http://eclipse-cs.sourceforge.net/" target="_blank">CheckStyle</a>: For coding standards<br /><a href="http://pmd.sourceforge.net/" target="_blank">PMD&#39;s CPD</a>: Enables discovering code duplication<br /><a href="http://coverlipse.sourceforge.net/index.php" target="_blank">Coverlipse</a>: Measures code coverage<br /><a href="http://www.clarkware.com/software/JDepend.html" target="_blank">JDepend</a>: Provides dependency analysis<br /><a href="http://metrics.sourceforge.net/" target="_blank">Eclipse Metrics plugin</a>: Effectively spots complexity</p></blockquote>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6681085387246782";
//stephendowney_java_embeded
google_ad_slot = "4220870787";
google_ad_width = 300;
google_ad_height = 250;
//--></script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>I have used the Checkstyle plugin for a few years now and found it extremely useful.&nbsp; In a nutshell, checkstyle will check your code against coding standards and issue a warning if you code something that is not in the correct format. &nbsp; This has always been a real bone of contention with fellow developers.&nbsp; One developer I worked with in the past felt that everyone should be free to code in whatever style they prefer.&nbsp; I would not agree with this at all.&nbsp; It can lead to code that is very hard to maintain and read. &nbsp; </p>
<p>With a plugin like Checkstyle you don&#39;t need &quot;<a href="http://catb.org/jargon/html/C/code-police.html" target="_blank">Code Police</a>&quot; checking the code and informing people that they are using the wrong style.&nbsp; If you want to push it one step further you can set up your automatic build (We used <a href="http://cruisecontrol.sourceforge.net/" target="_blank">Cruisecontrol</a> in the past) to mark a build as broken when it comes across a Checkstyle error.  This ensures that a code base is readable and maintainable.&nbsp;&nbsp; Here is an example of bad coding style: </p>
<blockquote><p>if (testBoolean) myNum++;</p></blockquote>
<p>Many developers leave out the parenthesis as the compiler will not complain, this can often lead to confusion when you expect a line below to run when the statement is true but of course it won&#39;t because the <em>myNum++ </em>is going to run. The correct way to write this would be as follows:<br />
<blockquote>if (testBoolean)<br /> {<br />&nbsp; myNum++;<br /> }</p></blockquote>
<p>A new developer that comes across this code will know exactly what statement is run when the <em>if statement</em> is true. It is also possible to change the change the Checkstyle configuration for situations where a company has their own coding convention.</p>
<p>&nbsp;I have not used the other plugins yet but have a look at the <a href="http://www-128.ibm.com/developerworks/java/library/j-ap01117/index.html?ca=drs-" target="_blank">article</a> for how to install them.&nbsp; I am interested to see how good the code duplication plugin is.&nbsp;&nbsp; I hate when I come across &quot;Cut and paste&quot; coding because someone is too lazy to abstract the functionality into a base class. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.stephendowney.net/blog/2007/01/12/java-code-style-and-some-handy-plugins-for-eclipse/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

