Question : How to limit number of lines allowed for a Method in RAD 6.0

Hi I am using RAD (Rational Application Developer) 6.0, I want to have a limitation for the number of lines allowed in a method.

so that all our developers will be allerted if the method gets too long.

Please suggest me.

Thanks.

Answer : How to limit number of lines allowed for a Method in RAD 6.0

Hi,

Maybe you can use Checkstyle (http://checkstyle.sourceforge.net), a tool to check Java code.

In my project we installed the Checkstyle plugin (http://eclipse-cs.sourceforge.net) and one of its many features is the methodLength: where you can define a maximum number of lines for methods; if your method is longer than the defined length Eclipse will show an error.

Take a look at Checkstyle, we use it integrated in Eclipse, but Checkstyle configuration says that it's also possible to use it as an Ant task or as command line tool.
Random Solutions  
 
programming4us programming4us