Remove unused attribute DraftNotes::CreateService#in_draft_mode

Summary

Removes the unused attribute DraftNotes::CreateService#in_draft_mode from app/services/draft_notes/create_service.rb.

The in_draft_mode accessor was declared via attr_accessor but was never read or written anywhere in the codebase. Only in_draft_mode is removed; the co-declared in_reply_to_discussion_id accessor is still in use and is kept.

Related to #542966 (closed)

Verification

This attribute was verified as unused by:

  • keela --type attributes flagged it as unused
  • Grep search found no readers or writers (production or specs)
  • No metaprogramming patterns reference it (send/public_send/read_attribute/write_attribute/[:...])
  • No symbol/string references (:in_draft_mode, 'in_draft_mode') in Ruby, HAML/ERB views, JS/Vue, or JSON
  • Both callers (drafts_controller.rb, lib/api/draft_notes.rb) never touch it

Cascade Removals

None - this was a standalone removal.

Metrics

Source File Complexity (flog)

Metric Before After Improvement
File flog total 30.4 30.4 0.0 (0%)
Attribute flog score 0.0 N/A -0.0 removed

attr_accessor declarations carry no flog complexity, so the file total is unchanged.

Spec File Complexity (flog)

Metric Before After Improvement
Spec file flog total N/A N/A 0.0 (0%)
Spec block flog score 0.0 N/A -0.0 removed

No dedicated spec examples reference this attribute, so no spec code was removed.

Combined Flog Summary

File Flog Removed
app/services/draft_notes/create_service.rb 0.0
(no spec changes) 0.0
Total 0.0

Test Suite Impact

  • Specs removed: 0 examples
  • Spec file: none (no dedicated spec exercised this attribute)
  • Time saved per run: 0.00 seconds

Estimated CI Savings

Estimate Pipelines/Month Time Saved Cost Saved/Month Cost Saved/Year
Pessimistic 15,000 0.00 hrs/month $0.00 $0.00
Moderate 30,000 0.00 hrs/month $0.00 $0.00
Optimistic 50,000 0.00 hrs/month $0.00 $0.00

Based on 0.00 seconds saved per pipeline × $0.03/minute (large runners: 3x cost factor on $10/1000 base minutes). This removal deletes a dead accessor with no associated spec examples, so there is no direct CI time savings; the value is in reduced code surface area.

Files Modified

  • app/services/draft_notes/create_service.rb (attribute removed from attr_accessor - 1 line changed)
  • scripts/lint/keela_baseline.yml (entry removed - 2 lines)
  • Related to #542966 (closed) (Improve unused helper methods workflow)
  • Part of dead code cleanup effort
  • Attribute was listed in scripts/lint/keela_baseline.yml

Merge request reports

Loading
Loading