beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEAM-176) Enable FindBugs static analysis during maven build
Date Thu, 19 May 2016 20:11:12 GMT

    [ https://issues.apache.org/jira/browse/BEAM-176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15292051#comment-15292051
] 

ASF GitHub Bot commented on BEAM-176:
-------------------------------------

GitHub user swegner opened a pull request:

    https://github.com/apache/incubator-beam/pull/357

    [BEAM-176] Add FindBugs analysis to the build

    Be sure to do all of the following to help us incorporate your contribution
    quickly and easily:
    
     - [ ] Make sure the PR title is formatted like:
       `[BEAM-<Jira issue #>] Description of pull request`
     - [ ] Make sure tests pass via `mvn clean verify`. (Even better, enable
           Travis-CI on your fork and ensure the whole test matrix passes).
     - [ ] Replace `<Jira issue #>` in the title with the actual Jira issue
           number, if there is one.
     - [ ] If this contribution is large, please file an Apache
           [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.txt).
    
    ---
    
    FindBugs is a static analysis tool which looks for common coding issues in Java code.
See: http://findbugs.sourceforge.net/
    
    This PR integrates FindBugs into the build process using findbugs-maven-plugin, and subscribes
java-sdk-all for analysis.
    
    The codebase currently generates many Findbugs issues, which have been added in the findbugs-filter.xml
file as a baseline. These issues should be triaged and fixed over time.
    
    There will be some cases where we choose to ignore issues reported by FindBugs. In such
a case, the issue should be suppressed in code via the `@SuppressFBWarnings` annotation with
a comment describing why it is suppressed.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/swegner/incubator-beam findbugs

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-beam/pull/357.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #357
    
----
commit 10bd439e0650c183bb667366399444ef0998bd04
Author: Scott Wegner <swegner@google.com>
Date:   2016-05-16T22:44:45Z

    Add FindBugs analysis to the build
    
    FindBugs is a static analysis tool which looks for common
    coding issues in Java code. See: http://findbugs.sourceforge.net/
    
    This commit integrates FindBugs into the build process using
    findbugs-maven-plugin, and subscribes java-sdk-all for analysis.
    
    The codebase currently generates many Findbugs issues, which have
    been added in the findbugs-filter.xml file as a baseline. These issues
    should be triaged and fixed over time.
    
    There will be some cases where we choose to ignore issues reported by
    FindBugs. In such a case, the issue should be suppressed in code via
    the @SuppressFBWarnings annotation with a comment describing why it
    is suppressed.

commit f8706b536788ebbe415648a7658a9bd599ada7ad
Author: Scott Wegner <swegner@google.com>
Date:   2016-05-16T23:39:39Z

    Disable not useful DM_STRING_CTOR warnings
    
    These seem to pop up for normal string concatenation.

commit 195bd8e435eeade822e5d9a0798df633c23a2149
Author: Scott Wegner <swegner@google.com>
Date:   2016-05-19T18:47:02Z

    Fix AvroCoder log message null reference.

commit feaaac1492977f06bcc2dc5980ca7a3f63dacffe
Author: Scott Wegner <swegner@google.com>
Date:   2016-05-19T19:53:23Z

    Suppress FindBugs warning for checked null dereference

commit 94b79eb8a11e107ed3a78873bc050a9d33351913
Author: Scott Wegner <swegner@google.com>
Date:   2016-05-19T19:58:34Z

    Disable not nuseful SE_NO_SERIALVERSIONID warnings

----


> Enable FindBugs static analysis during maven build
> --------------------------------------------------
>
>                 Key: BEAM-176
>                 URL: https://issues.apache.org/jira/browse/BEAM-176
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-java-core
>            Reporter: Scott Wegner
>         Attachments: FindBugsResult_4_6_16_9_42_AM.html, FindBugsResult_4_6_16_9_42_AM.xml
>
>
> [FindBugs|http://findbugs.sourceforge.net/] is a java static analysis tools to find common
coding issues that may result in bugs.
> Running it over Beam repository with default configuration surfaces 195 "bugs", 20 categorized
as "high priority". Browsing through, some are obvious issues that should be fixed. For example:
> bq. [FileBasedSink.java:635|https://github.com/apache/incubator-beam/blob/9793fa2c860279b8c90254260c87e5665b000254/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/io/FileBasedSink.java#L635]:
More arguments are passed than are actually used in the format string
> bq. [ApproximateQuantiles.java:346|https://github.com/apache/incubator-beam/blob/9793fa2c860279b8c90254260c87e5665b000254/sdks/java/core/src/main/java/com/google/cloud/dataflow/sdk/transforms/ApproximateQuantiles.java#L346]:
Integral value cast to double and then passed to Math.ceil
> FindBugs also has a [maven plugin|http://gleclaire.github.io/findbugs-maven-plugin/index.html],
which can be used to either generate a report of found-issues, or fail the build.
> I recommend we enable FindBugs as a quality gate during our build.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message