Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Java CSS HTML Shell
Pull request Compare This branch is 383 commits ahead of kalidasya:master.

README.md

SonarQube CSS Plugin

Build Status

Project homepage: https://github.com/SonarCommunity/sonar-css

Issue tracking: https://github.com/SonarCommunity/sonar-css/issues

CI builds: https://travis-ci.org/SonarCommunity/sonar-css

Download: http://downloads.sonarsource.com/plugins/org/codehaus/sonar-plugins/css/sonar-css-plugin/

Description

This plugin enables code QA analysis of CSS source code within SonarQube:

  • Computes metrics: lines of code, number of CSS rules, complexity, etc.
  • Validates your CSS code
  • Performs more than 50 checks such as: Stylesheets should not contain too many selectors, Empty declarations should be removed, Box model size should be carefully reviewed, etc.

Usage

Getting started in two minutes

Download the package and follow the instructions of the README file. This package contains the SonarQube server with the CSS plugin, the analyzer (SonarQube Runner) and a sample project.

Installing and configuring your SonarQube platform from scratch

  1. Install SonarQube
  2. Install the CSS plugin either by a direct download or through the update center.
  3. Install your favorite analyzer (SonarQube Runner, Maven, etc.) and analyze your code.

Metrics

Functions

Number of rules.

Complexity

The following elements increment the complexity by one:

  • Class selector
  • ID selector
  • Attribute selector
  • Type selector
  • Pseudo-class selector
  • At-rule

Complexity/function

It computes the complexity/rule, meaning the average number of selectors per rule.

It gives a measurement on how specific the selectors are.

As the computation of complexity in the CSS plugin is still in its early stage, it can be turned off if necessary at global and project levels.

Something went wrong with that request. Please try again.