Code Monkey home page Code Monkey logo

goclover's Introduction

goClover

base on two open source project https://github.com/warmans/golocc and https://github.com/deadcheat/cloverleaf

Current process will only convert go test coverprofile to clover.xml

Install

$ go get github.com/codeofthrone/goclover

Usage

// generate coverprofile = c.out and clover.xml
$ goclover -f c.out -o clover.xml

Output example

<coverage clover="" generated="1543820003">
    <project name="" timestamp="1543820003">
        <package name="dpqqa.com/qas-2/Backend/controller/dms">
            <metrics loc="1811" cloc="8" ncloc="1803" packages="1" struct="8" method="0" exportedmethod="0" methodloc="0" function="1" exportedfunction="91" functionloc="1446" import="113" ifstatement="78" switchStatement="14" test="0" benchmark="0" assertion="80"></metrics>
            <file name="dpqqa.com/qas-2/Backend/controller/dms/create.go" path="">
                <line num="14" type="stmt" count="0"></line>
                <line num="15" type="stmt" count="0"></line>
                <line num="16" type="stmt" count="0"></line>
                <line num="17" type="stmt" count="0"></line>
                ...
            </file>
        </package>    
    </project>
</coverage>

Notice

TODO 
Current version didn't correct fill 
Methods ,CoverMethods,Statements,CoverStatements,Elements,Coveredelements, 
base on openCLover formual http://openclover.org/doc/manual/4.2.0/faq--how-are-coverage-percentages-calculated.html 
// TPC = (BT + BF + SC + MC)/(2*B + S + M) * 100%
//
// where
//
// BT - branches that evaluated to "true" at least once
// BF - branches that evaluated to "false" at least once
// SC - statements covered
// MC - methods entered
//
// B - total number of branches
// S - total number of statements
// M - total number of methods
Reference

goclover's People

Contributors

codeofthrone avatar kevinyeh-htc avatar

Watchers

 avatar

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.