Skip to content
Calculate the Cyclomatic Complexity of a CSS selector
JavaScript
Branch: master
Clone or download
Latest commit dda70c9 Jun 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml Initial commit Jun 11, 2019
index.js fix analysis for negated and complex selectors Jun 17, 2019
license Initial commit Jun 11, 2019
package-lock.json 0.1.2 Jun 18, 2019
package.json 0.1.2 Jun 18, 2019
readme.md fix npm badge in readme Jun 15, 2019
test.js fix analysis for negated and complex selectors Jun 17, 2019

readme.md

css-selector-complexity

Calculate the Cyclomatic Complexity of a CSS selector

NPM Version Weekly downloads Build Status Known Vulnerabilities Dependencies Status Dependencies Status XO code style Project: Wallace

Installation

npm install css-selector-complexity

Usage

const complexity = require('css-selector-complexity')
console.log(complexity('.my > #brutal ~ [css]:first-child + selector'))
//-> 5

Credits

The idea for this package originated from the following blog posts:

Related projects

You can’t perform that action at this time.