Search documentation of Metastatic

# mix metastatic.code_smells (Metastatic v0.13.2)

View Source

Detects code smells in a given source file.

## Usage

    mix metastatic.code_smells FILE [options]

## Options

- `--format` - Output format: text (default) or json
- `--language` - Source language: python, elixir, erlang, ruby, or haskell (auto-detected if not specified)

## Examples

    # Basic code smell detection
    mix metastatic.code_smells my_file.py

    # JSON output
    mix metastatic.code_smells my_file.ex --format json

    # Explicit language
    mix metastatic.code_smells my_file.rb --language ruby

## Detected Smells

- Long functions (>20 statements)
- Deep nesting (>4 levels)
- High cyclomatic complexity (>10)
- High cognitive complexity (>15)
- Magic numbers (unexplained literals)
- Complex conditionals (>3 boolean operators)

## Exit Codes

- 0 - No smells detected
- 1 - Code smells found
- 2 - Error during analysis