• Stars
    star
    144
  • Rank 255,590 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 9 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Java library for parsing report files from static code analysis.

Violations Lib

Maven Central

This is a Java library for parsing report files like static code analysis.

Example of supported reports are available here.

A number of parsers have been implemented. Some parsers can parse output from several reporters.

Reporter Parser Notes
ARM-GCC CLANG
AndroidLint ANDROIDLINT
Ansible-Later ANSIBLELATER With json format
AnsibleLint FLAKE8 With -p
Bandit CLANG With bandit -r examples/ -f custom -o bandit.out --msg-template "{abspath}:{line}: {severity}: {test_id}: {msg}"
CLang CLANG
CPD CPD
CPPCheck CPPCHECK With cppcheck test.cpp --output-file=cppcheck.xml --xml
CPPLint CPPLINT
CSSLint CSSLINT
Checkstyle CHECKSTYLE
CloudFormation Linter JUNIT cfn-lint . -f junit --output-file report-junit.xml
CodeClimate CODECLIMATE
CodeNarc CODENARC
Dart MACHINE With dart analyze --format=machine
Dependency Check SARIF Using --format SARIF
Detekt CHECKSTYLE With --output-format xml.
DocFX DOCFX
Doxygen CLANG
ERB CLANG With erb -P -x -T '-' "${it}" | ruby -c 2>&1 >/dev/null | grep '^-' | sed -E 's/^-([a-zA-Z0-9:]+)/${filename}\1 ERROR:/p' > erbfiles.out.
ESLint CHECKSTYLE With format: 'checkstyle'.
Findbugs FINDBUGS
Flake8 FLAKE8
FxCop FXCOP
GCC CLANG
GHS GHS
Gendarme GENDARME
Generic reporter GENERIC Will create one single violation with all the content as message.
GoLint GOLINT
GoVet GOLINT Same format as GoLint.
GolangCI-Lint CHECKSTYLE With --out-format=checkstyle.
GoogleErrorProne GOOGLEERRORPRONE
HadoLint CHECKSTYLE With -f checkstyle
IAR IAR With --no_wrap_diagnostics
Infer PMD Facebook Infer. With --pmd-xml.
JACOCO JACOCO
JCReport JCREPORT
JSHint JSLINT With --reporter=jslint or the CHECKSTYLE parser with --reporter=checkstyle
JUnit JUNIT It only contains the failures.
KTLint CHECKSTYLE
Klocwork KLOCWORK
KotlinGradle KOTLINGRADLE Output from Kotlin Gradle Plugin.
KotlinMaven KOTLINMAVEN Output from Kotlin Maven Plugin.
Lint LINT A common XML format, used by different linters.
MSBuildLog MSBULDLOG With -fileLogger use .*msbuild\\.log$ as pattern or -fl -flp:logfile=MyProjectOutput.log;verbosity=diagnostic for a custom output filename
MSCpp MSCPP
Mccabe FLAKE8
MyPy MYPY
NullAway GOOGLEERRORPRONE Same format as Google Error Prone.
PCLint PCLINT PC-Lint using the same output format as the Jenkins warnings plugin, details here
PHPCS CHECKSTYLE With phpcs api.php --report=checkstyle.
PHPPMD PMD With phpmd api.php xml ruleset.xml.
PMD PMD
Pep8 FLAKE8
PerlCritic PERLCRITIC
PiTest PITEST
ProtoLint PROTOLINT
Puppet-Lint CLANG With -log-format %{fullpath}:%{line}:%{column}: %{kind}: %{message}
PyDocStyle PYDOCSTYLE
PyFlakes FLAKE8
PyLint PYLINT With pylint --output-format=parseable.
ReSharper RESHARPER
RubyCop CLANG With rubycop -f clang file.rb
SARIF SARIF v2.x. Microsoft Visual C# can generate it with ErrorLog="BuildErrors.sarif,version=2".
SbtScalac SBTSCALAC
Scalastyle CHECKSTYLE
Semgrep SEMGREP With --json.
Simian SIMIAN
Sonar SONAR With mvn sonar:sonar -Dsonar.analysis.mode=preview -Dsonar.report.export.path=sonar-report.json. Removed in 7.7, see SONAR-11670 but can be retrieved with: curl --silent 'http://sonar-server/api/issues/search?componentKeys=unique-key&resolved=false' | jq -f sonar-report-builder.jq > sonar-report.json.
Spotbugs FINDBUGS
StyleCop STYLECOP
SwiftLint CHECKSTYLE With --reporter checkstyle.
TSLint CHECKSTYLE With -t checkstyle
Valgrind VALGRIND With --xml=yes.
XMLLint XMLLINT
XUnit XUNIT It only contains the failures.
YAMLLint YAMLLINT With -f parsable
ZPTLint ZPTLINT

51 parsers and 78 reporters.

Missing a format? Open an issue here!

Usage

Very easy to use with a nice builder pattern

  List<Violation> violations = violationsReporterApi() //
    .withPattern(".*/findbugs/.*\\.xml$") //
    .inFolder(rootFolder) //
    .findAll(FINDBUGS) //
    .violations();

It can also export the violations to the CodeClimate and SARIF formats with:

  • .codeClimate()
  • .sarif()

If you need to convert a report from one format to another, the command line tool is probably easiest to use.

The library is used in a bunch of other projects, these are some of them.

GitHub Action:

Command line:

Gradle:

Maven:

Jenkins:

And these supporting libraries:

More Repositories

1

git-changelog-lib

Generate changelog, and/or next version, with, or without, conventional commits from a GIT repository
Java
195
star
2

pull-request-notifier-for-bitbucket

Bitbucket Server plugin that invokes a custom URL when a pull request event is triggered.
Java
186
star
3

starta-eget-konsultbolag

Beskriver hur man startar och driver eget konsultbolag, aktiebolag.
164
star
4

jenkins-configuration-as-code-sandbox

Jenkins Configuration as Code, JCasC, Job DSL, Pipeline, Shared library
Groovy
108
star
5

git-changelog-maven-plugin

Maven plugin that can generate a changelog, or releasenotes, from git repository
Java
77
star
6

git-changelog-gradle-plugin

Automate changelog and versioning with conventional commits and Git.
Java
77
star
7

RaspberrySurveillance

Surveillance system designed for Raspberry PI
PHP
51
star
8

git-changelog-command-line

Command line tool to generate changelog, or releasenotes, from a git repository and a Handlebars template.
Java
46
star
9

violation-comments-to-github-gradle-plugin

A plugin for Gradle that will find report files from static code analysis and comment pull requests in GItHub with them.
Java
28
star
10

simple-bitbucket-commit-checker

Simple, and easy to use, commit checker for Atlassian Bitbucket Server
Java
21
star
11

violation-comments-to-github-lib

A library for commenting GitHub with violations from static code analyzer reports.
Java
21
star
12

yet-another-kotlin-vs-java-comparison

Shows complete examples where the Kotlin code is compiled to bytecode and decompiled to Java
Java
18
star
13

violations-gradle-plugin

Gradle plugin that will find report files from static code analysis, present and optionally fail the build.
Java
17
star
14

violations-command-line

Command line tool that will find report files from static code analysis, present and optionally fail the command.
Java
14
star
15

gradle-scripts

Releasing to Maven Central, Changelog generation, version management with conventional commits... a highly configurable shared Gradle script.
JavaScript
13
star
16

violation-comments-lib

Library for commenting things with violations from static code analysis.
Java
12
star
17

git-changelog-bitbucket-plugin

Atlassian Bitbucket plugin for generating changelog, or releasenotes
Java
12
star
18

bjurrcom

Ghost blog running on GitHub pages.
SCSS
11
star
19

violation-comments-to-bitbucket-cloud-command-line

Report static code analysis to Bitbucket Cloud
Java
11
star
20

violation-comments-to-gitlab-command-line

Report static code analysis to GitLab
Java
9
star
21

bitbucket-server-jenkins-release-tags

Demo of using Bitbucket Server with Jenkins to perform releases by pushing tags to Git.
Shell
9
star
22

violation-comments-to-gitlab-gradle-plugin

A plugin for Gradle that will find report files from static code analysis and comment merge requests in GItLab with them. Edit Add topics
Java
9
star
23

java-method-invocation-builder

Enables default values of method parameters in Java and is making the invocations readable.
Java
7
star
24

settings-synchronizer-for-bitbucket-plugin

Synchronize repository settings in Atlassian Bitbucket Server
Java
7
star
25

violation-comments-to-bitbucket-server-command-line

Report static code analysis to Bitbucket Server
Java
6
star
26

violation-comments-to-bitbucket-server-lib

A library for commenting Bitbucket Server with violations from static code analyzer reports.
Java
5
star
27

violation-comments-action

A GitHub action to help use violation-comments-to-github-command-line.
4
star
28

violation-comments-to-gitlab-lib

Comment gitlab with violations found with static code analysis.
Java
4
star
29

violations-maven-plugin

Maven plugin that will find report files from static code analysis, present and optionally fail the build.
Java
4
star
30

violation-comments-to-gitlab-maven-plugin

A plugin for Maven that will find report files from static code analysis and comment merge requests in GItLab with them. Edit Add topics Edit Add topics
Java
4
star
31

violation-comments-to-github-maven-plugin

A plugin for Maven that will find report files from static code analysis and comment pull requests in GItHub with them.
Java
3
star
32

dictator-builder

Let it dictate the filesystem. Avoid code duplication in template, or boilerplate, projects.
TypeScript
3
star
33

violation-comments-to-github-command-line

Report static code analysis to GitHub
Java
3
star
34

pom-dependency-analyzer

Analyzes the output of mvn dependency:tree -DoutputType=dot -Doutput=file.dot -f pom.xml
Java
3
star
35

pom-dependency-analyzer-web

Browsable webpage, and API, with dependents, and dependencies, of Maven artifacts
Shell
3
star
36

npm-java-runner

Package JAR-files within runnable NPM packages
JavaScript
2
star
37

generate-codeowners

Generate a CODEOWNERS-file based on Git history.
TypeScript
2
star
38

HTMLUnitGenerator

Enables user friendly and powerful front end testing of web applications with minimum required effort to implement.
Java
2
star
39

plantuml-cli

Plantuml wrapped in an NPM package so that it can be run with 'npx plantuml-cli'.
Shell
2
star
40

runnable-jar-to-docker

Package runnable jars into Docker images.
JavaScript
1
star
41

kubernetes

The result of me fiddling with Kubernetes, ArgoCD, Tekton, Helm...
Mustache
1
star
42

java-method-invocation-builder-annotations

The annotations used by Java method Invocation Builder
Java
1
star
43

spring-rest-client

Dynamically create Spring Rest (proxy class) client from annotated interface.
Java
1
star
44

pom-downloader

Given a Maven repository, it will download all pom-files.
Java
1
star
45

bitbucket-server-utils-cli

Bitbucket Server utilities packaged as a standalone command line tool.
TypeScript
1
star
46

bjurr-bom

Some Maven stuff for my projects
1
star
47

.github

1
star
48

violations-git-lib

Provides utilities for matching violations to local Git repository.
Java
1
star
49

bitbucket-cloud-java-rest-api

Bitbucket Cloud Java REST API
Shell
1
star