Skip to content

Report duplicate blocks #149

@bartveneman

Description

@bartveneman

A feature in SonarQube is to report duplicate selectors. It would be interesting to take this one step further and report when complete blocks are duplicated.

.my-class {
  color: red;
  background: white;
}

/*  ... lots of code ... */

.my-class {
  color: red;
  background: white;
}

/* Open for discussion */
.my-class,
.my-second-class { /* <-- Extra class, but the initial class and rule block are identical */
  color: red;
  background: white;
}

/* Same ruleset, but within a @media at-rule */
@media (min-width: 400px) {
  .my-class {
    color: red;
    background: white;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions