Skip to content

Relative paths in pmd report result in missing code snippets #116

Closed

Description

@adangel

PMD6 reports absolute paths, PMD7 seems to report only relative paths (relative to the current working directory).

  • pmd6: /home/runner/work/pmd/target/repositories/openjdk-11/src/java.base/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java
  • pmd7: target/repositories/openjdk-11/src/java.base/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java

The regression tester should be able to deal with both situations. It will relativize the paths on its own (relative to the project root, that is /home/runner/work/pmd/target/repositories/openjdk-11).

The problem is, that we generate wrong links to the source code, e.g. https://github.com/openjdk/jdk/tree/jdk-11+28/target/repositories/openjdk-11/src/java.base/share/classes/java/util/AbstractMap.java#L609 instead of https://github.com/openjdk/jdk/tree/jdk-11+28/src/java.base/share/classes/java/util/AbstractMap.java#L609

Activity

  1. added
    bug
    on Nov 24, 2022
  2. added this to the next milestone on Nov 24, 2022
  3. self-assigned this
    on Nov 24, 2022
  4. changed the title [-]Relative paths in pmd-report.xml result in missing code snippets[/-] [+]Relative paths in pmd report result in missing code snippets[/+] on Nov 24, 2022
  5. adangel commented on Nov 24, 2022

    @adangel
    MemberAuthor

    Another example: comparison between master and pmd/7.0.x is also broken: https://chunk.io/pmd/239601d3404a4537945d24b60b36b275/diff2/Schedul-o-matic-9000/index.html#section-violations

    grafik

  6. added a commit that references this issue on Nov 25, 2022
    6d2a071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions