Cleanup: class-level Halstead and cyclomatic metrics are computed but never output

オープン
#96 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php
領域
backend, data

調査の方向性

Start by reading storeClassMetrics() and getMetrics() in src/PhpParser/HalsteadMetricsVisitor.php, then check how CombinedMetricsVisitor.php consumes the results and how CyclomaticComplexityCalculator.php builds classSummary(). Trace the report and console output paths to decide whether class metrics should be exposed in class-grouped views or removed. Done means class-level calculations are either shown in the relevant output or deleted, with tests covering the chosen behavior.

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

説明

enhancement

Where

  • src/PhpParser/HalsteadMetricsVisitor.php:241-247 (storeClassMetrics()) and :279-289 (getMetrics() returns classes)
  • src/PhpParser/CombinedMetricsVisitor.php:142-146 (reads only methods)
  • src/Business/Cyclomatic/CyclomaticComplexityCalculator.php:144-158 (classSummary() fills classes)

Observed

Class-level Halstead and cyclomatic metrics are calculated, but no code reads the classes keys. They never reach any report or console output.

Expected

Either the class-level values are output, for example in the class-grouped views, or the calculation is removed.

Repro

grep -rn "'classes'\]" src

The only reads are inside the calculator itself.

主要言語
PHP
スター
55
フォーク
3
平均マージ
25分
マージ済み PR(30日)
22

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Phauthentic/cognitive-code-analysis のほかの issue

Phauthentic/cognitive-code-analysis の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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