Summary
Investigate the semantic difference between Whitaker's bumpy_road_function lint and CodeScene's Bumpy Road diagnostic.
Whitaker does run the lint. The non-finding is due to rule semantics, not rule absence.
The discrepancy was identified while assessing leynos/rstest-bdd#657, specifically:
crates/rstest-bdd-macros/src/codegen/tracking/mod.rs
TrackedFeaturePath::relative_to_manifest
CodeScene reports this function because it contains two nested conditional blocks. Whitaker does not report it.
Current Whitaker behaviour
Whitaker builds a weighted, per-line complexity signal. It reports only when it finds at least two separated bumps after smoothing.
Each bump must meet the current defaults:
- Weighted smoothed score of at least
2.5.
- Span of at least
2 contiguous lines.
- Survival through a centred moving-average window of
3.
TrackedFeaturePath::relative_to_manifest does not meet these conditions:
- The prefix-validation
if has a predicate contribution of 0.5 and a body-depth contribution of 1.0.
- The common-prefix loop's
if has the same maximum local contribution.
- The
while let condition is a let pattern. Whitaker excludes let predicates from scoring.
- The
let Some(text) = ... else construct does not create a scored if cluster.
The repository has no [bumpy_road_function] override in dylint.toml.
Expected investigation
Determine whether Whitaker should provide a mode, configuration, or supplementary diagnostic that detects CodeScene-style Bumpy Road cases. CodeScene treats two nested conditional blocks as a finding even when they do not form two sustained, separated weighted bumps.
Document the intended relationship between the two models if their semantics must remain different.
Affected area
crates/bumpy_road_function/
- Bumpy Road configuration and user documentation
- The score, smoothing, and bump-segmentation logic
Acceptance criteria
- Reproduce and document the outcome for
TrackedFeaturePath::relative_to_manifest, or an equivalent minimal Rust fixture.
- State whether semantic alignment with CodeScene is a project goal.
- If alignment is a goal, define an implementation approach and tests for this two-nested-conditional case.
- If alignment is not a goal, document the difference, including the score threshold, minimum span, smoothing window, and excluded
let predicates.
- Update user-facing configuration or documentation so users can select or understand the applicable Bumpy Road model.
Source
Summary
Investigate the semantic difference between Whitaker's
bumpy_road_functionlint and CodeScene's Bumpy Road diagnostic.Whitaker does run the lint. The non-finding is due to rule semantics, not rule absence.
The discrepancy was identified while assessing
leynos/rstest-bdd#657, specifically:crates/rstest-bdd-macros/src/codegen/tracking/mod.rsTrackedFeaturePath::relative_to_manifestCodeScene reports this function because it contains two nested conditional blocks. Whitaker does not report it.
Current Whitaker behaviour
Whitaker builds a weighted, per-line complexity signal. It reports only when it finds at least two separated bumps after smoothing.
Each bump must meet the current defaults:
2.5.2contiguous lines.3.TrackedFeaturePath::relative_to_manifestdoes not meet these conditions:ifhas a predicate contribution of0.5and a body-depth contribution of1.0.ifhas the same maximum local contribution.while letcondition is aletpattern. Whitaker excludesletpredicates from scoring.let Some(text) = ... elseconstruct does not create a scoredifcluster.The repository has no
[bumpy_road_function]override indylint.toml.Expected investigation
Determine whether Whitaker should provide a mode, configuration, or supplementary diagnostic that detects CodeScene-style Bumpy Road cases. CodeScene treats two nested conditional blocks as a finding even when they do not form two sustained, separated weighted bumps.
Document the intended relationship between the two models if their semantics must remain different.
Affected area
crates/bumpy_road_function/Acceptance criteria
TrackedFeaturePath::relative_to_manifest, or an equivalent minimal Rust fixture.letpredicates.Source
.featurefile edit rebuild the scenario binary (10.3.3) rstest-bdd#657