{"id":13779568,"url":"https://github.com/tomasbjerre/violations-lib","last_synced_at":"2025-04-12T14:57:55.313Z","repository":{"id":4169702,"uuid":"52020623","full_name":"tomasbjerre/violations-lib","owner":"tomasbjerre","description":"Java library for parsing report files from static code analysis.","archived":false,"fork":false,"pushed_at":"2025-03-02T07:55:36.000Z","size":2202,"stargazers_count":148,"open_issues_count":11,"forks_count":40,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T14:57:48.949Z","etag":null,"topics":["android-lint","checkstyle","clang","codenarc","cppcheck","cpplint","css-linter","detekt","eslint","findbugs","golint","jshint","ktlint","phpcs","resharper","rubycop","spotbugs","static-code-analysis","stylecop","swiftlint"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomasbjerre.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-18T16:17:39.000Z","updated_at":"2025-03-02T07:55:09.000Z","dependencies_parsed_at":"2024-01-15T04:06:53.765Z","dependency_job_id":"1f439129-505c-4ca6-9360-be28c596ce54","html_url":"https://github.com/tomasbjerre/violations-lib","commit_stats":{"total_commits":683,"total_committers":30,"mean_commits":"22.766666666666666","dds":0.08638360175695459,"last_synced_commit":"cf2e91091c132286447c1fd61d12371a1d014172"},"previous_names":[],"tags_count":187,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fviolations-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fviolations-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fviolations-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasbjerre%2Fviolations-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasbjerre","download_url":"https://codeload.github.com/tomasbjerre/violations-lib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586249,"owners_count":21128997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-lint","checkstyle","clang","codenarc","cppcheck","cpplint","css-linter","detekt","eslint","findbugs","golint","jshint","ktlint","phpcs","resharper","rubycop","spotbugs","static-code-analysis","stylecop","swiftlint"],"created_at":"2024-08-03T18:01:06.542Z","updated_at":"2025-04-12T14:57:55.263Z","avatar_url":"https://github.com/tomasbjerre.png","language":"Java","readme":"# Violations Lib\n\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/se.bjurr.violations/violations-lib/badge.svg)](https://maven-badges.herokuapp.com/maven-central/se.bjurr.violations/violations-lib)\n\nThis is a Java library for parsing report files like static code analysis.\n\nExample of supported reports are available [here](https://github.com/tomasbjerre/violations-lib/tree/master/src/test/resources).\n\n| Version             | Java Version |\n| --------------------| ------------ |\n| version \u003c 1.156.8   | 8            |\n| 1.156.8 \u003c= version  | 11           |\n\nA number of **parsers** have been implemented. Some **parsers** can parse output from several **reporters**.\n\n| Reporter | Parser | Notes\n| --- | --- | ---\n| [_ARM-GCC_](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm)               | `CLANG`              | \n| [_AndroidLint_](http://developer.android.com/tools/help/lint.html)                    | `ANDROIDLINT`        | \n| [_Ansible-Later_](https://github.com/thegeeklab/ansible-later)                        | `ANSIBLELATER`       | With `json` format\n| [_AnsibleLint_](https://github.com/willthames/ansible-lint)                           | `FLAKE8`             | With `-p`\n| [_Bandit_](https://github.com/PyCQA/bandit)                                           | `CLANG`              | With `bandit -r examples/ -f custom -o bandit.out --msg-template \"{abspath}:{line}: {severity}: {test_id}: {msg}\"`\n| [_CLang_](https://clang-analyzer.llvm.org/)                                           | `CLANG`              | \n| [_CPD_](http://pmd.sourceforge.net/pmd-4.3.0/cpd.html)                                | `CPD`                | \n| [_CPPCheck_](http://cppcheck.sourceforge.net/)                                        | `CPPCHECK`           | With `cppcheck test.cpp --output-file=cppcheck.xml --xml`\n| [_CPPLint_](https://github.com/theandrewdavis/cpplint)                                | `CPPLINT`            | \n| [_CSSLint_](https://github.com/CSSLint/csslint)                                       | `CSSLINT`            | \n| [_Checkstyle_](http://checkstyle.sourceforge.net/)                                    | `CHECKSTYLE`         | \n| [_CloudFormation Linter_](https://github.com/aws-cloudformation/cfn-lint)             | `JUNIT`              | `cfn-lint . -f junit --output-file report-junit.xml`\n| [_CodeClimate_](https://codeclimate.com/)                                             | `CODECLIMATE`        | \n| [_CodeNarc_](http://codenarc.sourceforge.net/)                                        | `CODENARC`           | \n| [_Coverity_](https://scan.coverity.com/)                                              | `COVERITY`           | \n| [_Dart_](https://dart.dev/)                                                           | `MACHINE`            | With `dart analyze --format=machine`\n| [_Dependency Check_](https://jeremylong.github.io/DependencyCheck/)                   | `SARIF`              | Using `--format SARIF`\n| [_Detekt_](https://github.com/arturbosch/detekt)                                      | `CHECKSTYLE`         | With `--output-format xml`.\n| [_DocFX_](http://dotnet.github.io/docfx/)                                             | `DOCFX`              | \n| [_Doxygen_](https://www.stack.nl/~dimitri/doxygen/)                                   | `CLANG`              | \n| [_ERB_](https://www.puppetcookbook.com/posts/erb-template-validation.html)            | `CLANG`              | With `erb -P -x -T '-' \"${it}\" \\| ruby -c 2\u003e\u00261 \u003e/dev/null \\| grep '^-' \\| sed -E 's/^-([a-zA-Z0-9:]+)/${filename}\\1 ERROR:/p' \u003e erbfiles.out`.\n| [_ESLint_](https://github.com/sindresorhus/grunt-eslint)                              | `CHECKSTYLE`         | With `format: 'checkstyle'`.\n| [_Findbugs_](http://findbugs.sourceforge.net/)                                        | `FINDBUGS`           | \n| [_Flake8_](http://flake8.readthedocs.org/en/latest/)                                  | `FLAKE8`             | \n| [_FxCop_](https://en.wikipedia.org/wiki/FxCop)                                        | `FXCOP`              | \n| [_GCC_](https://gcc.gnu.org/)                                                         | `CLANG`              | \n| [_GHS_](https://www.ghs.com/)                                                         | `GHS`                | \n| [_Gendarme_](http://www.mono-project.com/docs/tools+libraries/tools/gendarme/)        | `GENDARME`           | \n| [_Generic reporter_]()                                                                | `GENERIC`            | Will create one single violation with all the content as message.\n| [_GoLint_](https://github.com/golang/lint)                                            | `GOLINT`             | \n| [_GoVet_](https://golang.org/cmd/vet/)                                                | `GOLINT`             | Same format as GoLint.\n| [_GolangCI-Lint_](https://github.com/golangci/golangci-lint/)                         | `CHECKSTYLE`         | With `--out-format=checkstyle`.\n| [_GoogleErrorProne_](https://github.com/google/error-prone)                           | `GOOGLEERRORPRONE`   | \n| [_HadoLint_](https://github.com/hadolint/hadolint/)                                   | `CHECKSTYLE`         | With `-f checkstyle`\n| [_IAR_](https://www.iar.com/iar-embedded-workbench/)                                  | `IAR`                | With `--no_wrap_diagnostics`\n| [_Infer_](http://fbinfer.com/)                                                        | `PMD`                | Facebook Infer. With `--pmd-xml`.\n| [_JACOCO_](https://www.jacoco.org/)                                                   | `JACOCO`             | \n| [_JCReport_](https://github.com/jCoderZ/fawkez/wiki/JcReport)                         | `JCREPORT`           | \n| [_JSHint_](http://jshint.com/)                                                        | `JSLINT`             | With `--reporter=jslint` or the CHECKSTYLE parser with `--reporter=checkstyle`\n| [_JUnit_](https://junit.org/junit4/)                                                  | `JUNIT`              | It only contains the failures.\n| [_KTLint_](https://github.com/shyiko/ktlint)                                          | `CHECKSTYLE`         | \n| [_Klocwork_](http://www.klocwork.com/products-services/klocwork/static-code-analysis)  | `KLOCWORK`           | \n| [_KotlinGradle_](https://github.com/JetBrains/kotlin)                                 | `KOTLINGRADLE`       | Output from Kotlin Gradle Plugin.\n| [_KotlinMaven_](https://github.com/JetBrains/kotlin)                                  | `KOTLINMAVEN`        | Output from Kotlin Maven Plugin.\n| [_Lint_]()                                                                            | `LINT`               | A common XML format, used by different linters.\n| [_MSBuildLog_](https://docs.microsoft.com/en-us/visualstudio/msbuild/obtaining-build-logs-with-msbuild?view=vs-2019)  | `MSBULDLOG`          | With `-fileLogger` use `.*msbuild\\\\.log$` as pattern or `-fl -flp:logfile=MyProjectOutput.log;verbosity=diagnostic` for a custom output filename\n| [_MSCpp_](https://visualstudio.microsoft.com/vs/features/cplusplus/)                  | `MSCPP`              | \n| [_Mccabe_](https://pypi.python.org/pypi/mccabe)                                       | `FLAKE8`             | \n| [_MyPy_](https://pypi.python.org/pypi/mypy-lang)                                      | `MYPY`               | \n| [_NullAway_](https://github.com/uber/NullAway)                                        | `GOOGLEERRORPRONE`   | Same format as Google Error Prone.\n| [_PCLint_](http://www.gimpel.com/html/pcl.htm)                                        | `PCLINT`             | PC-Lint using the same output format as the Jenkins warnings plugin, [_details here_](https://wiki.jenkins.io/display/JENKINS/PcLint+options)\n| [_PHPCS_](https://github.com/squizlabs/PHP_CodeSniffer)                               | `CHECKSTYLE`         | With `phpcs api.php --report=checkstyle`.\n| [_PHPPMD_](https://phpmd.org/)                                                        | `PMD`                | With `phpmd api.php xml ruleset.xml`.\n| [_PMD_](https://pmd.github.io/)                                                       | `PMD`                | \n| [_Pep8_](https://github.com/PyCQA/pycodestyle)                                        | `FLAKE8`             | \n| [_PerlCritic_](https://github.com/Perl-Critic)                                        | `PERLCRITIC`         | \n| [_PiTest_](http://pitest.org/)                                                        | `PITEST`             | \n| [_ProtoLint_](https://github.com/yoheimuta/protolint)                                 | `PROTOLINT`          | \n| [_Puppet-Lint_](http://puppet-lint.com/)                                              | `CLANG`              | With `-log-format %{fullpath}:%{line}:%{column}: %{kind}: %{message}`\n| [_PyDocStyle_](https://pypi.python.org/pypi/pydocstyle)                               | `PYDOCSTYLE`         | \n| [_PyFlakes_](https://pypi.python.org/pypi/pyflakes)                                   | `FLAKE8`             | \n| [_PyLint_](https://www.pylint.org/)                                                   | `PYLINT`             | With `pylint --output-format=parseable`.\n| [_ReSharper_](https://www.jetbrains.com/resharper/)                                   | `RESHARPER`          | \n| [_RubyCop_](http://rubocop.readthedocs.io/en/latest/formatters/)                      | `CLANG`              | With `rubycop -f clang file.rb`\n| [_SARIF_](https://github.com/oasis-tcs/sarif-spec)                                    | `SARIF`              | v2.x. Microsoft Visual C# can generate it with `ErrorLog=\"BuildErrors.sarif,version=2\"`.\n| [_SbtScalac_](http://www.scala-sbt.org/)                                              | `SBTSCALAC`          | \n| [_Scalastyle_](http://www.scalastyle.org/)                                            | `CHECKSTYLE`         | \n| [_Semgrep_](https://semgrep.dev/)                                                     | `SEMGREP`            | With `--json`.\n| [_Simian_](http://www.harukizaemon.com/simian/)                                       | `SIMIAN`             | \n| [_Sonar_](https://www.sonarqube.org/)                                                 | `SONAR`              | With `mvn sonar:sonar -Dsonar.analysis.mode=preview -Dsonar.report.export.path=sonar-report.json`. Removed in 7.7, see [SONAR-11670](https://jira.sonarsource.com/browse/SONAR-11670) but can be retrieved with: `curl --silent 'http://sonar-server/api/issues/search?componentKeys=unique-key\u0026resolved=false' \\| jq -f sonar-report-builder.jq \u003e sonar-report.json`.\n| [_Spotbugs_](https://spotbugs.github.io/)                                             | `FINDBUGS`           | \n| [_StyleCop_](https://stylecop.codeplex.com/)                                          | `STYLECOP`           | \n| [_SwiftLint_](https://github.com/realm/SwiftLint)                                     | `CHECKSTYLE`         | With `--reporter checkstyle`.\n| [_TSLint_](https://palantir.github.io/tslint/usage/cli/)                              | `CHECKSTYLE`         | With `-t checkstyle`\n| [_Valgrind_](https://valgrind.org/)                                                   | `VALGRIND`           | With `--xml=yes`.\n| [_XMLLint_](http://xmlsoft.org/xmllint.html)                                          | `XMLLINT`            | \n| [_XUnit_](https://xunit.net/)                                                         | `XUNIT`              | It only contains the failures.\n| [_YAMLLint_](https://yamllint.readthedocs.io/en/stable/index.html)                    | `YAMLLINT`           | With `-f parsable`\n| [_ZPTLint_](https://pypi.python.org/pypi/zptlint)                                     | `ZPTLINT`            |\n\n52 parsers and 79 reporters.\n\nMissing a format? Open an issue [here](https://github.com/tomasbjerre/violations-lib/issues)!\n\n## Usage\n\nVery easy to use with a nice builder pattern\n\n```java\n  List\u003cViolation\u003e violations = violationsReporterApi() //\n    .withPattern(\".*/findbugs/.*\\\\.xml$\") //\n    .inFolder(rootFolder) //\n    .findAll(FINDBUGS) //\n    .violations();\n```\n\nIt can also export the violations to the [_CodeClimate_](https://codeclimate.com/) and [_SARIF_](https://github.com/oasis-tcs/sarif-spec) formats with:\n\n* `.codeClimate()`\n* `.sarif()`\n\nIf you need to convert a report from one format to another, the [command line tool](https://github.com/tomasbjerre/violations-command-line/) is probably easiest to use.\n\nThe library is used in a bunch of other projects, these are some of them.\n\nCommand line:\n\n* [Violations Command Line](https://github.com/tomasbjerre/violations-command-line) Can parse, log, fail, and/or export to `CodeClimate` and `Sarif` files. `Sarif` is how GitHub is supported, and `CodeClimate` can be used with GitLab, see [README](https://github.com/tomasbjerre/violations-command-line).\n* [Violation Comments to GitLab Command Line](https://github.com/tomasbjerre/violation-comments-to-gitlab-command-line)\n* [Violation Comments to Bitbucket Server Command Line](https://github.com/tomasbjerre/violation-comments-to-bitbucket-server-command-line)\n* [Violation Comments to Bitbucket Cloud Command Line](https://github.com/tomasbjerre/violation-comments-to-bitbucket-cloud-command-line)\n\nGradle:\n\n* [Violations Gradle Plugin](https://github.com/tomasbjerre/violations-gradle-plugin).\n\nMaven:\n\n* [Violations Maven Plugin](https://github.com/tomasbjerre/violations-maven-plugin).\n\nJenkins:\n\n* [Violation Comments to GitLab Jenkins Plugin](https://github.com/jenkinsci/violation-comments-to-gitlab-plugin).\n* [Violation Comments to Bitbucket Server Jenkins Plugin](https://github.com/jenkinsci/violation-comments-to-stash-plugin).\n\nAnd these supporting libraries:\n\n* [Violation Comments to GitLab Lib](https://github.com/tomasbjerre/violation-comments-to-gitlab-lib).\n* [Violation Comments to Bitbucket Cloud Lib](https://github.com/tomasbjerre/violation-comments-to-bitbucket-cloud-lib).\n* [Violation Comments to Bitbucket Server Lib](https://github.com/tomasbjerre/violation-comments-to-bitbucket-server-lib).\n* [Violation Comments Lib](https://github.com/tomasbjerre/violation-comments-lib).\n* [Violations Git Lib](https://github.com/tomasbjerre/violations-git-lib).\n","funding_links":[],"categories":["Linters","静态分析","Programming Languages"],"sub_categories":["Language Agnostic"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasbjerre%2Fviolations-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasbjerre%2Fviolations-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasbjerre%2Fviolations-lib/lists"}