Correct line count for custom phpdoc annotation
- Dominant language
- Java
- Stars
- 3.1k
- Forks
- 935
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 17
Description
### Apache NetBeans version
Apache NetBeans 24
### What happened
As part of ensuring application code quality compliance, there is a metric in Netbeans that one method should ideally not exceed 20 lines of application code. If the code is annotated using phpDoc comments, these lines are not properly counted in the total.
However, once semantically identical comments are used, but with a tool prefix such as PHPStan or Psalm, these lines are unfortunately counted in the total count, leading to a warning error being reported for the method in question, or for the entire length of the class.
Translated with www.DeepL.com/Translator (free version)
### Language / Project Type / NetBeans Component
PHP
### How to reproduce
Just paste the following code into the new PHP file:
```php
IMHO any lines of PHPDoc should be ignored in lines count
### Did this work correctly in an earlier version?
No
### Are you willing to submit a pull request?
I want to, but I'm not a Java developer
Contributor guide
Research direction
Start with the PHP line-count inspection using the reproducible Foo class in the issue, comparing basePhpDoc and phpstanPhpDoc. Confirm the behavior for ordinary and tool-prefixed PHPDoc comments, then verify that both methods exclude PHPDoc lines from the count.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100