Feat 102 include todo code comments in health metrics calculation#63
Merged
tshuck-beyond merged 10 commits intomainfrom Mar 7, 2025
Merged
Conversation
DLavin23
approved these changes
Mar 6, 2025
Contributor
DLavin23
left a comment
There was a problem hiding this comment.
Left a small formatting comment, otherwise looks good. Love the service class refactor, especially for calculating health. Great work!
docs/src/data/sample_config.js
Outdated
| }, | ||
| "overall": 89.75 | ||
| "todo_count_component": { | ||
| "awardable_points": 15, "health_score": 9.75, // (100-35)/100 * 15 = 9.75 |
Contributor
There was a problem hiding this comment.
/nit put "health_score" on a new line?
Collaborator
Author
There was a problem hiding this comment.
Certainly can; this is in-pattern with the other _components, but it does look a little weird.
| Encapsulation: {feature.additional_metrics.health.encapsulation_component.health_score.toFixed(0)} / {feature.additional_metrics.health.encapsulation_component.awardable_points} | ||
| </li> | ||
| <li className="text-xs text-gray-500"> | ||
| Todos: {feature.additional_metrics.health.todo_count_component.health_score.toFixed(0)} / {feature.additional_metrics.health.todo_count_component.awardable_points} |
Contributor
There was a problem hiding this comment.
Kinda seemed like this was looking a little janky on slightly smaller screens. Not blocking, but it may be worth time-boxing a little design discovery session for like 15 min.
Collaborator
Author
There was a problem hiding this comment.
Yup, let's do that outside of this work.
| encapsulation_ratios = feature_metrics.map { |_k, m| m[FeatureMetricsCalculator::ENCAPSULATION_RATIO_METRIC] }.compact | ||
| feature_sizes = feature_metrics.map { |_k, m| m[FeatureMetricsCalculator::LINES_OF_CODE_METRIC] }.compact | ||
| test_coverage_ratios = feature_test_coverage.map { |_k, c| c[TestCoverageFile::COVERAGE_RATIO] }.compact | ||
| percentile_metrics = PercentileMetricsCalculator.new(metrics: feature_metrics, test_coverage: feature_test_coverage) |
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.
This work refactors percentile and health-score calculation, and adds a new health component to account for todos (the fewer the better!)
Specifically, it:
score_thresholdconfiguration (and related code) in favor of a simplified approach viapercent_of_max_threshold(renamed from the incomprehensibleminimum_variance)Glue Dashboard:
Local dev
NOTE: This will require configuration updates to include config entries for the new component + renamed health attributes. We'll do this when we bump the featuremap version in glue and salesforce bedrock.