debtmap 0.4.0

Code complexity and technical debt analyzer
Documentation
# Example debtmap configuration file
# Copy this to .debtmap.toml and adjust thresholds as needed

[thresholds]
# Basic complexity thresholds
complexity = 10
duplication = 50
max_file_length = 500
max_function_length = 100

# Minimum thresholds for debt analysis
minimum_debt_score = 1.0
minimum_cyclomatic_complexity = 2
minimum_cognitive_complexity = 3
minimum_risk_score = 1.0

# Validation thresholds for 'debtmap validate' command
[thresholds.validation]
# Maximum allowed average complexity (default: 10.0)
max_average_complexity = 10.0

# Maximum allowed high complexity function count (default: 100)
max_high_complexity_count = 100

# Maximum allowed technical debt items (default: 2000)
max_debt_items = 2500

# Maximum allowed total debt score (default: 10000)
max_total_debt_score = 20000

# Maximum allowed codebase risk score (default: 7.0)
max_codebase_risk_score = 7.0

# Maximum allowed high-risk function count (default: 50)
max_high_risk_functions = 50

# Minimum required code coverage percentage (default: 0.0 - no minimum)
min_coverage_percentage = 60.0

# Scoring weights for priority calculation (must sum to 1.0)
[scoring]
coverage = 0.40      # Weight for test coverage gaps (40%)
complexity = 0.30    # Weight for code complexity (30%)
semantic = 0.05     # Weight for semantic importance (5%)
dependency = 0.15   # Weight for dependency criticality (15%)
security = 0.05     # Weight for security issues (5%)
organization = 0.05 # Weight for code organization issues (5%)

# Rebalanced scoring algorithm (Spec 136)
# Prioritizes code quality (complexity + coverage) over file size
[scoring_rebalanced]
# Use a preset: "balanced", "quality-focused", "test-coverage", "size-focused"
preset = "balanced"

# Or define custom weights (comment out preset above to use these)
# complexity_weight = 1.0    # Cyclomatic + cognitive complexity (default: 1.0)
# coverage_weight = 1.0      # Test coverage gaps (default: 1.0)
# structural_weight = 0.8    # God objects, architectural issues (default: 0.8)
# size_weight = 0.3          # File size - reduced from legacy ~1.5 (default: 0.3)
# smell_weight = 0.6         # Code smells (long functions, nesting) (default: 0.6)

# Available presets:
# - "balanced": Default (complexity: 1.0, coverage: 1.0, size: 0.3)
# - "quality-focused": Emphasize quality over size (complexity: 1.2, coverage: 1.1, size: 0.2)
# - "test-coverage": Prioritize test gaps (coverage: 1.3)
# - "size-focused": Legacy behavior for compatibility (size: 1.5)


# External API detection configuration
[external_api]
domains = [
    "api.github.com",
    "api.openai.com",
    "*.amazonaws.com"
]
keywords = [
    "http_client",
    "fetch",
    "request",
    "api_call"
]

# Languages to analyze
[languages]
enabled = ["rust", "python", "javascript", "typescript"]

# Patterns to ignore during analysis
[ignore]
patterns = [
    "target/**",
    "node_modules/**",
    "*.generated.rs",
    "*.pb.rs"
]

# Default output format
[output]
default_format = "terminal"