Sdlc/Dry/DuplicatedStatementSequence: carve out local-assignment and cross-class windows by shape #1345
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#1345
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
Sdlc/Dry/DuplicatedStatementSequenceflags 2 consecutive statements of a def body that equal a 2-statement window of an earlier def in the same file. Some of these windows cannot be extracted into a shared method.Counterexamples:
issues = []; fixes = [](plugins/cc-architect/scripts/plugin_config/operations/audit.rb:35-36 and :83-84).Excludeof test paths (.rubocop.yml:234-244). That breaks the no-exclusion rule, and it leaks: plugins/os-me/hooks/test/invocation_log_test.rb:40-41 still fires.Found by the #1325 zero-false-positive audit (docs/plans/class-length-family/sdlc-cop-audit.md).
Approach
Carve out by shape in the cop matcher, never by config
Excludeor test-path exclusion. Skip windows whose statements are only local assignments. Skip windows that sit in a different class or module than the earlier match. Delete the test-pathExcludefrom .rubocop.yml and decide test duplication by shape.Required work:
DuplicatedStatementSequencein.rubocop.ymlAcceptance criteria
Excludelist or test-path exclusion carries the carve-out.Owner sketch
The carve-out lives in the cop matcher.
Origin
VERDICT: CREATE