Ruby Smells
summary
Argues that common Ruby code smells are concrete and fixable: shows examples like duplicate method calls, data clump, repeated conditional, control parameter and attribute smell, and demonstrates refactorings—cache repeated calls, introduce a Location value object or a NullLocation, split boolean-flags into separate predicates, push behavior into attendee/collection objects, and replace setters with immutable update/with methods. Presents and uses the configurable reek static analyzer to find smells, recommends verifying with tests before refactoring and tuning reek rules per project.
AI-written summary · about
chapters (12)
- 0:00Introduction to Ruby smells
- 3:59What are code smells
- 7:12Duplicate method calls
- 11:01Data clamps in methods
- 13:06Repeated conditionals
- 14:50Control parameters
- 17:35Utility functions
- 20:24Feature envy
- 22:52Attribute smell
- 27:10Finding smells with Reek
- 33:47Configuring Reek
- 35:11Refactoring advice and conclusion
related talks
37mIdentifying Code Smells
01h 00mPhantastic Code Smells and where to find them
22mRSpec: The Bad Parts
48mRefactoring from Good to Great - A Live-Coding Odyssey
21mTaming Flaky Specs: Diagnosing Test Failures in Ruby
01h 04mClean RSpec: A Workshop on Ruby Testing Craftsmanship
47mAnti-patterns and smells in test automation
31mGoing on a Testing Anti-Pattern Safari
