Renew metric report interface#39
Draft
ebihara99999 wants to merge 14 commits into
Draft
Conversation
- Add metric-native measurements and snapshot summaries - Keep legacy JSON and CSV output paths for existing integrations - Document AI-assisted review workflows
- Move RuboCop calculator calls behind a standard engine adapter - Keep metric classes focused on scope extraction and measurement shaping
- Explain how CodeKeeper uses RuboCop analysis without applying offense policy - Document metric-native scopes and AI review usage
- Drop legacy metric engine and legacy output aliases - Keep score compatibility views derived from metric measurements - Remove redundant direct dependencies and align Ruby support with maintained versions
Use MetricReport for the full metrics output object while keeping summary as the derived aggregate section.
Require metric classes to receive SourceFile instances and document that RuboCop output is threshold-gated and policy-filtered.
26 tasks
Limit each metric summary to the top five measurements by value and make tie ordering stable for repeatable reports.
Add csv as a runtime dependency and align hotspot tie-break tests with the documented ordering.
The gemspec now declares csv as a runtime dependency, which the gemspec directive already brings into the bundle on every Ruby version, so the conditional entry duplicated it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Drop the Parser facade and the per-metric score hash interface, which predate the metric report model. SourceFile is now the single parsing boundary and Measurement the only metric output. Also remove RuboCop mixins and a version fallback made unreachable by the centralized calculator and the rubocop >= 1.88 requirement, and move file loading coverage from the parser specs to the SourceFile specs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AbcMetric and CyclomaticComplexity intentionally share an identical method-scope enumerator. Record that the duplication is deliberate and that a shared enumerator should be extracted when a third method-scope metric is added, so the decision survives beyond the current work. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Measurements are the source of truth, and the CSV view flattened them into metric/key/value rows that silently overwrote measurements sharing a key, such as classes reopened across files. It was also the only reason for the csv runtime dependency and the score key rules on Measurement. Tabular views can be derived from the measurements array downstream, so drop the csv format together with the format setting, the Result wrapper, and the csv dependency. Scorer now dedupes configured metrics itself, which the removed scores hash did implicitly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MetricReportas the default JSON output model.summaryas derived aggregate data andmeasurementsas the source of truth.Validation
bundle exec rspecbundle exec rubocop -A