Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can u add line and branch coverage data to class attribute #297

Open
kathxqq opened this issue Sep 24, 2020 · 4 comments
Open

can u add line and branch coverage data to class attribute #297

kathxqq opened this issue Sep 24, 2020 · 4 comments

Comments

@kathxqq
Copy link

kathxqq commented Sep 24, 2020

As for our project , we need more detail coverage data about every js file, so can you add the following info to classElement.

        classElement.setAttribute("lines-covered", "" + file.getCodeLinesCoveredCount());
        classElement.setAttribute("lines-valid", "" + file.getCodeLineCount());
        classElement.setAttribute("branchs-covered", "" + file.getBranchesCoveredCount());
        classElement.setAttribute("branchs-valid", "" + file.getBranchCount());

we will be very appreciate , if you add this. thank you very much !

image

After added , the following xml is what we want
image

@tntim96 tntim96 self-assigned this Sep 26, 2020
@tntim96
Copy link
Owner

tntim96 commented Sep 26, 2020

That looks doable...let me take a look.

@tntim96
Copy link
Owner

tntim96 commented Sep 26, 2020

Unfortunately that would break the DTD.

  <!ELEMENT class (methods,lines)>
  <!ATTLIST class name        CDATA #REQUIRED>
  <!ATTLIST class filename    CDATA #REQUIRED>
  <!ATTLIST class line-rate   CDATA #REQUIRED>
  <!ATTLIST class branch-rate CDATA #REQUIRED>
  <!ATTLIST class complexity  CDATA #REQUIRED>

I'd prefer to add support for another format that does do this. Does the JaCoCo XML format support what you want and is it usable by you.

@kathxqq
Copy link
Author

kathxqq commented Sep 27, 2020

I'd prefer to add support for another format that does do this. Does the JaCoCo XML format support what you want and is it usable by you.

that's preety good , the jacoco xml format can satisfy our demands. thank you very much~

@tntim96
Copy link
Owner

tntim96 commented Sep 27, 2020

I've created a branch for developing this. It will probably take a week or so. I've marked it as a good first issue in case anyone wants to help. It should be a fairly straight forward addition working off the Cobertura XML code as a template.

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

No branches or pull requests

2 participants