Skip to content

Commit

Permalink
[Build] Reduced time to run findbugs by about 25% - upgraded to findb…
Browse files Browse the repository at this point in the history
…ugs 3.0; fixed excludes that were incorrect; excluding checks that aren't applicable to us; excluding categories that don't give us enough value.
  • Loading branch information
trishagee committed Aug 18, 2014
1 parent 9c6001f commit 0a24dee
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def slf4jVersion = '1.7.5'

allprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
Expand Down Expand Up @@ -85,6 +84,9 @@ allprojects {

findbugs {
excludeFilter = new File("$configDir/findbugs-exclude.xml")
toolVersion = '3.0.0'
effort = 'min'
reportLevel = 'high'
}

tasks.withType(AbstractCompile) {
Expand Down Expand Up @@ -121,10 +123,10 @@ allprojects {
task testCoverage(dependsOn: check)

tasks.withType(FindBugs) {
reports {
xml.enabled = project.buildingWith('xmlReports.enabled')
html.enabled = !project.buildingWith('xmlReports.enabled')
}
// reports {
// xml.enabled = project.buildingWith('xmlReports.enabled')
// html.enabled = !project.buildingWith('xmlReports.enabled')
// }
}

javadoc {
Expand Down
34 changes: 18 additions & 16 deletions config/findbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
<Match>
<Class name="~.*\.*Test.*"/>
<Not>
<Bug code="IJU, SE_BAD_FIELD, EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
<Bug code="IJU"/>
</Not>
</Match>
<Match>
<Class name="~.*\.*Test.*"/>
<Not>
<Bug pattern="SE_BAD_FIELD, EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
</Not>
</Match>
<Match>
Expand All @@ -13,33 +19,29 @@
</Match>
<Match>
<Class name="org.mongodb.morphia.testmodel.Hotel"/>
<Not>
<Bug code="EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
</Not>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.mongodb.morphia.utils.E1"/>
<Not>
<Bug code="SS_SHOULD_BE_STATIC"/>
</Not>
<Bug pattern="SS_SHOULD_BE_STATIC"/>
</Match>
<Match>
<Class name="relocated.morphia.org.apache.commons.collections.ReferenceMap"/>
<Not>
<Bug code="VO_VOLATILE_INCREMENT, URF_UNREAD_FIELD, WMI_WRONG_MAP_ITERATOR"/>
</Not>
<Bug pattern="VO_VOLATILE_INCREMENT, URF_UNREAD_FIELD, WMI_WRONG_MAP_ITERATOR"/>
</Match>
<Match>
<Class name="relocated.morphia.org.apache.commons.collections.ReferenceMap$EntryIterator"/>
<Not>
<Bug code="VO_VOLATILE_INCREMENT, URF_UNREAD_FIELD, WMI_WRONG_MAP_ITERATOR"/>
</Not>
<Bug pattern="VO_VOLATILE_INCREMENT, URF_UNREAD_FIELD, WMI_WRONG_MAP_ITERATOR"/>
</Match>
<Match>
<Class name="org.mongodb.morphia.mapping.MappedClass"/>
<Not>
<Bug code="WMI_WRONG_MAP_ITERATOR"/>
</Not>
<Bug pattern="WMI_WRONG_MAP_ITERATOR"/>
</Match>
<Match>
<Bug code="SQL,XSS,J2EE,SW,STI,DL,JLM,MWN,NN,RS,UL,HRS,PT,MTIA,XFB"/>
</Match>
<Match>
<Bug category="I18N,MT_CORRECTNESS,SECURITY,PERFORMANCE"/>
</Match>

</FindBugsFilter>

0 comments on commit 0a24dee

Please sign in to comment.