Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,644,523
Community Members
 
Community Events
196
Community Groups

0.3.2 issue with parsing xml

Greetings,

something changed between 0.3.1 -> 0.3.1 when parsing a report's xml.

The pmd report was with version pmd 1.30 with the paramters "--format xslt --property xsltFilename=pmd/pmd-to-checkstyle.xsl --rulesets pmd/coe_pmd_ruleset.xml -language apex --report-file pmd/pmd-result.xml --fail-on-violation false".

SEVERE: Error when parsing /opt/atlassian/pipelines/agent/build/pmd-result.xml as se.bjurr.violations.lib.parsers.CheckStyleParser content:
<?xml version="1.0" encoding="UTF-8"?>
<file xmlns:pmd="http://pmd.sourceforge.net/report/2.0.0"
name="/opt/atlassian/pipelines/agent/build/force-app/main/default/classes/arlanisUtilities/ClsRecordTypeUtil.cls">
<error line="22" column="38" severity="info"
message="Missing or mismatched ApexDoc @param"
source="https://pmd.github.io/pmd-6.49.0/pmd_rules_apex_documentation.html#apexdoc"/>
<error line="134" column="30" severity="info" message="Missing ApexDoc comment"
source="https://pmd.github.io/pmd-6.49.0/pmd_rules_apex_documentation.html#apexdoc"/>
<error line="141" column="30" severity="info" message="Missing ApexDoc comment"
source="https://pmd.github.io/pmd-6.49.0/pmd_rules_apex_documentation.html#apexdoc"/>
<error line="152" column="30" severity="info" message="Missing ApexDoc comment"
source="https://pmd.github.io/pmd-6.49.0/pmd_rules_apex_documentation.html#apexdoc"/>
<error line="173" column="30" severity="info"
message="Missing or mismatched ApexDoc @param"
source="https://pmd.github.io/pmd-6.49.0/pmd_rules_apex_documentation.html#apexdoc"/>
</file>
<file xmlns:pmd="http://pmd.sourceforge.net/report/2.0.0"
name="/opt/atlassian/pipelines/agent/build/force-app/main/default/classes/arlanisUtilities/ClsRecordTypeUtil_Test.cls">
<error line="63" column="10" severity="info"
message="'System.assertEquals' should have 3 parameters."
source="https://pmd.github.io/pmd-6.49.0/pmd_rules_apex_bestpractices.html#apexassertionsshouldincludemessage"/>
<error line="73" column="10" severity="info"
message="'System.assertEquals' should have 3 parameters."
source="https://pmd.github.io/pmd-6.49.0/pmd_rules_apex_bestpractices.html#apexassertionsshouldincludemessage"/>
<error line="76" column="10" severity="info"
message="'System.assertEquals' should have 3 parameters."
source="https://pmd.github.io/pmd-6.49.0/pmd_rules_apex_bestpractices.html#apexassertionsshouldincludemessage"/>
<error line="79" column="10" severity="info"
message="'System.assertEquals' should have 3 parameters."
source="https://pmd.github.io/pmd-6.49.0/pmd_rules_apex_bestpractices.html#apexassertionsshouldincludemessage"/>
</file>

...more rules...


javax.xml.stream.XMLStreamException: ParseError at [row,col]:[17,2]
Message: The markup in the document following the root element must be well-formed.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:604)
at se.bjurr.violations.lib.parsers.CheckStyleParser.parseReportOutput(CheckStyleParser.java:41)
at se.bjurr.violations.lib.reports.ViolationsFinder.findViolations(ViolationsFinder.java:35)
at se.bjurr.violations.lib.ViolationsApi.violations(ViolationsApi.java:103)
at com.atlassian.bitbucket.pipelines.checkstyle.report.Main.main(Main.java:99)

 

I think XML was not enforced before to be well-formed and it might be an issue with our pmd-to-checkstyle.xsl.

2 answers

1 accepted

0 votes
Answer accepted

The issue was with the report.xml. It was missing a starting and enclosing tag.

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 30, 2022

@Frederik Mann hi. Can you confirm that all works on checkstyle-report 0.3.1 but not in version 0.3.2? We bumped violations lib from version 1.116 to 1.149

Regards, Igor.

Hi @Igor Stoyanov , yes I can confirm that everything works when switching back from 0.3.2 to 0.3.1.

The very same report, then can be evaluated by checkstyle-report and is shown in the pipeline with results.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events