Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lsegal/complexity
Calculates the McCabe cyclomatic complexity index of the methods in your Ruby code.
https://github.com/lsegal/complexity
Last synced: about 2 months ago
JSON representation
Calculates the McCabe cyclomatic complexity index of the methods in your Ruby code.
- Host: GitHub
- URL: https://github.com/lsegal/complexity
- Owner: lsegal
- License: mit
- Created: 2009-09-06T04:24:38.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2009-09-06T18:27:59.000Z (over 15 years ago)
- Last Synced: 2024-05-02T05:33:30.788Z (8 months ago)
- Language: Ruby
- Homepage:
- Size: 82 KB
- Stars: 5
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Complexity
==========Written by Loren Segal in 2009
SYNOPSIS
--------Calculates the McCabe [cyclomatic complexity][1] index of the methods in your Ruby code.
The calculation is a basic `NUMBER_OF_BRANCHES + 1` calculation which can be used
this calculation to approximate the minimum number of test cases for each of
your methods ([complexity should equal number of test cases][3]). You can also use
this value to find overly complex method and refactor them into simpler ones.Some more reading can be found at [http://www.linuxjournal.com/article/8035][1].
USAGE
-----* Requires [YARD][3]
Syntax: `ruby complexity.rb [--csv] GLOB_OF_FILES`
If you want CSV output, add --csv. `GLOB_OF_FILES` defaults to `lib/**/*.rb`.
[1]: http://en.wikipedia.org/wiki/Cyclomatic_complexity "Cyclomatic Complexity"
[2]: http://users.csc.calpoly.edu/~jdalbey/206/Lectures/BasisPathTutorial/index.html "Basis Path Testing"
[3]: http://yard.soen.ca "Yay! A Ruby Documentation Tool"
[4]: http://www.linuxjournal.com/article/8035