
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
The un_used_methods
gem is designed to help you identify and clean up unused methods in your Ruby on Rails application. In a large codebase, it can be challenging to track which methods are actively used and which are obsolete. The un_used_methods
gem scans your application's codebase and identifies methods that are defined but not used anywhere else in your project. This helps you spot and remove unnecessary code, improving maintainability and performance.
Add this line to your application's Gemfile
:
gem 'un_used_methods'
Then run:
bundle install
To use the gem, run the following command:
bundle exec un_used_methods find_unused
This command will analyze your codebase and print out any unused methods it finds. The gem scans through Ruby files, HTML/ERB templates, and other relevant file types to ensure comprehensive coverage.
Method 'test' called in file: app/models/test.rb
Method 'another_method' not called anywhere in the project
Unused Methods found in your model, controller and helper directories:
app/models/test.rb: another_method
The gem uses default settings to scan common directories and file types. If you need to customize the directories or file types to scan, you can modify the gem's configuration within the codebase.
To contribute to the development of this gem:
git checkout -b feature/your-feature
).git commit -am 'Add some feature'
).git push origin feature/your-feature
).This gem is available as open source under the terms of the MIT License.
This gem leverages concepts from static code analysis and method usage detection to enhance code quality.
FAQs
Unknown package
We found that un_used_methods demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.