Sdlc/Structural/FeatureEnvy: carve out core-type receivers; remove the config Exclude list #1354
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
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
rule-proposal
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#1354
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?
Problem
The cop
Sdlc/Structural/FeatureEnvyflags a def whose one lvar receives three or more distinct messages.Its fix ("Belongs on ; move it there or extract",
feature_envy.rb:14) is impossible when the receiver is a core type.The cop also relies on a config Exclude list of 14 cop files (
plugins/os-sdlc/.rubocop.yml:342-357), which is itself a standard failure.Found by the #1325 zero-false-positive audit (docs/plans/class-length-family/sdlc-cop-audit.md).
Observed
Counterexamples, receivers that cannot take the method:
valueis nil or String:plugins/cc-architect/scripts/plugin_config/operations/validate.rb:49nameis a String:plugins/os-backlog/lib/backlog/labels.rb:11stackis an Array:plugins/os-aidd-lint/lib/aidd_lint/fence_mask.rb:30The cop has 55 hits; most are primitive or core-type params.
Reproduce
n/a: matcher is
plugins/os-sdlc/lib/os_sdlc/cops/feature_envy/site.rb; run the cop on the files above.Approach
Carve-outs go in the cop matcher, never in a config Exclude list or a test-path exclusion.
Skip when the envied lvar receives core-type messages only (
nil?,is_a?,to_s,strip,empty?,push,pop,last,include?), or when it is reassigned from.to_sorArray().Delete the 14-file Exclude at
plugins/os-sdlc/.rubocop.yml:342-357, and fix or carve out those files by shape.Required work:
stripinplugins/os-sdlc/lib/os_sdlc/cops/feature_envy/*.rbSdlc/Structural/FeatureEnvyinplugins/os-sdlc/.rubocop.ymlAcceptance criteria
strip,empty?, andto_s, when the cop runs, then it reports no offense.Origin
VERDICT: CREATE