Skip to content

Conversation

@jfeingold35
Copy link
Contributor

No description provided.

const cpdJson: Element = xml2js(cpdXml, {compact: false, ignoreDeclaration: true}) as Element;

const duplications = cpdJson.elements[0].elements;
const duplications = (cpdJson.elements[0].elements || []).filter(element => element.name === "duplication");
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment on why this is required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For some reason, v6.48.0 of PMD now adds extra elements to the CPD XML output in addition to the duplication elements. So we needed to filter those out.
I can add a comment in the code as well if you think it's necessary.

@jfeingold35 jfeingold35 merged commit 219940f into dev-3 Aug 11, 2022
@jfeingold35 jfeingold35 deleted the d/W-11567651-v3 branch September 14, 2022 18:17
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