mix ragex.analyze (Ragex v0.14.1)

View Source

Performs comprehensive analysis on a directory.

Analyzes a directory using all available Ragex analysis features:

  • Security vulnerability scanning
  • Business logic analysis (33 analyzers, including 13 CWE-based security analyzers)
  • Code complexity metrics
  • Code smell detection
  • Code duplication detection
  • Dead code analysis
  • Dependency analysis
  • Quality metrics
  • Circular dependency detection
  • God module detection (excessive coupling)
  • Unstable module detection
  • Unused module detection
  • Coupling metrics report

Usage

mix ragex.analyze [options]

Options

  • --path PATH - Directory to analyze (default: current directory)
  • --output FILE - Output file for results (default: stdout)
  • --format FORMAT - Output format: text, json, markdown (default: text)
  • --security - Include security analysis
  • --business-logic - Include business logic analysis (33 analyzers)
  • --complexity - Include complexity analysis
  • --smells - Include code smell detection
  • --duplicates - Include duplication detection
  • --dead-code - Include dead code analysis
  • --dependencies - Include dependency analysis
  • --quality - Include quality metrics
  • --circulars - Detect circular dependency clusters
  • --god-modules - Detect modules with excessive coupling
  • --unstable-modules - Detect highly unstable modules
  • --unused-modules - Detect unreferenced modules
  • --coupling - Full coupling metrics report
  • --all - Include all analyses (default)
  • --severity LEVEL - Minimum severity for issues: low, medium, high, critical (default: medium)
  • --threshold FLOAT - Duplication threshold 0.0-1.0 (default: 0.85)
  • --min-complexity INT - Minimum complexity to report (default: 10)
  • --god-threshold INT - Min total coupling for god module detection (default: 15)
  • --instability-threshold FLOAT - Min instability to report (default: 0.8)
  • --verbose - Show detailed progress information
  • --with-empty / --without-empty - Include/exclude empty issue reports in output (default: without-empty)
  • --ci - CI mode: plain text, no colors, non-zero exit on issues
  • --strict - Exit with code 1 if any issues are found

Examples

# Analyze current directory with all features
mix ragex.analyze

# Analyze specific directory
mix ragex.analyze --path lib/

# Security and quality analysis only
mix ragex.analyze --security --quality

# Output to file in JSON format
mix ragex.analyze --output report.json --format json

# High severity issues only
mix ragex.analyze --severity high

# Analyze with custom thresholds
mix ragex.analyze --threshold 0.9 --min-complexity 15

# CI pipeline: check for circular deps, fail if found
mix ragex.analyze --circulars --ci

# CI pipeline: full dependency health check
mix ragex.analyze --circulars --god-modules --unstable-modules --unused-modules --ci

# Strict mode with custom thresholds
mix ragex.analyze --coupling --god-threshold 20 --instability-threshold 0.9 --strict