Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure spotbugs #646

Merged
merged 6 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .lift.toml

This file was deleted.

4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - 2023-07-28
## [Unreleased] - 2023-08-04

### Added

Expand All @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Dependencies

### CI/CD
* Integrated SpotBugs into build process.
* Integrated Find Security Bugs into build process.

### Other

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ To include generation of a code coverage report during the build,
execute `mvn package -Pcoverage` at the root of the repository to
enable a Maven profile that executes JaCoCo during the test phase.

To run all static analysis tools (i.e., SpotBugs, Find Security Bugs,
refactor-first), execute `mvn package -Panalysis` to enable a Maven
profile that executes the various static analysis tools that we are
using. The SpotBugs html report will be found in the `target` directory,
or you can use the SpotBugs GUI with: `mvn spotbugs:gui -Panalysis`. The
refactor-first report will be found in the `target/site` directory.

To run all of the above: `mvn package -P "analysis,coverage"`.

## Example Programs

There are several example programs available in a separate repository:
Expand Down
26 changes: 25 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
</build>
</profile>
<profile>
<id>refactor</id>
<id>analysis</id>
<build>
<plugins>
<plugin>
Expand All @@ -202,6 +202,30 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.7.3.5</version>
<configuration>
<htmlOutput>true</htmlOutput>
<excludeFilterFile>${session.executionRootDirectory}/spotbugs-exclude.xml</excludeFilterFile>
<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>1.12.0</version>
</plugin>
</plugins>
</configuration>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>spotbugs</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
14 changes: 14 additions & 0 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<FindBugsFilter>
<!-- Methods for reading/writing instance files, filename responsibility of caller. -->
<Match>
<Bug code="SECPTI,SECPTO" />
<Package name="org.cicirello.search.problems.scheduling" />
</Match>

<!-- False positive exposed representation -->
<Match>
<Bug pattern="EI_EXPOSE_REP" />
<Class name="org.cicirello.search.concurrent.TimedParallelMultistarter" />
<Method name="getSearchHistory" />
</Match>
</FindBugsFilter>