All Projects → Inform-Software → sonar-groovy

Inform-Software / sonar-groovy

Licence: LGPL-3.0, Unknown licenses found Licenses found LGPL-3.0 LICENSE.txt Unknown LICENSE-header-java.txt
SonarQube plugin for Groovy

Programming Languages

java
68154 projects - #9 most used programming language
groovy
2714 projects

Projects that are alternatives of or similar to sonar-groovy

npm-groovy-lint
Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line
Stars: ✭ 124 (+195.24%)
Mutual labels:  groovy-language, codenarc
sonar-css-plugin
SonarQube CSS / SCSS / Less Analyzer
Stars: ✭ 46 (+9.52%)
Mutual labels:  code-quality, sonarqube-plugin
sonar-gherkin-plugin
SonarQube Cucumber Gherkin Analyzer
Stars: ✭ 33 (-21.43%)
Mutual labels:  code-quality, sonarqube-plugin
superhelp
Python help that really helps
Stars: ✭ 27 (-35.71%)
Mutual labels:  code-quality
localhost-sonarqube
Analysing source code locally with SonarQube in a Docker environment.
Stars: ✭ 17 (-59.52%)
Mutual labels:  code-quality
docker-image-size-limit
🐳 Keep an eye on your docker image size and prevent it from growing too big
Stars: ✭ 102 (+142.86%)
Mutual labels:  code-quality
Imgbot
An Azure Function solution to crawl through all of your image files in GitHub and losslessly compress them. This will make the file size go down, but leave the dimensions and quality untouched. Once it's done, ImgBot will open a pull request for you to review and merge. [email protected]
Stars: ✭ 1,017 (+2321.43%)
Mutual labels:  code-quality
BowlerStudio
A Full-Stack Robotics Development Environment
Stars: ✭ 95 (+126.19%)
Mutual labels:  groovy-language
java-quality-checks
No description or website provided.
Stars: ✭ 33 (-21.43%)
Mutual labels:  code-quality
Zilon Roguelike
Survival roguelike game with huge world generation.
Stars: ✭ 18 (-57.14%)
Mutual labels:  code-quality
eclipse-pmd
eclipse-pmd has been moved to
Stars: ✭ 20 (-52.38%)
Mutual labels:  code-quality
inline-plz
Inline your lint messages
Stars: ✭ 32 (-23.81%)
Mutual labels:  code-quality
sonar-puppet
SonarQube plugin for Puppet code.
Stars: ✭ 27 (-35.71%)
Mutual labels:  sonarqube-plugin
sonar-coldfusion
SonarQube ColdFusion Analyzer
Stars: ✭ 25 (-40.48%)
Mutual labels:  sonarqube-plugin
godoc-generate
Default godoc generator - make your first steps towards better code documentation
Stars: ✭ 21 (-50%)
Mutual labels:  code-quality
wemake-frontend-styleguide
Set of the strictest linters for your next frontend app
Stars: ✭ 67 (+59.52%)
Mutual labels:  code-quality
javascript-test-reporter
DEPRECATED Code Climate test reporter client for JavaScript projects
Stars: ✭ 68 (+61.9%)
Mutual labels:  code-quality
scheduler
Laravel on my way
Stars: ✭ 20 (-52.38%)
Mutual labels:  code-quality
sonar-scala
A free and open-source SonarQube plugin for static code analysis of Scala projects.
Stars: ✭ 113 (+169.05%)
Mutual labels:  sonarqube-plugin
elodin-old
Quality and Optimisation tools for CSS in JavaScript
Stars: ✭ 15 (-64.29%)
Mutual labels:  code-quality

SonarQube plugin for Groovy

Build Status Quality Gate Status Coverage

Get test builds from GitHub Actions (click on a recent run and get the artifacts from the bottom of the page).

Description

This plugin enables analysis of Groovy within SonarQube.

It leverages CodeNarc to raise issues against coding rules and GMetrics for cyclomatic complexity.

For code coverage, the SonarQube JaCoCo plugin should be used. Additionally, this plugin still supports importing binary JaCoCo reports (deprecated, will be removed in the future) and Cobertura.

Plugin 1.4/1.5 1.6 1.7 1.8
CodeNarc 0.25.2 1.4 1.4 1.6.1
GMetrics 0.7 1.0 1.0 1.1
SonarQube 5.6-6.7 6.7-7.9 7.8-8.9 8.0-9.0

Steps to Analyze a Groovy Project

  1. Install SonarQube Server
  2. Install SonarQube Scanner and be sure you can call sonar-scanner from the directory where you have your source code
  3. Install the Groovy Plugin.
  4. Create a sonar-project.properties file at the root of your project
  5. Run sonar-scanner command from the project root dir
  6. Follow the link provided at the end of the analysis to browse your project's quality in SonarQube UI

Notes

CodeNarc: It is possible to reuse a previously generated report from CodeNarc by setting the sonar.groovy.codenarc.reportPaths property.

Groovy File Suffixes: It is possible to define multiple groovy file suffixes to be recognized by setting the sonar.groovy.file.suffixes property. Note that by default, only files having .groovy as extension will be analyzed.

Unit Tests Execution Reports: Import unit tests execution reports (JUnit XML format) by setting the sonar.junit.reportPaths property. Default location is target/surefire-reports.

JaCoCo and Binaries: The groovy plugin requires access to source binaries when analyzing JaCoCo reports. Consequently, property sonar.groovy.binaries has to be configured for the analysis (comma-separated paths to binary folders). For Maven and gradle projects, the property is automatically set.

Coverage Results Import

For coverage, it is recommended to use the generic SonarQube JaCoCo plugin instead of relying on this plugin to import coverage into SonarQube. Nevertheless, we support importing coverage from Cobertura (but this code path isn't used by the author of the plugin).

Code Coverage with Cobertura

To display code coverage data:

  1. Prior to the SonarQube analysis, execute your unit tests and generate the Cobertura XML report.
  2. Import this report while running the SonarQube analysis by setting the sonar.groovy.cobertura.reportPath property to the path to the Cobertura XML report. The path may be absolute or relative to the project base directory.

Contributions

Contributions via GitHub issues and pull requests are very welcome. This project tries to adhere to the Google Java Style, but we don't want a global reformat to keep the Git history readable. To help with this, we use the "ratchet" feature of spotless. If you get an error from spotless during build or CI, you can fix them with:

mvn spotless:apply

Updating CodeNarc

In the directory codenarc-converter there is a little helper tool to convert CodeNarc rules to SonarQube rules. To do its job it needs a source copy of CodeNarc - this is currently achieved by including the used CodeNarc version as a git subbmodule. If you need to update CodeNarc, you need to update that submodule too:

git submodule init
cd codenarc-converter/CodeNarc
git checkout vX.Y.Z
cd ..
git add CodeNarc

You should then run the codenarc-converter (Running mvn verify should be enough if the project is set up correctly) and merge descriptions from codenarc-converter/target/results/rules.xml into sonar-groovy-plugin/src/main/resources/org/sonar/plugins/groovy/rules.xml. The converter does a pretty crude job converting CodeNarc's APT documentation into SonarQube rule descriptions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].