Code Quality Improvement Plan

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

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
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
Ít trao đổi
Công nghệ
java
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Đây là một kế hoạch gồm nhiều mục, không phải một nhiệm vụ duy nhất. Trước tiên, hãy chọn một mục chưa được đánh dấu, sau đó kiểm tra pom.xml, Histogram.java, các lớp cấu hình hoặc các mô-đun servlet được nêu tên và lưu ý đến ghi chú về khả năng tương thích của SpotBugs với Java 25. Được xem là hoàn tất khi mục checklist đã chọn được triển khai và phạm vi của mục đó đã được xác minh.

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

Mô tả

This issue tracks code quality improvements for the Prometheus Java Client library. Work through these items incrementally.

Remaining Items

Add SpotBugs (Medium Priority)
  • Add spotbugs-maven-plugin to pom.xml
  • Configure with appropriate rule set
  • Note: Deferred due to Java 25 compatibility issues
Refactor Large Classes (Lower Priority)
  • prometheus-metrics-core/src/main/java/.../Histogram.java (978 lines) - consider extracting native histogram logic
Document Configuration Classes (Lower Priority)
  • PrometheusPropertiesLoader - add JavaDoc
  • ExporterProperties and related classes - add JavaDoc
  • ExporterOpenTelemetryProperties - add JavaDoc (noted in TODO)
Consolidate Servlet Exporter Duplication (Lower Priority)
  • Extract common logic from servlet-jakarta and servlet-javax into exporter-common
Add Mutation Testing (Lower Priority)
  • Add Pitest (pitest-maven) for critical modules
  • Start with prometheus-metrics-core and prometheus-metrics-model

Completed Items

  • Add Missing Test Coverage for Exporter Modules — Added 55 tests across 4 modules: exporter-common (22), servlet-jakarta (14), servlet-javax (14), otel-agent-resources (5).
  • Eliminate Dropwizard Module Duplication — Created AbstractDropwizardExports base class with generics. Reduced both modules by ~30%.
  • Address Technical Debt (TODOs) — Completed all 6 TODO items: JavaDoc for ExporterOpenTelemetryProperties, Histogram reset interval tests, environment variable support in PrometheusPropertiesLoader, OpenTelemetry filter documentation, Summary exemplars documentation, SlidingWindow synchronization documentation.
  • Improve Exception Handling — Replaced broad catch (Exception e) with specific exception types in 6 locations.
  • Add Branch Coverage to JaCoCo — Added BRANCH counter check with 50% minimum threshold.
  • Raise Minimum Coverage Thresholds — Raised 4 modules to consistent 60% line coverage.
  • Narrow Checkstyle Suppressions — Replaced global Javadoc suppression with targeted rules for internal/example/benchmark/test packages.
Ngôn ngữ chính
Java
Star
2.3k
Fork
833
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
86

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 prometheus/client_java

Tất cả issue của prometheus/client_java

Issue tương tự

Thêm issue về Java

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.