Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Support for CI Integration #47

Description

@asciidisco

Hey,
prelude -> I'm a JavaScript guy who rarely touched ruby before, so unfortunately I'm not able to implement this on my own :(

Basically, what CSSCSS does, can be considered as Copy & Paste Detection (http://en.wikipedia.org/wiki/Duplicate_code) there are other tools for other languages that can detect & report such issues (https://github.com/sebastianbergmann/phpcpd).

Those tools normally can output the results in a special XML format, that can be consumed by various CI Tools (like Jenkins for example).
They mostly convert it to some nice diagrams & can also fail the build if the
rate of copy-pasted code is above a user defined value.

The defacto standard pmd-cpd XML output would look like this:

<?xml version="1.0" encoding="utf-8"?>
<pmd-cpd>
    <duplication lines="" tokens="5">
        <file line="96" path="/Users/whatever/myproject/css/main.css"/>
        <file line="159" path="/Users/whatever/myproject/css/main.css"/>
        <codefragment><![CDATA[" display: block;
            margin: 20px;
         "]]></codefragment>
    </duplication>
    <duplication lines="" tokens="4">
        <file line="24" path="/Users/whatever/myproject/css/main.css"/>
        <file line="199" path="/Users/whatever/myproject/css/main.css"/>
        <file line="312" path="/Users/whatever/myproject/css/main.css"/>
        <codefragment><![CDATA[" display: none;
            margin: 50px;
         "]]></codefragment>
    </duplication>
    <duplication lines="" tokens="3">
        <file line="64" path="/Users/whatever/myproject/css/main.css"/>
        <file line="111" path="/Users/whatever/myproject/css/main.css"/>
        <codefragment><![CDATA[" h1.my.super.overqualified.selector"]]></codefragment>
    </duplication>
</pmd-cpd>

What do you think, could that reporter be easily integrated into the CSSCSS?
I think a lot people would benefit from this.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions