A universal command-line tool that finds terrible variable names in your codebase and replaces them with increasingly ridiculous variations of "YourMom". Because if you're going to have bad variable names, they might as well be memorable.
- Multi-language support: Works with 15+ programming languages
- Smart detection: Identifies genuinely bad variable names (single letters, generic names, etc.)
- Safe replacements: Uses word boundaries to avoid breaking your code
- Flexible output: Create fixed files or modify in-place with optional backups
- Dry run mode: Preview changes before applying them
- Recursive processing: Handle entire directory trees
- Rust (
.rs) - JavaScript/TypeScript (
.js,.jsx,.ts,.tsx) - Python (
.py) - Java (
.java) - C/C++ (
.c,.h,.cpp,.cc,.cxx,.c++) - C# (
.cs) - Go (
.go) - Ruby (
.rb) - PHP (
.php) - Kotlin (
.kt) - Swift (
.swift) - Dart (
.dart) - Scala (
.scala)
# Clone the repository
git clone https://github.com/Mr615-TN/bad_variable_changer.git
cd bad_variable_changer
# Build the release binary
cargo build --release
# The binary will be in target/release/yourmom-fixer
# Copy it to your PATH for global access
cp target/release/bad_variable_changer /usr/local/bin/cargo install --git https://github.com/Mr615-TN/bad_variable_changer.git# Process specific files (creates .fixed versions)
bad_variable_changer main.py utils.js
# Process files in-place with backups
bad_variable_changer -i -b src/main.rs src/lib.rs
# Process entire directory recursively
bad_variable_changer -r ./my-project
# Preview changes without modifying files
bad_variable_changer --dry-run -r ./src# Process multiple directories with different options
bad_variable_changer -i -r -b ./frontend ./backend ./shared
# Process only specific file types in current directory
bad_variable_changer *.py *.js *.rs
# Safe exploration of a new codebase
bad_variable_changer --dry-run -r ./downloaded-project- Single letters:
i,j,k,a,b,c, etc. - Generic names:
temp,tmp,var,data,item,elem,node,obj - Names with numbers:
var1,item2,data3 - Really short meaningless names:
aa,bb,cc
yourmom โ yOurMom โ YourMom โ yourMom โ YOURMOM
YouRmOm โ yOuRmOm โ YoUrMoM โ yourmOM โ YOURmom
YoUrMoThEr โ yourmother โ YourMother โ YOURMOTHER
yOuRmOtHeR โ yourmommy โ YourMommy โ YOURMOMMY
urmom โ UrMom โ URMOM โ yomama โ YoMama โ YOMAMA
OPTIONS:
-i, --in-place Modify files in place instead of creating .fixed files
-r, --recursive Process directories recursively
-b, --backup Create .backup files when using --in-place
--dry-run Show what would be changed without modifying files
-h, --help Show help message
EXAMPLES:
bad_variable_changer main.rs lib.py # Process specific files
bad_variable_changer -i -b src/ # Process src/ in-place with backups
bad_variable_changer -r . # Process all source files recursively
bad_variable_changer --dry-run -r ./project # Preview changes without modifying
def calculate_something(a, b):
temp = a * b
for i in range(10):
data = temp + i
if data > 50:
return data
return tempdef calculate_something(yourmom, yOurMom):
YourMom = yourmom * yOurMom
for yourMom in range(10):
YOURMOM = YourMom + yourMom
if YOURMOM > 50:
return YOURMOM
return YourMomconst items = [1, 2, 3];
let temp = 0;
for (let i = 0; i < items.length; i++) {
const val = items[i];
temp += val;
}const items = [1, 2, 3];
let yourmom = 0;
for (let yOurMom = 0; yOurMom < items.length; yOurMom++) {
const YourMom = items[yOurMom];
yourmom += YourMom;
}- Word boundary matching: Won't partially replace variable names
- Language-aware: Uses appropriate patterns for each programming language
- Backup creation: Optional backup files when modifying in-place
- Dry run mode: Preview changes before applying
- Skip already fixed: Won't replace existing "yourmom" variations
- Educational: Learn to write better variable names by seeing how ridiculous bad ones look
- Code review prep: Make terrible legacy code memorable before refactoring
- Team building: Bring some humor to your debugging sessions
- Refactoring aid: Easily spot which variables need proper names
- Because it's hilarious: Sometimes you need to laugh at your code
The tool understands different language patterns:
- Python: Handles list comprehensions, lambda functions, with statements
- JavaScript: Supports arrow functions, destructuring, modern syntax
- Rust: Recognizes pattern matching, closures, ownership patterns
- Java: Handles enhanced for loops, generics, method signatures
- Go: Understands Go's unique syntax and conventions
- And many more!
- Rust 1.70+ (install from rustup.rs)
git clone https://github.com/Mr615-TN/bad_variable_changer.git
cd bad_variable_changer
cargo build --releaseThe optimized binary will be at target/release/bad_variable_changer.
# Run in development mode
cargo run -- --help
# Run tests
cargo test
# Format code
cargo fmt
# Check for issues
cargo clippyContributions welcome! Areas for improvement:
- Add support for more programming languages
- Improve variable detection patterns
- Add more YourMom variations
- Better handling of edge cases
GPL-3.0 - see LICENSE file for details.
This tool is intended for educational and entertainment purposes. While it's designed to be safe, always backup your code before running it on important projects. The authors are not responsible for any code that becomes sentient and starts insulting your mother.
After processing your codebase, you'll have:
- โ More memorable variable names
- โ A good laugh during code reviews
- โ Easy identification of variables that need proper names
- โ The most unique codebase in your organization
"Your code may be bad, but at least now it's hilariously bad." - YourMom Variable Fixer