A runtime analysis tool that finds suboptimal Ruby class API usage by observing method calls during test execution.
Pippi is a Ruby gem that finds suboptimal class API usage by observing method calls during test suite execution. It identifies inefficient patterns like using `select.first` instead of `detect`, helping improve performance and code clarity. The tool focuses on runtime analysis rather than static code parsing.
Ruby developers and teams who want to improve code performance and readability, especially those with comprehensive test suites where runtime analysis can be effective.
Developers choose Pippi for its unique runtime approach, which catches real usage patterns that static analyzers miss, and for its focus on both performance optimizations and clearer code intent.
pippi
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Observes actual method calls during test execution, catching inefficiencies like select.first that static analyzers might miss, as it analyzes real data flows.
Identifies specific patterns like map.flatten(1) vs flat_map to reduce unnecessary array allocations, directly improving code efficiency.
Highlights code that could be clearer, such as replacing select.first with detect to signal searching for the first match, enhancing readability.
Watches subsequent method calls to retract incorrect reports, reducing noise as described in the README's handling of alternate data flows.
Simple setup via Gemfile addition and environment variables for Rails test-unit or RSpec, requiring minimal configuration changes.
Relies entirely on test suite execution; ineffective in projects with low coverage, as admitted in the README where it won't find issues in untested code.
Adds performance impact to test runs due to method call hooking, which can slow down execution, as indicated by the 'Impact - very impactful, slows things down lots' note.
Despite mitigation, some false positives are unavoidable due to the halting problem, requiring manual review and potentially causing noise in reports.
Checksets (basic, buggy, rails) are predefined and may not cover all suboptimal patterns, especially in custom or domain-specific code, with no built-in extensibility shown.