You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Jakob Braeuchi <jb...@gmx.ch> on 2004/03/05 21:44:33 UTC

checkstyle for ojb ?

hi all,

i'm currently experimenting (playing) with checkstyle 3.3. i use a plugin for 
eclipse http://sourceforge.net/projects/eclipse-cs/ .

imo we could improve code-quality with the help of checkstyle. the downside is 
the huge initial effort to cleanup the whole source. to reduce this effort i 
have customized the checkstyle-config to weaken some of the rules but i still 
have thousands of warnings :(

what do you think about using a tool like checkstyle for ojb ?

jakob



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: checkstyle for ojb ?

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi antonio,

i use eclipse and all it's features to detect smelly code but checkstyle has 
more advanced features and also runs outside eclipse. i was thinking of 
providing an ojb-checkstyle-template, this template could also be integrated 
into the build process.

jakob

Antonio Gallardo wrote:
> Thomas Mahler dijo:
> 
>>I think makes sense to start with settings that allow to find only very
>>few defects (say unused local variables).
> 
> 
> You can use eclipse to find many of these issues. Also you can define
> there what code check you want to turn on or off.
> 
> More info: http://eclipse.org/
> 
> Best Regards,
> 
> Antonio Gallardo
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: checkstyle for ojb ?

Posted by Antonio Gallardo <ag...@agssa.net>.
Thomas Mahler dijo:
> I think makes sense to start with settings that allow to find only very
> few defects (say unused local variables).

You can use eclipse to find many of these issues. Also you can define
there what code check you want to turn on or off.

More info: http://eclipse.org/

Best Regards,

Antonio Gallardo


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: checkstyle for ojb ?

Posted by Jakob Braeuchi <jb...@gmx.ch>.

Thomas Dudziak wrote:

> On Mon, 8 Mar 2004, Jakob Braeuchi wrote:
> 
> 
>>there are several plugins for checkstyle. i use 
>>http://sourceforge.net/projects/eclipse-cs which runs inside eclipse m7.
> 
> 
> That's the one I tried. It died on me with an out-of-memory error (not
> Javas/Eclipses fault with 1gig of memory). I guess this is not a big 

it works fine on my machine with 512mb, maybe you have too much ram ;)

> issue, though, as we'd probably use it with an ant task.
> 
> 
>>imo we should not be too rigid about code-formatting (it ends up in religious 
>>discussions about where to put the braces ;) ) but we should enable checking of 
>>unused imports, unused variables and the like.
> 
> 
> I agree, though there are some code formatting issues that are important
> to error prevention IMO, e.g. always using braces in if-statements
> etc. For these things there should be rules.
> As Antonio said, some of these things are checked by Eclipse (e.g. unused
> imports, unused variables in M7 ?).

but we can not assume that everyone is using eclipse. althogh it would be nice.

> What I think is even more important is adding source documentation (and
> keeping it consistent with the source) and removing duplicate code and the

i agree.

jakob

> like because an unused import doesn't hurt (it's unlikely at
> least) whereas code duplication does hurt (when one instance has to be
> changed ...).
> 
> Tom
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: checkstyle for ojb ?

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Mon, 8 Mar 2004, Jakob Braeuchi wrote:

> there are several plugins for checkstyle. i use 
> http://sourceforge.net/projects/eclipse-cs which runs inside eclipse m7.

That's the one I tried. It died on me with an out-of-memory error (not
Javas/Eclipses fault with 1gig of memory). I guess this is not a big 
issue, though, as we'd probably use it with an ant task.

> imo we should not be too rigid about code-formatting (it ends up in religious 
> discussions about where to put the braces ;) ) but we should enable checking of 
> unused imports, unused variables and the like.

I agree, though there are some code formatting issues that are important
to error prevention IMO, e.g. always using braces in if-statements
etc. For these things there should be rules.
As Antonio said, some of these things are checked by Eclipse (e.g. unused
imports, unused variables in M7 ?).
What I think is even more important is adding source documentation (and
keeping it consistent with the source) and removing duplicate code and the
like because an unused import doesn't hurt (it's unlikely at
least) whereas code duplication does hurt (when one instance has to be
changed ...).

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: checkstyle for ojb ?

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi thomas,

there are several plugins for checkstyle. i use 
http://sourceforge.net/projects/eclipse-cs which runs inside eclipse m7.
imo we should not be too rigid about code-formatting (it ends up in religious 
discussions about where to put the braces ;) ) but we should enable checking of 
unused imports, unused variables and the like.

jakob

Thomas Dudziak wrote:

> On Mon, 8 Mar 2004, Thomas Mahler wrote:
> 
> 
>>I'm a fan of using such a tool for quality improvements.
>>They usually find a lot of "smelly" code. Only problem: they usually 
>>find to much to deal with... It's totally frustrating that your piece of 
>>software has 3478 defects. If it said here are the top 20 things to 
>>improve, it would be much more motivating...
>>
>>I think makes sense to start with settings that allow to find only very 
>>few defects (say unused local variables).
> 
> 
> I only had a quick look at checkstyle (and btw. it crashed my Eclipse 3M7
> when run with OJB), but a lot of checks seem to be dealing with coding
> style (including comments). So, using checkstyle would mean agreeing on a 
> coding style for OJB first, right ? (which would be a good thing
> IMO) Though I guess that we can enforce some parts of a coding style in a
> proactive way using pretty printers and formatting rules (e.g. Eclipse 3).
> 
> There appear to be other, really useful checks in checkstyle though,
> particularily finding duplicated code (using free-for-noncommercial-use
> plugin of Simian ?)
> 
> Tom
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: checkstyle for ojb ?

Posted by Thomas Dudziak <to...@first.gmd.de>.
On Mon, 8 Mar 2004, Thomas Mahler wrote:

> I'm a fan of using such a tool for quality improvements.
> They usually find a lot of "smelly" code. Only problem: they usually 
> find to much to deal with... It's totally frustrating that your piece of 
> software has 3478 defects. If it said here are the top 20 things to 
> improve, it would be much more motivating...
> 
> I think makes sense to start with settings that allow to find only very 
> few defects (say unused local variables).

I only had a quick look at checkstyle (and btw. it crashed my Eclipse 3M7
when run with OJB), but a lot of checks seem to be dealing with coding
style (including comments). So, using checkstyle would mean agreeing on a 
coding style for OJB first, right ? (which would be a good thing
IMO) Though I guess that we can enforce some parts of a coding style in a
proactive way using pretty printers and formatting rules (e.g. Eclipse 3).

There appear to be other, really useful checks in checkstyle though,
particularily finding duplicated code (using free-for-noncommercial-use
plugin of Simian ?)

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: checkstyle for ojb ?

Posted by Thomas Mahler <th...@web.de>.
Hi Jakob,

I'm a fan of using such a tool for quality improvements.
They usually find a lot of "smelly" code. Only problem: they usually 
find to much to deal with... It's totally frustrating that your piece of 
software has 3478 defects. If it said here are the top 20 things to 
improve, it would be much more motivating...

I think makes sense to start with settings that allow to find only very 
few defects (say unused local variables).

cheers,
Thomas

Jakob Braeuchi wrote:
> hi all,
> 
> i'm currently experimenting (playing) with checkstyle 3.3. i use a 
> plugin for eclipse http://sourceforge.net/projects/eclipse-cs/ .
> 
> imo we could improve code-quality with the help of checkstyle. the 
> downside is the huge initial effort to cleanup the whole source. to 
> reduce this effort i have customized the checkstyle-config to weaken 
> some of the rules but i still have thousands of warnings :(
> 
> what do you think about using a tool like checkstyle for ojb ?
> 
> jakob
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org