Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Code Quality Improvement Plan

未关闭
#1,882 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
冷清
技术栈
java

调研方向

这是一个包含多个项目的计划,而不是单个任务。首先选择一个未勾选的项目,然后检查指定的 pom.xml、Histogram.java、配置类或 servlet 模块,并注意 SpotBugs 与 Java 25 的兼容性说明。选定的检查清单项目已实现且其范围已得到验证,即表示完成。

由索引模型根据 Issue 内容生成。

描述

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.
主要语言
Java
星标
2.3k
派生
833
平均合并
2 天 16 小时
30 天内合并 PR
86

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

prometheus/client_java 的其他 Issue

查看 prometheus/client_java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。