os-sdlc lint rule: mine reek Feature Envy (conservative) into a custom cop #114
Labels
No labels
P0
P1
P2
P3
bug
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#114
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mine reek's Feature Envy detector into a custom Sdlc/Structural/* cop, with a conservative threshold.
Rationale: POODR Ch.4 -- behavior living in the wrong object, reaching into another object's data instead of sending it a message. Highest false-positive rate of the endorsed reek subset (fluent APIs), so mine with a deliberately conservative detection threshold. Fourth-priority mining target per ADR-0061.
Note: "sandi-analysis.md" cited in the original body does not exist; rationale stands on ADR-0061.
Problem
Three of the method's four calls target
order/order.region; the method itself never touchesself. This behavior belongs onOrder.Detection
defnode's body; local variables/params bound to a single external receiver.self); 2) count message sends toself/no receiver; 3) flag only if one external receiver receives >=3 calls AND self receives 0 calls AND the receiver is not a plain attr-chain on a single value (avoids fluent-API false positives, e.g. Rails.where(...).order(...)) -- limit to distinct method names, not chained calls on one expression."total_with_tax sends 3 messages to 'order' and none to self (Reek: Feature Envy) -- this calculation likely belongs on Order; move it there or extract."Correction
Pass/fail examples
x.where(a).order(b)) that only ever calls 2 distinct messages on one chained expression.Provenance
ADR-0061, reek Feature Envy detector (conservative threshold), filed 2026-07-23.
Implemented via os-sdlc pipeline (test-writer -> red -> programmer -> green -> ac-lint -> lint -> reviewer APPROVE, 2 rounds). Merged to main in
3fbb9b8.