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

draft: Add support for OpenCover format based on opencover plugin #46

Closed
wants to merge 1 commit into from

Conversation

jonesbusy
Copy link
Contributor

This is on on-going process to implement the opencover format to coverage-model

Only need to convert the parser from https://github.com/jenkinsci/opencover-plugin/blob/main/src/main/java/io/jenkins/plugins/opencover/OpenCoverReportAdapter.java#L37

Originally raised here on the deprecated code-coverage-api-plugin

Testing done

Submitter checklist

}

private void readPackage(final XMLEventReader reader, final ModuleNode root,
final StartElement currentStartElement, final FilteredLog log) throws XMLStreamException {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'currentStartElement' is never used.
@uhafner uhafner added the feature New features label Oct 27, 2023
@jonesbusy jonesbusy force-pushed the feature/opencover-parser branch 2 times, most recently from 12ee519 to 3530ca2 Compare November 15, 2023 03:29
@uhafner
Copy link
Member

uhafner commented Nov 17, 2023

Let me know if you need some help here. I created a similar PR for a new parser of JUnit results, see #53 for details.

@jonesbusy
Copy link
Contributor Author

@uhafner Thanks probably just missing time. Also I'm not very familiar yet with the model

@jonesbusy jonesbusy force-pushed the feature/opencover-parser branch 2 times, most recently from b4213f6 to 685043d Compare November 24, 2023 10:28
private void readFile(final XMLEventReader reader, final ModuleNode root,
final StartElement currentStartElement, final FilteredLog log) throws XMLStreamException {

PackageNode packageNode = null;

Check notice

Code scanning / CodeQL

Unread local variable

Variable 'PackageNode packageNode' is never read.
if (event.isStartElement()) {
var nextElement = event.asStartElement();
if (CLASS_NAME.equals(nextElement.getName())) {
String className = reader.nextEvent().asCharacters().getData();

Check notice

Code scanning / CodeQL

Unread local variable

Variable 'String className' is never read.
}
}

private Node createClassNode(final FileNode file, final StartElement parentElement) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'parentElement' is never used.
}
}

private void readClass(final XMLEventReader reader, final StartElement parentElement, final FilteredLog log) throws XMLStreamException {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'parentElement' is never used.
}
}

private void readClass(final XMLEventReader reader, final StartElement parentElement, final FilteredLog log) throws XMLStreamException {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'log' is never used.
}

private void readFile(final XMLEventReader reader, final ModuleNode root,
final StartElement currentStartElement, final FilteredLog log) throws XMLStreamException {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'currentStartElement' is never used.
}

private void readPackage(final XMLEventReader reader, final ModuleNode root,
final StartElement currentStartElement, final FilteredLog log) throws XMLStreamException {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'currentStartElement' is never used.
@jonesbusy jonesbusy force-pushed the feature/opencover-parser branch 7 times, most recently from 3a86a33 to 48d120d Compare December 22, 2023 09:50

// Creating all file nodes
for (var file : files.entrySet()) {
FileNode fileNode = packageNode.findOrCreateFileNode(getFileName(file.getValue()), getTreeStringBuilder().intern(file.getValue()));

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
packageNode
may be null at this access because of
this
assignment.
Signed-off-by: Valentin Delaye <jonesbusy@gmail.com>
@jonesbusy
Copy link
Contributor Author

Closing this PR. Will open a new clean one in the next few days.

Only need to finish method complexity parsing and enrich test coverage.

@jonesbusy jonesbusy closed this Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants