FAQ
The issue of unused variables and imports has come up for Hadoop.
Different folks use different development environments, not all of which
warn about the same things. Perhaps if we integrated a code checker
into Hadoop's build process then we could more easily guarantee that
commits are not made that contain such things.

The PMD project includes an Ant task that implements code checking:

http://pmd.sourceforge.net/ant-task.html

We could incorporate this into Hadoop's build.xml. We could add a
"pre-commit" task that performs this along with "clean", "test", and
perhaps "javadoc". The PMD rule sets that look reasonable to me are:
"Basic", "Unused Code", "Import Statements".

What do folks think?

Would anyone like to volunteer to add something like this to build.xml?

Doug

Search Discussions

  • Owen O'Malley at Apr 5, 2006 at 8:21 pm

    On Apr 5, 2006, at 12:07 PM, Doug Cutting wrote:

    The issue of unused variables and imports has come up for Hadoop.
    Different folks use different development environments, not all of
    which warn about the same things. Perhaps if we integrated a code
    checker into Hadoop's build process then we could more easily
    guarantee that commits are not made that contain such things.

    The PMD project includes an Ant task that implements code checking:
    Code checkers are good. The last time I used them, findBugs
    (http://findbugs.sourceforge.net/) was better than PMD in terms of both
    finding "real" things and a lower false positive rate.

    -- Owen
  • Doug Cutting at Apr 5, 2006 at 8:34 pm

    Owen O'Malley wrote:
    The last time I used them, findBugs
    (http://findbugs.sourceforge.net/) was better than PMD in terms of both
    finding "real" things and a lower false positive rate.
    Unfortunately FindBugs is under LGPL, so we could not include it in
    Hadoop's lib directory, but must rather get folks to install it themselves.

    Doug
  • Larry Ogrodnek at Apr 5, 2006 at 8:28 pm
    CheckStyle [http://checkstyle.sourceforge.net/] is also pretty neat.
    While it's more a coding style checker than a static code checker, it
    does report on unused imports, unnecessary modifiers/casting, cyclomatic
    complexity, etc.

    It might be worth setting up in addition to either PMD or findbugs.

    -----Original Message-----
    From: Owen O'Malley
    Sent: Wednesday, April 05, 2006 4:21 PM
    To: hadoop-dev@lucene.apache.org
    Subject: Re: code checker

    On Apr 5, 2006, at 12:07 PM, Doug Cutting wrote:

    The issue of unused variables and imports has come up for Hadoop.
    Different folks use different development environments, not all of
    which warn about the same things. Perhaps if we integrated a code
    checker into Hadoop's build process then we could more easily
    guarantee that commits are not made that contain such things.

    The PMD project includes an Ant task that implements code checking:
    Code checkers are good. The last time I used them, findBugs
    (http://findbugs.sourceforge.net/) was better than PMD in terms of both
    finding "real" things and a lower false positive rate.

    -- Owen

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-dev @
categorieshadoop
postedApr 5, '06 at 7:07p
activeApr 5, '06 at 8:34p
posts4
users3
websitehadoop.apache.org...
irc#hadoop

People

Translate

site design / logo © 2022 Grokbase