Skip to content

[dead-code] chore: remove dead functions — 3 functions removed#45277

Merged
pelikhan merged 1 commit into
mainfrom
dead-code-remove-statvar-methods-c08ffba845bfd8ec
Jul 13, 2026
Merged

[dead-code] chore: remove dead functions — 3 functions removed#45277
pelikhan merged 1 commit into
mainfrom
dead-code-remove-statvar-methods-c08ffba845bfd8ec

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes three dead exported methods from pkg/stats.StatVar and their corresponding spec tests. No logic changes; pure clean-up.

Changes

File Change
pkg/stats/statvar.go Removed Sum(), Variance(), StdDev() methods
pkg/stats/spec_test.go Removed TestSpec_PublicAPI_Sum, TestSpec_PublicAPI_Variance, TestSpec_PublicAPI_StdDev

Details

Removed functions
  • Sum() float64 — returned arithmetic sum of all observations.
  • Variance() float64 — returned population variance (N denominator: m2 / count).
  • StdDev() float64 — returned population standard deviation (sqrt(Variance())).

The Bessel-corrected sample variants (SampleVariance, SampleStdDev) are retained.

API Impact

Breaking: any caller of StatVar.Sum, StatVar.Variance, or StatVar.StdDev will no longer compile. Per the commit message these methods were unused within the repository.

Commits

  • eea319872 chore: remove dead functions — 3 functions removed

Generated by PR Description Updater for #45277 · 35.8 AIC · ⌖ 4.4 AIC · ⊞ 4.7K ·

Remove unreachable StatVar methods Sum, Variance, and StdDev from
pkg/stats/statvar.go. These functions had no callers outside of
test files that exclusively tested them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review July 13, 2026 15:37
Copilot AI review requested due to automatic review settings July 13, 2026 15:37
@pelikhan pelikhan merged commit 1650a15 into main Jul 13, 2026
@pelikhan pelikhan deleted the dead-code-remove-statvar-methods-c08ffba845bfd8ec branch July 13, 2026 15:37
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #45277 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100).

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. This is a dead code removal PR (3 functions + 3 tests deleted). Test Quality Sentinel skipped.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ PR Code Quality Reviewer failed to deliver outputs during code quality review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes three purportedly unused statistical methods and their specification tests.

Changes:

  • Removes Sum, Variance, and StdDev.
  • Removes their public API tests.
Show a summary per file
File Description
pkg/stats/statvar.go Removes three documented public methods.
pkg/stats/spec_test.go Removes corresponding specification tests.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Medium

Comment thread pkg/stats/statvar.go
// Sum returns the arithmetic sum of all observations, or 0 if none.
func (s *StatVar) Sum() float64 { return s.sum }

// Mean returns the arithmetic mean of all observations, or 0 if none.
Comment thread pkg/stats/statvar.go
return math.Sqrt(s.Variance())
}

// SampleVariance returns the sample variance with Bessel's correction (divides

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Clean removal of three unused StatVar methods and their spec tests. Build and vet checks pass per the PR description.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 8.71 AIC · ⌖ 4.88 AIC · ⊞ 4.8K

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /codebase-design — clean removal of unused public API surface.

📋 Summary

No callers of Sum, Variance, or StdDev remain in the codebase. The removal is correct, the tests are removed in lockstep, and the verification checklist is complete.

Positive Highlights

  • ✅ Dead code removed without collateral changes
  • ✅ Tests deleted alongside the implementations
  • SampleVariance / SampleStdDev equivalents remain, so the statistically correct variants are still available
  • ✅ Build, vet, fmt, and targeted tests all pass per the PR description

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 10.9 AIC · ⌖ 4.32 AIC · ⊞ 6.6K
Comment /matt to run again

@github-actions github-actions Bot mentioned this pull request Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor Author

🧪 Test Quality Sentinel Report

Test Quality Score: N/A — Dead Code Removal

This PR removes dead code (3 functions and their corresponding tests). No new tests were added or modified — only test functions for deleted production functions were removed.

Analysis Result:

  • Changed test file: pkg/stats/spec_test.go (−54 lines)
  • Changed production file: pkg/stats/statvar.go (−17 lines)
  • New tests analyzed: 0
  • Tests removed: 3 (TestSpec_PublicAPI_Sum, TestSpec_PublicAPI_Variance, TestSpec_PublicAPI_StdDev)
  • Production functions removed: 3 (Sum(), Variance(), StdDev())

Verdict

No test quality concerns. This is a straightforward dead code removal PR with no new test coverage to evaluate.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🧪 Test quality analysis by Test Quality Sentinel · 17.7 AIC · ⌖ 9.29 AIC · ⊞ 6.8K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Test Quality Sentinel: No new tests to evaluate. This is a dead code removal PR (3 functions + 3 tests deleted). Approved.

@github-actions

Copy link
Copy Markdown
Contributor Author

🎉 This pull request is included in a new release.

Release: v0.82.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants