Configuration File
Refactron uses a.refactron.yaml file to configure analyzers, refactorers, and thresholds.
Initialize Configuration
Generate a default configuration file:.refactron.yaml in your project root.
Configuration Options
Basic Configuration
.refactron.yaml
Pattern Learning
Enable pattern learning to improve suggestions over time:.refactron.yaml
Learn more about pattern learning in the Pattern Learning Guide
Available Analyzers
security
security
Detects security vulnerabilities like SQL injection, code injection, hardcoded secrets, and SSRF
code_smell
code_smell
Identifies magic numbers, long functions, excessive parameters, and deep nesting
complexity
complexity
Measures cyclomatic complexity, maintainability index, and nested loops
type_hint
type_hint
Checks for missing or incomplete type annotations
dead_code
dead_code
Finds unused functions and unreachable code
dependency
dependency
Analyzes circular imports and wildcard imports
Available Refactorers
extract_constant
extract_constant
Extract magic numbers into named constants
add_docstring
add_docstring
Add missing docstrings to functions and classes
simplify_conditionals
simplify_conditionals
Simplify complex conditional statements
reduce_parameters
reduce_parameters
Reduce function parameter count using dataclasses or dictionaries
Threshold Configuration
Adjust thresholds to match your project’s standards:.refactron.yaml
Exclude Patterns
Exclude files or directories from analysis:.refactron.yaml
