Skip to content

[core] PMD should display number of rules violated or errors found #1995

Closed

Description

@linusjf

Affects PMD Version:
6.17

Rule:
All rulesets.

Description:
PMD output does not inform the user as to the number of rules contravened while running the tool. The user has to look at the output file.

Code Sample demonstrating the issue:

Sep 01, 2019 9:42:45 AM net.sourceforge.pmd.cache.FileAnalysisCache loadFromFile
INFO: Analysis cache loaded
Sep 01, 2019 9:43:02 AM net.sourceforge.pmd.cache.AbstractAnalysisCache checkValidity
INFO: Analysis cache invalidated, execution classpath changed.
Sep 01, 2019 9:43:07 AM net.sourceforge.pmd.cache.FileAnalysisCache persist
INFO: Analysis cache updated

Running PMD through:
[CLI | Ant]

Activity

  1. changed the title [-][java] PMD must display number of rules contravened or errors found. [/-] [+][core] PMD must display number of rules contravened or errors found[/+] on Sep 2, 2019
  2. added
    an:enhancement
    good first issue
    on Sep 2, 2019
  3. agkanos commented on Sep 28, 2019

    @agkanos
  4. linusjf commented on Oct 8, 2019

    @linusjf
    Author
  5. linusjf commented on Oct 8, 2019

    @linusjf
    Author
  6. adangel commented on Oct 8, 2019

    @adangel
  7. linusjf commented on Oct 8, 2019

    @linusjf
    Author
  8. linusjf commented on Oct 8, 2019

    @linusjf
    Author
  9. linusjf commented on Oct 9, 2019

    @linusjf
    Author
  10. linusjf commented on Oct 9, 2019

    @linusjf
    Author
  11. oowekyala commented on Oct 9, 2019

    @oowekyala
  12. linusjf commented on Oct 9, 2019

    @linusjf
    Author
  13. agkanos commented on Oct 9, 2019

    @agkanos

    Hey guys sorry for taking so long to come back on this. I can see a similar implementation that already exists here. This is triggered by passing the flag: -f textcolor . What exactly are we looking from this enhancement?

    Ok I missed the: while running the tool

  14. oowekyala commented on Oct 9, 2019

    @oowekyala
    Member

    @ThanasisGkanos Tbh even with while running the tool I think the question is very vague. If it was the case that OP's looking for a progress indicator, then changing the exit code would have been pointless.

    @Fernal73 Why do you want to read the number of rules? Do you need to parse it or do you just think it would be useful info for an end-user? Are you asking for a progress indicator during the run, or just a summary line at the end? What renderer are you using?

  15. 13 remaining items

  16. 04Deek commented on Apr 29, 2022

    @04Deek

    hii guys, I am intersted to look into [core] PMD must display number of rules contravened or errors found. I want to understand and confirm that, do we need to show proper count of errors found in each module to the user?

  17. changed the title [-][core] PMD must display number of rules contravened or errors found[/-] [+][core] PMD must display number of rules violated or errors found[/+] on Apr 29, 2022
  18. changed the title [-][core] PMD must display number of rules violated or errors found[/-] [+][core] PMD should display number of rules violated or errors found[/+] on Apr 29, 2022
  19. adangel commented on Apr 29, 2022

    @adangel
    Member

    Ok, I went through all the comments and hid all that were off topic.
    The task here is as follows:

    When you run PMD on the command line (see https://pmd.github.io/latest/pmd_userdocs_cli_reference.html), PMD just executes and terminates when it has finished. There is no visual output at all to tell the user e.g. "Found 11 violations. And there were 2 processing errors.".
    Or in case, no problems have been detected, the output could be something like "Found no violations.".
    Especially there is no output, if you write the report to a file (--report-file).

    See also https://github.com/pmd/pmd/wiki/Newcomers%27-Guide

  20. added
    in:cli
    on Jan 13, 2023
  21. added this to the 7.x milestone on Jan 23, 2023
  22. abhinavashok commented on Dec 13, 2023

    @abhinavashok

    Is anyone working on this ?

  23. adangel commented on Dec 14, 2023

    @adangel
    Member

    @abhinavashok I don't think so.

  24. xiao-hui-ux commented on Oct 1, 2024

    @xiao-hui-ux

    Hi, I would want to work on this issue.

  25. DragonFSKY commented on Jun 28, 2026

    @DragonFSKY
    Contributor

    I don't see an active PR or assignee for this. I'm preparing a small CLI-only implementation that prints the existing violation/processing-error counts through the CLI reporter without changing report output or exit codes. Happy to defer if someone is actively working on it.

  26. modified the milestones: 7.x, 7.27.0 on Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementgood first issuein:cli

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions