Repository navigation
Expand file tree
/
Copy pathlucent-thresholds.toml
More file actions
141 lines (110 loc) · 5.5 KB
/
Copy pathlucent-thresholds.toml
File metadata and controls
141 lines (110 loc) · 5.5 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
# Example .lucent.toml with Quality Thresholds
# Copy this to your project root as .lucent.toml
[project]
name = "my-project"
version = "1.0.0"
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Quality Thresholds
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# These thresholds are enforced when running `lucent` without CLI flags
# CLI flags take precedence over these settings
[thresholds]
# Maximum allowed cyclomatic complexity (per function average)
# Recommended: 10 (strict), 15 (moderate), 20 (lenient)
max_cyclomatic_complexity = 15.0
# Maximum allowed cognitive complexity
max_cognitive_complexity = 25.0
# Maximum allowed nesting depth
# Recommended: 3 (strict), 4 (moderate), 5 (lenient)
max_nesting_depth = 4.0
# Maximum allowed function length (lines)
# Recommended: 40 (strict), 50 (moderate), 60 (lenient)
max_function_length = 50
# Minimum required comment quality (0.0-1.0)
min_comment_quality = 0.3
# Minimum required maintainability index (0-100)
# Recommended: 75 (strict), 65 (moderate), 50 (lenient)
min_maintainability_index = 65.0
# Code density limits (0.0-1.0)
max_code_density = 0.8
min_code_density = 0.5
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Code Smell Limits
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Maximum allowed code smells (aggregate becomes --max-code-smells)
max_long_functions = 10 # Functions >50 lines
max_function_parameters = 5 # Parameters per function
max_deep_nesting_instances = 5 # Nesting >4 levels
max_magic_numbers = 20 # Unnamed numeric literals
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Quality Gates for CI/CD
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[quality_gates]
# Fail build if thresholds exceeded
fail_on_complexity = true
fail_on_nesting = true
fail_on_maintainability = true
fail_on_code_smells = false
# Only warn, don't fail build (overrides all fail_on_* settings)
# Set to false to enforce quality gates
warn_only = false
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Ignore Patterns
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[ignore]
patterns = [
"target/",
"node_modules/",
"vendor/",
"dist/",
"build/",
"*.min.js",
"*.bundle.js",
]
use_lucentignore = true
use_gitignore = true
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Language-Specific Thresholds
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Override thresholds for specific languages
# Useful when different languages have different complexity norms
[languages.rust]
max_cyclomatic_complexity = 12.0
max_nesting_depth = 3.0
max_function_length = 40
[languages.python]
max_cyclomatic_complexity = 15.0
max_nesting_depth = 4.0
max_function_length = 50
[languages.javascript]
max_cyclomatic_complexity = 18.0
max_nesting_depth = 5.0
max_function_length = 45
[languages.typescript]
max_cyclomatic_complexity = 15.0
max_nesting_depth = 4.0
[languages.go]
max_cyclomatic_complexity = 15.0
max_nesting_depth = 4.0
max_function_length = 50
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Output Configuration
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[output]
default_format = "pretty"
show_per_file = false
colorize = true
charts_in_html = true
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Usage Examples
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# 1. Use thresholds from this file:
# lucent
# 2. Override with CLI flags (CLI takes precedence):
# lucent --max-complexity 10.0
# 3. Use custom config file:
# lucent --config-file my-strict-config.toml
# 4. Combine config + CLI overrides:
# lucent --max-complexity 20.0 # Overrides file setting
# 5. Disable all thresholds:
# lucent # Just run without any --max-* flags and without this file