apache / apache/netbeans

Correct line count for custom phpdoc annotation

オープン
#8,246 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
kind:bug needs:triage PHP
主要言語
Java
スター
3.1k
フォーク
935
平均マージ
2日 3時間
マージ済み PR(30日)
17

説明

### 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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

issue にある再現可能な Foo クラスを使った PHP の行数検査から始め、basePhpDoc と phpstanPhpDoc を比較します。通常の PHPDoc コメントとツールプレフィックス付きの PHPDoc コメントについて動作を確認し、その後、両方のメソッドが PHPDoc の行をカウントから除外することを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
php
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。