-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.debtmap-improved.toml
More file actions
192 lines (163 loc) · 6.64 KB
/
.debtmap-improved.toml
File metadata and controls
192 lines (163 loc) · 6.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Improved Debtmap Configuration with False Positive Reduction
[scoring]
# Weights for different scoring factors (must sum to 1.0)
# Balanced approach: coverage important but ROI and criticality guide smart prioritization
coverage = 0.30 # Weight for test coverage gaps (increased)
complexity = 0.20 # Weight for code complexity (increased)
roi = 0.25 # Weight for return on investment (increased)
semantic = 0.05 # Weight for semantic importance
dependency = 0.10 # Weight for dependency criticality
security = 0.05 # Weight for security issues
organization = 0.05 # Weight for code organization issues
[thresholds]
complexity = 10
duplication = 50
max_file_length = 500
max_function_length = 50
# Minimum thresholds for including items in debt analysis
# These help filter out trivial functions that aren't really technical debt
minimum_debt_score = 2.0 # Increased from 1.0 to filter out minor issues
minimum_cyclomatic_complexity = 3 # Increased from 1 to skip simple functions
minimum_cognitive_complexity = 5 # Increased from 1 to skip simple cognitive load
minimum_risk_score = 2.0 # Increased from 1.0 for Risk debt types
# Validation thresholds for 'debtmap validate' command
[thresholds.validation]
max_average_complexity = 10.0 # Maximum allowed average complexity
max_high_complexity_count = 100 # Maximum allowed high complexity functions
max_debt_items = 2500 # Maximum allowed technical debt items
max_total_debt_score = 1000 # Maximum allowed total debt score (unified scoring)
max_codebase_risk_score = 7.0 # Maximum allowed codebase risk score
max_high_risk_functions = 50 # Maximum allowed high-risk functions
min_coverage_percentage = 0.0 # Minimum required code coverage percentage (0 = no minimum)
[languages]
enabled = ["rust", "javascript", "python", "go"]
[ignore]
patterns = [
"target/**",
"venv/**",
"node_modules/**",
"*.min.js",
"benches/**",
"tests/**/*", # Exclude all files in tests directory
"**/test_*.rs", # Exclude test files with test_ prefix
"**/*_test.rs", # Exclude test files with _test suffix
"**/*_tests.rs", # Exclude test files with _tests suffix
"**/fixtures/**", # Exclude test fixtures
"**/mocks/**", # Exclude mock implementations
"**/stubs/**", # Exclude stub implementations
"**/examples/**", # Exclude example code
"**/demo/**", # Exclude demo code
"**/*_demo.rs", # Exclude demo files
"**/testdata/**", # Exclude test data directories
]
# Function name patterns to ignore - common patterns that are intentionally complex
[ignore.functions]
patterns = [
# Test setup/teardown that are naturally complex
"setup_test_*",
"teardown_test_*",
"create_test_*",
"mock_*",
# Generated or macro-expanded code patterns
"derive_*",
"__*", # Dunder methods
# CLI argument parsing - naturally complex
"parse_args",
"parse_cli",
"build_cli",
# Serialization/deserialization - naturally complex pattern matching
"serialize_*",
"deserialize_*",
"to_json",
"from_json",
"to_*_format",
"from_*_format",
]
[output]
default_format = "terminal"
[external_api]
# Enable automatic external API detection for testing
detect_external_api = false
# However, we can still explicitly mark certain functions as APIs if needed
# (Currently empty since debtmap doesn't expose any external APIs)
api_functions = []
api_files = []
[orchestration]
# Configuration for orchestration detection to reduce false positives
# Minimum number of meaningful function delegations to be considered orchestration
# Increased from 2 to 3 to reduce false positives
min_delegations = 3
# Whether to exclude adapter patterns (single delegation with data transformation)
# Default: true (adapters are not considered orchestration)
exclude_adapters = true
# Whether to recognize functional chains (map/filter/collect) as idiomatic patterns
# Default: true (functional chains are not considered orchestration)
allow_functional_chains = true
# Additional function name patterns to exclude from orchestration detection
# These patterns will never be considered orchestration regardless of structure
exclude_patterns = [
# Simple delegation patterns
"*_wrapper",
"*_adapter",
"convert_*",
"transform_*",
"map_*",
"translate_*",
# Proxy/facade patterns
"*_proxy",
"*_facade",
# Factory methods that delegate
"create_*",
"build_*",
"make_*",
# Visitor pattern methods
"visit_*",
"walk_*",
"traverse_*",
]
# Additional function name patterns to always consider as orchestration
# These patterns will be considered orchestration if they meet minimum requirements
include_patterns = [
"workflow_*",
"pipeline_*",
"process_*",
"orchestrate_*",
"coordinate_*",
"execute_flow_*",
]
[entropy]
enabled = true
weight = 0.5
min_tokens = 10
pattern_threshold = 0.7
# Pattern-specific adjustments to reduce false positives
[patterns]
# Detector functions often have moderate complexity by design
[patterns.detectors]
name_patterns = ["detect_*", "check_*", "validate_*", "verify_*"]
complexity_adjustment = 0.7 # Reduce complexity score by 30% for detector patterns
cognitive_adjustment = 0.8 # Reduce cognitive complexity by 20%
# Builder patterns often have chained method calls
[patterns.builders]
name_patterns = ["*Builder", "builder", "with_*", "set_*"]
orchestration_threshold = 5 # Need at least 5 delegations to be considered orchestration
complexity_adjustment = 0.8 # Reduce complexity score by 20%
# Pattern matching functions are idiomatic in Rust
[patterns.matching]
name_patterns = ["match_*", "classify_*", "categorize_*", "determine_*"]
complexity_adjustment = 0.6 # Reduce complexity score by 40% for pattern matching
cognitive_adjustment = 0.7 # Reduce cognitive complexity by 30%
# Error handling functions naturally have branching
[patterns.error_handling]
name_patterns = ["handle_error", "process_error", "map_error", "convert_error"]
complexity_adjustment = 0.7 # Reduce complexity score by 30%
# Configuration loading is naturally complex
[patterns.configuration]
name_patterns = ["load_config", "parse_config", "init_*", "setup_*"]
complexity_adjustment = 0.8 # Reduce complexity score by 20%
minimum_complexity = 15 # Only flag if complexity > 15
# Visitor pattern implementations
[patterns.visitors]
name_patterns = ["visit_*", "walk_*", "traverse_*"]
orchestration_threshold = 6 # Need at least 6 delegations
complexity_adjustment = 0.7 # Reduce complexity score by 30%