apache / apache/netbeans

Correct line count for custom phpdoc annotation

Ouverte
#8,246 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
kind:bug needs:triage PHP
Langage dominant
Java
Étoiles
3.1k
Forks
935
Merge moyen
2 j 3 h
PR mergées (30 j)
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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par l’inspection du nombre de lignes PHP en utilisant la classe Foo reproductible de l’issue, en comparant basePhpDoc et phpstanPhpDoc. Confirmez le comportement pour les commentaires PHPDoc ordinaires et ceux préfixés par un outil, puis vérifiez que les deux méthodes excluent les lignes PHPDoc du décompte.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
php
Domaine
tooling
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.