Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ajm188/mccabe
Measure McCabe complexity of Ruby methods
https://github.com/ajm188/mccabe
mccabe ruby
Last synced: 4 days ago
JSON representation
Measure McCabe complexity of Ruby methods
- Host: GitHub
- URL: https://github.com/ajm188/mccabe
- Owner: ajm188
- License: mit
- Created: 2015-04-14T02:37:02.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-08T21:50:26.000Z (about 9 years ago)
- Last Synced: 2025-01-01T04:50:04.917Z (about 1 month ago)
- Topics: mccabe, ruby
- Language: Ruby
- Homepage:
- Size: 523 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# McCabe
Measure the McCabe or [cyclomatic](http://en.wikipedia.org/wiki/Cyclomatic_complexity)
complexity of Ruby code.## Installation
```
$ gem install mccabe
```## Usage
From the command line, pass the list of files you want to analyze. You can
optionally specify your own threshold as the first argument. The default
threshold is 4. You will get error messages for any methods which have
complexity greater than the threshold.Note that the script only considers files with .rb extensions, so that it
doesn't attempt to parse other languages as Ruby. So, if you have
extensionless Ruby scripts, you won't be able to use this on them.Examples:
```
mccabe file1 ../file2
mccabe file1 --threshold 3 # using a different threshold
mccabe *.rb # wildcards work, too
mccabe . # can also look through entire directories
mccabe . --quiet # will not print to stdout, only return success/failure status code
```## Contributing
Fork and pull.