{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Config",
"description": "Global analyzer configuration.",
"type": "object",
"properties": {
"exclude": {
"description": "Glob patterns for files/directories to exclude.",
"type": "array",
"default": [
"node_modules",
"vendor",
"dist",
"target",
"__pycache__",
"build",
".git"
],
"items": {
"type": "string"
}
},
"thresholds": {
"description": "Global and language-specific threshold overrides.",
"$ref": "#/$defs/ThresholdsConfig",
"default": {
"global": {
"max_depth": 6,
"max_imports": 25,
"max_lines": 400,
"max_lines_per_function": 200,
"max_repetition": 15.0,
"min_duplicate_lines": 4
},
"overrides": {
"cpp": null,
"cs": null,
"gd": null,
"go": null,
"java": null,
"js": null,
"lua": null,
"php": null,
"py": null,
"rs": null,
"ts": null
}
}
}
},
"$defs": {
"PartialThresholds": {
"description": "Sparse threshold structure for specific overrides.",
"type": "object",
"properties": {
"max_depth": {
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0
},
"max_imports": {
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0
},
"max_lines": {
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0
},
"max_lines_per_function": {
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0
},
"max_repetition": {
"type": [
"number",
"null"
],
"format": "double"
},
"min_duplicate_lines": {
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0
}
}
},
"Thresholds": {
"description": "Defines health metric limits for analysis.",
"type": "object",
"properties": {
"max_depth": {
"description": "Maximum allowed control flow nesting depth.",
"type": "integer",
"format": "uint",
"default": 6,
"minimum": 0
},
"max_imports": {
"description": "Maximum allowed import/dependency statements.",
"type": "integer",
"format": "uint",
"default": 25,
"minimum": 0
},
"max_lines": {
"description": "Maximum allowed source lines of code.",
"type": "integer",
"format": "uint",
"default": 400,
"minimum": 0
},
"max_lines_per_function": {
"description": "Maximum allowed average lines per function.",
"type": "integer",
"format": "uint",
"default": 200,
"minimum": 0
},
"max_repetition": {
"description": "Maximum allowed repetition percentage (0-100).",
"type": "number",
"format": "double",
"default": 15.0
},
"min_duplicate_lines": {
"description": "Minimum identical lines to trigger repetition detection.",
"type": "integer",
"format": "uint",
"default": 4,
"minimum": 0
}
}
},
"ThresholdsConfig": {
"description": "Threshold management container.",
"type": "object",
"properties": {
"global": {
"description": "Default thresholds for all files.",
"$ref": "#/$defs/Thresholds",
"default": {
"max_depth": 6,
"max_imports": 25,
"max_lines": 400,
"max_lines_per_function": 200,
"max_repetition": 15.0,
"min_duplicate_lines": 4
}
},
"overrides": {
"description": "Language-specific overrides.",
"$ref": "#/$defs/ThresholdsOverrides",
"default": {
"cpp": null,
"cs": null,
"gd": null,
"go": null,
"java": null,
"js": null,
"lua": null,
"php": null,
"py": null,
"rs": null,
"ts": null
}
}
}
},
"ThresholdsOverrides": {
"description": "Known and custom language overrides.",
"type": "object",
"properties": {
"cpp": {
"description": "`C/C++` overrides",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
},
"cs": {
"description": "C# overrides (.cs)",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
},
"gd": {
"description": "`GDScript` overrides (.gd)",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
},
"go": {
"description": "`Go` overrides (.go)",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
},
"java": {
"description": "Java overrides (.java)",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
},
"js": {
"description": "JavaScript overrides (.js, .mjs, .cjs)",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
},
"lua": {
"description": "`Lua` overrides (.lua)",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
},
"php": {
"description": "`PHP` overrides (.php)",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
},
"py": {
"description": "Python overrides (.py)",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
},
"rs": {
"description": "Rust overrides (.rs)",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
},
"ts": {
"description": "TypeScript overrides (.ts, .tsx)G",
"anyOf": [
{
"$ref": "#/$defs/PartialThresholds"
},
{
"type": "null"
}
]
}
},
"additionalProperties": {
"$ref": "#/$defs/PartialThresholds"
}
}
}
}