Skip to content

fix: remove unused integrate() function from Utils.js - #328

Merged
mattqdev merged 1 commit into
physicshub:mainfrom
TechGenius-Karan:fix/remove-unused-integrate-function
May 23, 2026
Merged

fix: remove unused integrate() function from Utils.js#328
mattqdev merged 1 commit into
physicshub:mainfrom
TechGenius-Karan:fix/remove-unused-integrate-function

Conversation

@TechGenius-Karan

Copy link
Copy Markdown
Contributor

📘 Pull Request Template – PhysicsHub

Thank you for contributing to PhysicsHub!
Please complete the sections below to help us review your pull request efficiently.


🔍 Description

What was wrong

Utils.js contained a fully implemented integrate() function (Velocity Verlet integration) that was exported but
never imported or used anywhere in the codebase.

Having unused exported code causes two problems:

  1. Confusion — a developer reading the file might assume this is the intended integration method and start using it,
    not realising that PhysicsBody.step() already handles integration internally. Two competing approaches sitting side
    by side is unclear.
  2. Dead weight — code that is never called still has to be read, understood, and maintained for no benefit.

Note: collideBoundary() in the same file was also flagged as dead code in the original audit, but it has since been
adopted and is now actively used by BouncingBall.jsx — so only integrate() remained unused.

What was fixed

Removed the integrate() function entirely from Utils.js. No other file imported it, so there are zero callsite
changes needed.

Closes #BUG-015 (if applicable)


✅ Checklist

Before requesting a review, please ensure that you have:

  • Verified that the project builds and runs locally (npm run dev)
  • Ensured no ESLint or TypeScript warnings/errors remain
  • Updated documentation, comments, or in-code explanations where needed
  • Verified responsiveness across devices (desktop, tablet, mobile)
  • Followed the CONTRIBUTING.md guidelines

🎨 Visual Changes (if UI-related)

IF CHANGES ARE RELATED TO SIMULATIONS PLEASE SEND A SHORT CLIP ABOUT IT
(OBLIGATORY)


📂 Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • ♻️ Refactor / code quality improvement
  • 🎨 UI/UX enhancement
  • 🔒 Security improvement

🧩 Additional Notes for Reviewers

@mattqdev
mattqdev merged commit 3922b9f into physicshub:main May 23, 2026
1 check passed
@physicshub

Copy link
Copy Markdown
Owner

🎉 This PR is included in version 3.28.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants