New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[java][core] Provide report statistics at multiple files or directory level #2116
Comments
From #2033 (comment) :
https://docs.pylint.org/en/1.6.0/output.html#reports-section Pylint's reports are quite impressive. What I'd really like is a way to send an error report to a PMD web service Why wouldn't users want an overview of the whole project? I, for one, would be very interested in knowing which rule is violated most. Is it a pointer to inadequate training or coding skills or that the rule is irrelevant or unworkable (as it is) and can be dropped or needs to be modified? |
This requirement is pretty vague. What we would need know in order to decide is a more detailed specification, about: which statistics (we could start with implementing one at a time), understanding what is "project level" (PMD has no understanding of a project...), how these statistics are presented (reporting). Statistics: Are these PMD processing statistics (benchmarks, performance counters, so kind of "internal" statistics), or "project processing statics": how many files have been analyzed, or a statistic about "how many violations per rule have been found", or project metrics such as "average LOC per class, per method, average number of methods per class, average number of classes per package" and so on? E.g. if you are only interested in "how many violations per rule have been found", that can be solved in the reporters - since it is just a statistic over the generated report. Update: Another question: for which language? I've added for now Java, but depending on the statistics, this might be cross-language |
My usecase is to use a named directory as a project. All sources under that
are analysed. You could use filters to exclude or include file name
patterns.
I don't see much value in running PMD on individual files.
Knowing which files has most errors or number of errors per file can help users decide which ones to prioritise to fix and influences the order in which fixes are affixed. Couple this with severity codes and you have decision criteria.
If you want a higher level, you can group statistics by packages and drill down into individual files or classes.
I don't see developers fixing violations all at once. They'd do it in batches. Having a progress indicator gives them a sense of achievement.
This could well be experimental, initially. The java language appears to have the most number of rules. However, I haven't used PMD for any other language. Much.
What exactly do you mean by what language? As far as I can see, PMD is mostly java even though it terms itself a cross-language static analysis tool. The rules for other programming languages are minuscule and I come away with the impression that the rules for these languages exist to support the java functionality as technologies used from java applications and apps.
How many violations per rule found may not have much significance to users since it generally points to too many false positives that users are not bothering to correct. That would be more useful to PMD designers if it can be captured and transmitted.
I'm not really happy with mean stats. Mode and median would be more informative.
Information about suppressions and number of errors grouped by severity and name would be useful to the user.
No, I can't help you with this any further since my stats is very rusty and refreshing theory does not work without practice.
|
I've taken a shot at listing the kind of stats that could be reported. It's not fully mature but let's take it as a starting point: Suppressions: Violations: Files: Rules: Rule categories: Total number of lines of code scanned (NCSSCount) Total number of classes in code base Summary stats for packages, classes, interfaces. Stats for EJBs: (You might want to weigh in about Unit tests). You could similarly draw up stats for Java metrics. Similarly for Apex and JSP. https://pmd.github.io/pmd-6.20.0/pmd_java_metrics_index.html The report can be broken up into two versions: an abbreviated format and a long or full listing. PMD can also consider incorporating CKJM metrics as well. ckjm-ext, however, functions at the byte code level. http://gromit.iiar.pwr.wroc.pl/p_inf/ckjm/metric.html SonarSource has ckjm integrated. I'm unaware if that's the basic or extended version since I haven't been exposed to it. https://www.spinellis.gr/sw/ckjm/ http://sonarqube-archive.15.x6.nabble.com/sonar-dev-Sonar-2-0-CKJM-td4528938.html Probably not any longer. |
Affects PMD Version:
All
Rule:
All.
Description:
PMD must generate report statistics across the project level. This issue can be used to discuss which stats are to be generated and triage the most relevant and useful ones first.
#2033 (comment)
The text was updated successfully, but these errors were encountered: