Refactoring: Analyzing Abstract_Check_Runner Class for Complexity Reduction

Đang mở
#229 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
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
php
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng việc xem xét plugin-check/includes/Checker/Abstract_Check_Runner.php tại dòng 19 và cảnh báo về độ phức tạp, sau đó so sánh class với các thay đổi được thảo luận trong PR #228. Xác định những phần đóng góp vào độ phức tạp được báo cáo là 54 và ghi lại một phương án tái cấu trúc để giảm độ phức tạp xuống dưới ngưỡng đã cấu hình mà không dựa vào việc suppression trong class docblock.

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

Mô tả

[Type] Enhancement
Is your enhancement related to a problem? Please describe.

Following up on PR #228, during the code review process, we encountered a warning related to excessive class complexity in the file plugin-check/includes/Checker/Abstract_Check_Runner.php at line 19. The warning message received was:

ExcessiveClassComplexity: The class Abstract_Check_Runner has an overall complexity of 54 which is very high. The configured complexity threshold is 50.

To address this warning, it is recommended that we refactor the code of the Abstract_Check_Runner class to reduce its complexity. Currently, we have temporarily suppressed the warning by adding @SuppressWarnings(PHPMD.ExcessiveClassComplexity) in the class docblock.

This issue aims to investigate and analyze the Abstract_Check_Runner class in order to identify areas where complexity can be reduced.

Please feel free to provide any additional insights or suggestions for the refactoring process.

cc. @swissspidy

Designs

No response

Describe alternatives you've considered

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct
Ngôn ngữ chính
PHP
Star
365
Fork
135
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
20

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 WordPress/plugin-check

Tất cả issue của WordPress/plugin-check

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.