Git Product home page Git Product logo

css-complexity's Introduction

CSS Complexity Analyzer

Based on the article Cyclomatic Complexity in CSS, this is a tool that calculates the complexity of rulesets and stylesheets.

Pre-requisites

  • Node 18+
  • NPM 9+

Installation

npm install

Usage

TBD.

This will probably be developed to work both as a CLI and possibly to integrate into something like postcss & friends. Step 1 is to make this a CLI, though.

Contributing

As of right now the source files are being developed. Make sure any classes in src have corresponding tests in test.

Yeah see the contributing doc. This could use smart people.

css-complexity's People

Stargazers

RCH avatar Loïc Fürhoff avatar

Watchers

Paceaux avatar

css-complexity's Issues

Stylesheet complexity

Something that evaluates the whole stylesheet and determines the complexity of that stylesheet. it should produce data like:

  • number of rulesets
  • average complexity of a rule set
  • number of media queries
  • average complexity of a media query
  • standard deviation?
  • median complexity
  • most commonly used selectors?

CLI functionality

There should be code in cli.js that allows this to work as a CLI utility

It should take arguments like

  • fileName or glob
  • outputFileName

Media Query Complexity

We need probably a Media Query class that can calculate its own complexity. May need to rely on the CSSOM library.

It should recognize any @ rules, and determine the number of arguments it contains and produce a weight.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.