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

Đang mở
#96 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
backend, data

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
PHP
Star
55
Fork
3
Merge trung bình
25 phút
Pull request đã merge (30 ngày)
22

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Phauthentic/cognitive-code-analysis

Tất cả issue của Phauthentic/cognitive-code-analysis

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.