No commit activity in last 3 years
No release in over 3 years
A puppet-lint plugin to check code quality metrics.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

puppet-lint-metrics-check

Build Status Gem Version Gem Downloads

A puppet-lint plugin to analyze your code and report code quality metrics. Right now this code only supports the Assignment Branch Condition metric. For more information on how we compute this metric, please see docs/abc_metric.md.

Installing

From the command line

$ gem install puppet-lint-metrics-check

In a Gemfile

gem 'puppet-lint-metrics-check'

Checks

Assignment Branch Condition Size

This check calculates the Assignment Branch Condition (ABC) size for your manifest. By default, if the ABC size calculated for your manifest is above 30 a warning will be reported, if it's above 100 puppet-lint will report an error.

You can customize the warning and error thresholds using the PuppetLint.configuration.metrics_abc_error and PuppetLint.configuration.metrics_abc_warning methods. You can configure these values in your Rakefile.

To set the error threshold to 50

PuppetLint.configuration.metrics_abc_error = 50

To set the warning threshold to 10

PuppetLint.configuration.metrics_abc_warning = 10

Disabling the check

To disable this check, you can add --no-abc_metric-check to your puppet-lint command line.

$ puppet-lint --no-abc_metric-check path/to/file.pp

Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your Rakefile.

PuppetLint.configuration.send('disable_abc_metric')