Skip to content

chore: remove unused dead code#6953

Merged
matthewelwell merged 2 commits intoFlagsmith:chore/remove-dead-codefrom
duriantaco:remove-dead-code
Mar 16, 2026
Merged

chore: remove unused dead code#6953
matthewelwell merged 2 commits intoFlagsmith:chore/remove-dead-codefrom
duriantaco:remove-dead-code

Conversation

@duriantaco
Copy link

@duriantaco duriantaco commented Mar 15, 2026

Summary

  • Removed 10 unused symbols identified via static analysis using Skylos (zero references across entire codebase, verified with grep)
  • 10 files changed, 56 deletions, 0 additions

Changes

Symbol File Reason
WebhookSendError webhooks/exceptions.py (deleted) Never raised or caught
WebhookURLSerializer webhooks/serializers.py Never used in any view
ViewResponseDoesNotHaveStatus sse/exceptions.py Never raised or caught
ImproperlyConfiguredError app/exceptions.py (deleted) Never raised or imported
IdentitySerializerFull environments/identities/serializers.py Never used in any view
BaseDetailedPermissionsSerializer permissions/serializers.py Never imported
UTMDataModel users/models.py Never instantiated
DispatchResponse custom_auth/mfa/trench/responses.py Never returned
OAuthError custom_auth/oauth/exceptions.py Never raised (GithubError/GoogleError kept)
get_next_segment_priority features/models.py Never called

Also removes now-unused imports (EnvironmentSerializerFull, FeatureStateSerializerFull, pydantic.BaseModel).

Test plan

  • Each symbol has zero references in the entire repo (confirmed via grep)
  • All modified files pass syntax checks
  • No new broken imports introduced

Found with Skylos — dead code detection for Python.

@duriantaco duriantaco requested a review from a team as a code owner March 15, 2026 11:49
@duriantaco duriantaco requested review from gagantrivedi and removed request for a team March 15, 2026 11:49
@claude
Copy link

claude bot commented Mar 15, 2026

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.

Once credits are available, reopen this pull request to trigger a review.

@vercel
Copy link

vercel bot commented Mar 15, 2026

@duriantaco is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the api Issue related to the REST API label Mar 15, 2026
@duriantaco duriantaco changed the title Remove unused dead code: exceptions, serializers, models, and functions chore: remove unused dead code Mar 15, 2026
@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.25%. Comparing base (c2bddaf) to head (a2b7b4e).
⚠️ Report is 2 commits behind head on chore/remove-dead-code.

Additional details and impacted files
@@                    Coverage Diff                     @@
##           chore/remove-dead-code    #6953      +/-   ##
==========================================================
- Coverage                   98.31%   98.25%   -0.06%     
==========================================================
  Files                        1335     1333       -2     
  Lines                       49745    49583     -162     
==========================================================
- Hits                        48907    48718     -189     
- Misses                        838      865      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vercel
Copy link

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
flagsmith-frontend-staging Ignored Ignored Preview Mar 16, 2026 6:26am

Request Review

@matthewelwell matthewelwell changed the base branch from main to chore/remove-dead-code March 16, 2026 06:29
@matthewelwell
Copy link
Contributor

matthewelwell commented Mar 16, 2026

Thanks for the contribution @duriantaco! I'm going to merge this into a branch in our own repository so that the currently failing CI checks pass can be run. It might be that some of this code is required by some of our private packages which are hosted in private repositories and installed at build time.

@matthewelwell matthewelwell merged commit 4c14dd4 into Flagsmith:chore/remove-dead-code Mar 16, 2026
20 of 28 checks passed
@matthewelwell
Copy link
Contributor

I have opened #6955 which you can follow.

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

Labels

api Issue related to the REST API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants