All Projects → iwarapter → sonar-puppet

iwarapter / sonar-puppet

Licence: other
SonarQube plugin for Puppet code.

Programming Languages

java
68154 projects - #9 most used programming language
groovy
2714 projects
HTML
75241 projects
Puppet
460 projects
pascal
1382 projects

Projects that are alternatives of or similar to sonar-puppet

sonar-css-plugin
SonarQube CSS / SCSS / Less Analyzer
Stars: ✭ 46 (+70.37%)
Mutual labels:  sonarqube, sonarqube-plugin
sonar-scala
A free and open-source SonarQube plugin for static code analysis of Scala projects.
Stars: ✭ 113 (+318.52%)
Mutual labels:  sonarqube, sonarqube-plugin
sonar-gherkin-plugin
SonarQube Cucumber Gherkin Analyzer
Stars: ✭ 33 (+22.22%)
Mutual labels:  sonarqube, sonarqube-plugin
puppet-postfix
Puppet postfix module
Stars: ✭ 72 (+166.67%)
Mutual labels:  puppet
setup-sonar-scanner
Github Action which downloads and runs sonar-scanner cli with custom parameters to start Sonarqube scan.
Stars: ✭ 31 (+14.81%)
Mutual labels:  sonarqube
sonar-sql-plugin
SQL language (T-SQL, MySQL, Vertica and PostgreSQL dialects) plugin for SonarQube
Stars: ✭ 52 (+92.59%)
Mutual labels:  sonarqube
localhost-sonarqube
Analysing source code locally with SonarQube in a Docker environment.
Stars: ✭ 17 (-37.04%)
Mutual labels:  sonarqube
Puppet Rvm
A puppet module for installing and using RVM (Ruby Version Manager)
Stars: ✭ 252 (+833.33%)
Mutual labels:  puppet
puppet-archlinux-macbookretina
UNSUPPORTED - Puppet module and accompanying documentation to install/setup Arch linux on a MacBook Pro Retina 11,4
Stars: ✭ 64 (+137.04%)
Mutual labels:  puppet
masterclass-codeexamples
Code examples used in Get into DevOps: The Masterclass
Stars: ✭ 35 (+29.63%)
Mutual labels:  puppet
sbt-sonar
An sbt plugin which provides an easy way to integrate Scala projects with SonarQube.
Stars: ✭ 62 (+129.63%)
Mutual labels:  sonarqube
puppet-openldap
Manage OpenLDAP with Puppet
Stars: ✭ 35 (+29.63%)
Mutual labels:  puppet
NUSISS-DevOpsEng
NUS ISS DevOps Engineering - Git, Docker, Docker Compose, Puppet , AWS Code Pipeline/CodeStar, Docker , Kubernetes, Terraform, Ansible
Stars: ✭ 58 (+114.81%)
Mutual labels:  puppet
sonar-l10n-ru
Russian Language Pack for SonarQube
Stars: ✭ 33 (+22.22%)
Mutual labels:  sonarqube
puppet-st2
Puppet Module to install and configure StackStorm, IFTTT for Ops
Stars: ✭ 20 (-25.93%)
Mutual labels:  puppet
puppet-ssh keygen
Generation of ssh keys with ssh-keygen
Stars: ✭ 17 (-37.04%)
Mutual labels:  puppet
sonar-auth-aad
Azure Active Directory Authentication for SonarQube
Stars: ✭ 59 (+118.52%)
Mutual labels:  sonarqube
puppet-install-shell
A shell script to install puppet on multiple distros
Stars: ✭ 33 (+22.22%)
Mutual labels:  puppet
vagrant-magento
**DEPRECATED**
Stars: ✭ 12 (-55.56%)
Mutual labels:  puppet
rate-my-cat
Sample application for the book "Mastering Software Testing with JUnit 5"
Stars: ✭ 23 (-14.81%)
Mutual labels:  sonarqube

SonarQube Puppet Plugin

Build Status Gitter Coverage Status GitHub release GitHub license Technical debt ratio Quality Gate

Description

This plugin enables analysis of Puppet code. It comes with more than 60 rules spanning from style checks (i.e. All arrows in attribute/value list should be aligned) to detection of potential bugs (i.e. Duplicated parameters should be removed). This is currently written to support the grammar for Puppet 3.8, support for the future parser is not currently available.

Requirements

Getting Started in Less Than Two Minutes

To get started in less than two minutes, you can download the package at https://github.com/racodond/package-test-sonarqube-puppet and follow the instructions in the README file.

Getting Started

To run an analysis of your Puppet project, we recommend to use SonarQube Runner. There are two strategies:

  1. Analyze each of your modules separately
  2. Analyze all your modules at once

Analyze each of your modules separately

It means that one SonarQube project is created for each Puppet module. Let's take the Puppet Labs Apache module at https://github.com/puppetlabs/puppetlabs-apache as an example.

  • Clone this project (let's say in the /home/user/puppet directory)
  • Add a sonar-project.properties file to the /home/user/puppet directory with the following content:
sonar.projectKey=puppetlabs-apache
sonar.projectName=Puppet Labs Apache Module
sonar.sources=puppetlabs-apache
sonar.projectVersion=1.4.1
  • Run sonar-runner from /home/user/puppet

Analyze all your modules at once

It means that one single SonarQube project is created for all the Puppet modules.

  • Retrieve the source code of your modules with your favorite tool (such as r10k), let's say in /home/user/puppet. The tree structure should be the following:
/home/user/puppet
   |--modules
      |--mymodule1
         |--manifests
            |--init.pp
            |--...
      |--mymodule2
         |--manifests
            |--init.pp
            |--...
  • Add a sonar-project.properties file to the /home/user/puppet directory with the following content:
sonar.projectKey=my-puppet-code-base
sonar.projectName=My Puppet Code Base
sonar.sources=modules
sonar.projectVersion=1.0
  • Run sonar-runner from /home/user/puppet

Which strategy to choose?

The first strategy easily allows you to automate a SonarQube analysis of a module each time a developer pushes some code to the VCS. By providing a quick feedback to developers, you can ensure that quality flaws are quickly fixed.

The second strategy provides a quality overview of your entire Puppet Code Base and how it evolves overtime. Moreover, analyzing your whole code base at once allows you to benefit from more advanced cross-module checks (such as the autoloader layout rule).

We recommend you to apply both strategies to get all the benefits.

Metrics

The Puppet terms do not always match with the standard SonarQube metrics. Here's the list of slight differences:

  • Classes = Number of classes + Number of defines
  • Functions = Number of resources (including default resource and resource override)
  • Complexity is increased by one for each: class, define, resource instance, resource default statement, resource override, if, elsif, unless, selector match, case match, and, or.

Extending Coding Rules using XPath

New coding rules can be added using XPath. See the related documentation. To navigate the AST, download the SSLR Puppet Toolkit.

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].