Skip to content

Conversation

@jbartolotta-sfdc
Copy link
Contributor

The PMD Java program returns file violations as well as other top level information. We only want to show information about file violations.

Filter the results to only include nodes where the name is 'file'. Log all other nodes.

The PMD Java program returns file violations as well as other top level information. We only want to show information about file violations.

Filter the results to only include nodes where the name is 'file'. Log all other nodes.
@jbartolotta-sfdc jbartolotta-sfdc changed the title Filter PMD results before processing violations @W-7742718@ Filter PMD results before processing violations Jul 7, 2020
const fileNodes = pmdJson.elements[0].elements.filter(e => 'file' === e.name);
const otherNodes = pmdJson.elements[0].elements.filter(e => 'file' !== e.name);
for (const otherNode of otherNodes) {
this.logger.trace(`Skipping non-file node ${JSON.stringify(otherNode)}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a line item to the 3.0 planning to decide if we want to somehow process these and show them to the user.

@jbartolotta-sfdc jbartolotta-sfdc merged commit 2a1f032 into dev Jul 7, 2020
@jbartolotta-sfdc jbartolotta-sfdc deleted the d/jbartolotta/W-7742718 branch July 13, 2020 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants