Repository navigation
Expand file tree
/
Copy pathcodeint.schema.json
More file actions
743 lines (743 loc) · 24.8 KB
/
Copy pathcodeint.schema.json
File metadata and controls
743 lines (743 loc) · 24.8 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
{
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": [
"string",
"null"
],
"description": "The address of this JSON schema, for editors; codeint does not read it.",
"default": null
},
"source_sets": {
"$ref": "#/$defs/SourceSetGlobs",
"description": "Globs of repository-relative paths that put files into a Source set, whatever the Source set rules say. When globs of several Source sets match one file, the first of vendored, generated, test, and production wins.",
"default": {
"production": [],
"test": [],
"generated": [],
"vendored": []
}
},
"budgets": {
"$ref": "#/$defs/SourceSetBudgets",
"description": "The highest ratio each Metric may reach in each Source set; a Metric over its Budget fails the run with exit code 1. A ratio equal to its Budget passes. Codeint compares the ratio as the report shows it, rounded to 4 decimal places.",
"default": {
"production": {},
"test": {},
"generated": {},
"vendored": {}
}
},
"regression_limits": {
"$ref": "#/$defs/RegressionLimitsFile",
"description": "How much each Metric may get worse from the merge-base to the head side before codeint diff reports a Regression and exits with code 1. A key named after a Metric sets its limit in every Source set; a key named after a Source set sets limits for that Source set only. For each setting, the limit of the Source set wins over the limit of the Metric, and a setting left out keeps the default: a ratio rise of 0.01, and new Findings fail only with a numerator rise, except for Import cycles, where any new Finding fails.",
"default": {}
},
"languages": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/$defs/LanguageGlobs"
},
"description": "Which Language plugin measures which folders. Each entry names a Language plugin, the globs of the folders or files it measures, and the globs it leaves out. Several entries may name one Language plugin; it measures what any of them includes. Without this key, every Language plugin measures the whole repository; with it, a Language plugin measures only what its entries include."
},
"plugins": {
"type": "array",
"items": {
"$ref": "#/$defs/PluginEntry"
},
"description": "External WebAssembly component Language and Metric plugins to load from local paths or HTTPS URLs. Each entry names the plugin, its optional kind (language by default, or metric), either its local path or its HTTPS url, and its required SHA-256 hex digest."
},
"plugin_limits": {
"$ref": "#/$defs/PluginLimitsFile",
"description": "Memory cap and time limit enforced on each WebAssembly Plugin. Defaults are 64 MiB and 5000 ms."
},
"boundaries": {
"$ref": "#/$defs/BoundariesFile",
"description": "Architectural import boundaries defining named zones, optional public_files entry points, directional allow or deny rules, and optional strict_zones mode."
},
"dependencies": {
"$ref": "#/$defs/DependenciesFile",
"description": "Dependency hygiene settings, including the allowlist of external package names excluded from unused, unlisted, and dev-in-production Findings."
},
"duplication": {
"$ref": "#/$defs/DuplicationConfigFile",
"description": "Settings for Duplication detection, including opt-in shingle-based near-clone detection. Exact Clone groups remain the default when omitted."
},
"entry_points": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of repository-relative paths treated as additional Production entry points for Orphan files detection, combined with manifest-discovered entry points."
},
"coverage_reports": {
"type": "array",
"items": {
"type": "string"
},
"description": "Paths relative to the repository root of LCOV or Cobertura XML Coverage reports used to measure Test gap."
},
"sql": {
"$ref": "#/$defs/SqlConfigFile",
"description": "SQL settings, including Dialect mappings for folders or files."
},
"hazards": {
"$ref": "#/$defs/HazardsConfigFile",
"description": "Hazards Metric settings, including Hazard line rules turned off across the repository."
}
},
"title": "codeint.json",
"description": "The configuration of codeint, read from codeint.json at the root of the repository.",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"SourceSetGlobs": {
"type": "object",
"additionalProperties": false,
"properties": {
"production": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of files that belong to the Production Source set.",
"default": []
},
"test": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of files that belong to the Test Source set.",
"default": []
},
"generated": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of files that belong to the Generated Source set.",
"default": []
},
"vendored": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of files that belong to the Vendored Source set.",
"default": []
}
}
},
"SourceSetBudgets": {
"type": "object",
"additionalProperties": false,
"properties": {
"production": {
"$ref": "#/$defs/ProductionMetricBudgets",
"description": "The Budgets of the Production Source set.",
"default": {}
},
"test": {
"$ref": "#/$defs/MetricBudgets",
"description": "The Budgets of the Test Source set.",
"default": {}
},
"generated": {
"$ref": "#/$defs/MetricBudgets",
"description": "The Budgets of the Generated Source set.",
"default": {}
},
"vendored": {
"$ref": "#/$defs/MetricBudgets",
"description": "The Budgets of the Vendored Source set.",
"default": {}
},
"unused_dependencies": {
"type": "number",
"format": "double",
"description": "The highest share of declared dependencies that may be unused, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"unlisted_dependencies": {
"type": "number",
"format": "double",
"description": "The highest share of imported external packages that may be unlisted, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"dev_in_production_dependencies": {
"type": "number",
"format": "double",
"description": "The highest share of production-imported external packages that may be dev-only, from 0 to 1.",
"minimum": 0,
"maximum": 1
}
}
},
"ProductionMetricBudgets": {
"type": "object",
"properties": {
"erosion": {
"type": "number",
"format": "double",
"description": "The highest Erosion ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"cognitive_complexity": {
"type": "number",
"format": "double",
"description": "The highest Cognitive complexity ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"duplication": {
"type": "number",
"format": "double",
"description": "The highest Duplication ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"verbosity": {
"type": "number",
"format": "double",
"description": "The highest Verbosity ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"import_cycles": {
"type": "number",
"format": "double",
"description": "The highest Import cycles ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"boundaries": {
"type": "number",
"format": "double",
"description": "The highest Boundaries ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"orphan_files": {
"type": "number",
"format": "double",
"description": "The highest Orphan files ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"hazards": {
"type": "number",
"format": "double",
"description": "The highest Hazards ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"test_gap": {
"type": "number",
"format": "double",
"description": "The highest Test gap ratio, from 0 to 1. Applies to the Production Source set only.",
"minimum": 0,
"maximum": 1
}
},
"additionalProperties": {
"$ref": "#/$defs/Budget"
}
},
"Budget": {
"type": "number",
"format": "double",
"minimum": 0,
"maximum": 1
},
"MetricBudgets": {
"type": "object",
"properties": {
"erosion": {
"type": "number",
"format": "double",
"description": "The highest Erosion ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"cognitive_complexity": {
"type": "number",
"format": "double",
"description": "The highest Cognitive complexity ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"duplication": {
"type": "number",
"format": "double",
"description": "The highest Duplication ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"verbosity": {
"type": "number",
"format": "double",
"description": "The highest Verbosity ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"import_cycles": {
"type": "number",
"format": "double",
"description": "The highest Import cycles ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"boundaries": {
"type": "number",
"format": "double",
"description": "The highest Boundaries ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"orphan_files": {
"type": "number",
"format": "double",
"description": "The highest Orphan files ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
},
"hazards": {
"type": "number",
"format": "double",
"description": "The highest Hazards ratio, from 0 to 1.",
"minimum": 0,
"maximum": 1
}
},
"additionalProperties": {
"$ref": "#/$defs/Budget"
}
},
"RegressionLimitsFile": {
"type": "object",
"properties": {
"erosion": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Erosion in every Source set."
},
"cognitive_complexity": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Cognitive complexity in every Source set."
},
"duplication": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Duplication in every Source set."
},
"verbosity": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Verbosity in every Source set."
},
"import_cycles": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Import cycles in every Source set."
},
"boundaries": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Boundaries in every Source set."
},
"orphan_files": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Orphan files in every Source set."
},
"hazards": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Hazards in every Source set."
},
"unused_dependencies": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of unused declared dependencies."
},
"unlisted_dependencies": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of unlisted external dependencies."
},
"dev_in_production_dependencies": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of dev dependencies imported in production."
},
"production": {
"$ref": "#/$defs/MetricRegressionLimits",
"description": "The Regression limits of the Production Source set."
},
"test": {
"$ref": "#/$defs/MetricRegressionLimits",
"description": "The Regression limits of the Test Source set."
},
"generated": {
"$ref": "#/$defs/MetricRegressionLimits",
"description": "The Regression limits of the Generated Source set."
},
"vendored": {
"$ref": "#/$defs/MetricRegressionLimits",
"description": "The Regression limits of the Vendored Source set."
}
},
"additionalProperties": {
"$ref": "#/$defs/RegressionLimitSetting"
}
},
"RegressionLimitSetting": {
"type": "object",
"additionalProperties": false,
"properties": {
"ratio_rise": {
"type": "number",
"format": "double",
"description": "The highest rise of the ratio, from 0 to 1, as the report shows it, rounded to 4 decimal places. A rise equal to the limit passes.",
"minimum": 0,
"maximum": 1
},
"new_findings": {
"$ref": "#/$defs/NewFindingsRule",
"description": "When new Findings fail: any_new_finding fails on any new Finding; numerator_rise_with_new_findings fails only when the numerator rises too, so a Finding that only moves passes; never lets new Findings pass, so that with ratio_rise 1 this Metric never makes a Regression here."
}
}
},
"NewFindingsRule": {
"type": "string",
"enum": [
"any_new_finding",
"numerator_rise_with_new_findings",
"never"
]
},
"MetricRegressionLimits": {
"type": "object",
"properties": {
"erosion": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Erosion in this Source set."
},
"cognitive_complexity": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Cognitive complexity in this Source set."
},
"duplication": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Duplication in this Source set."
},
"verbosity": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Verbosity in this Source set."
},
"import_cycles": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Import cycles in this Source set."
},
"boundaries": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Boundaries in this Source set."
},
"orphan_files": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Orphan files in this Source set."
},
"hazards": {
"$ref": "#/$defs/RegressionLimitSetting",
"description": "The Regression limit of Hazards in this Source set."
}
},
"additionalProperties": {
"$ref": "#/$defs/RegressionLimitSetting"
}
},
"LanguageGlobs": {
"type": "object",
"additionalProperties": false,
"properties": {
"plugin": {
"type": "string",
"description": "The name of the Language plugin, such as typescript-javascript."
},
"include": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of repository-relative folders or files that the Language plugin measures; a folder covers every file below it."
},
"exclude": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of repository-relative folders or files inside the included ones that the Language plugin leaves out.",
"default": []
}
},
"required": [
"plugin",
"include"
]
},
"PluginEntry": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "The name of the external Plugin."
},
"kind": {
"$ref": "#/$defs/PluginKind",
"description": "Whether the external Plugin is a Language plugin or a Metric plugin; language by default.",
"default": "language"
},
"path": {
"type": [
"string",
"null"
],
"description": "Path to the WebAssembly component file, relative to the repository root or absolute. Set either path or url, not both."
},
"url": {
"type": [
"string",
"null"
],
"description": "HTTPS URL of the WebAssembly component file. Set either path or url, not both."
},
"sha256": {
"type": "string",
"description": "The required 64-character hexadecimal SHA-256 digest of the plugin file."
}
},
"required": [
"name",
"sha256"
]
},
"PluginKind": {
"type": "string",
"enum": [
"language",
"metric"
]
},
"PluginLimitsFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"memory_mb": {
"type": "integer",
"format": "uint64",
"minimum": 1,
"description": "Maximum linear memory in MiB that a WebAssembly Plugin may allocate; 64 by default.",
"maximum": 4096
},
"timeout_ms": {
"type": "integer",
"format": "uint64",
"minimum": 1,
"description": "Maximum wall-clock time in milliseconds for each WebAssembly Plugin call; 5000 by default.",
"maximum": 300000
}
}
},
"BoundariesFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"preset": {
"$ref": "#/$defs/BoundaryPreset",
"description": "Optional built-in architecture preset (\"layered\" or \"hexagonal\") providing default zones and rules that can be overridden or extended by zones and rules."
},
"zones": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/BoundaryZoneFile"
},
"description": "Named architectural zones, each defined by repository-relative path globs and optional public_files globs.",
"default": {}
},
"rules": {
"type": "array",
"items": {
"$ref": "#/$defs/BoundaryRuleFile"
},
"description": "Directional allow or deny import rules between architectural zones."
},
"strict_zones": {
"type": "boolean",
"description": "When true, report files in evaluated Source sets that do not match any configured zone."
},
"source_sets": {
"type": "array",
"items": {
"$ref": "#/$defs/BoundarySourceSet"
},
"description": "Source sets evaluated by boundary rules; defaults to [\"production\"] when omitted or empty."
}
}
},
"BoundaryPreset": {
"type": "string",
"enum": [
"layered",
"hexagonal"
]
},
"BoundaryZoneFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"patterns": {
"type": "array",
"items": {
"type": "string"
},
"description": "Repository-relative path globs that assign files to this architectural zone."
},
"public_files": {
"type": "array",
"items": {
"type": "string"
},
"description": "Optional repository-relative path globs naming the only files in this zone that other zones may import."
}
},
"required": [
"patterns"
]
},
"BoundaryRuleFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"from": {
"type": "string",
"description": "Source zone name, or \"*\" to match any zone without a specific rule."
},
"allow": {
"type": "array",
"items": {
"type": "string"
},
"description": "Target zone names (or \"*\") that the source zone is allowed to import. Mutually exclusive with deny."
},
"deny": {
"type": "array",
"items": {
"type": "string"
},
"description": "Target zone names (or \"*\") that the source zone is forbidden to import. Mutually exclusive with allow."
},
"reason": {
"type": "string",
"description": "Optional human-readable explanation shown in boundary Findings."
}
},
"required": [
"from"
]
},
"BoundarySourceSet": {
"type": "string",
"enum": [
"production",
"test",
"generated",
"vendored"
]
},
"DependenciesFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"ignore": {
"type": "array",
"items": {
"type": "string"
},
"description": "Canonical external package names excluded from unused, unlisted, and dev-in-production dependency Findings."
}
}
},
"DuplicationConfigFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"near_clones": {
"type": "boolean",
"description": "When true, detect near-duplicate code blocks using shingle similarity in addition to exact Clone groups; false by default."
},
"min_similarity": {
"type": "number",
"format": "double",
"description": "Minimum Jaccard shingle similarity in (0, 1] required for two blocks to match as a near-clone; 0.85 by default.",
"maximum": 1,
"exclusiveMinimum": 0
}
}
},
"SqlConfigFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"dialects": {
"type": "array",
"items": {
"$ref": "#/$defs/SqlDialectEntryFile"
},
"description": "Folder or file patterns mapped to a SQL Dialect (postgresql, mysql, sqlite, or duckdb). Files covered by no entry use generic SQL."
}
}
},
"SqlDialectEntryFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"dialect": {
"$ref": "#/$defs/ConfiguredSqlDialect",
"description": "SQL Dialect for matching files: postgresql, mysql (including MariaDB), sqlite, or duckdb."
},
"include": {
"type": "array",
"items": {
"type": "string"
},
"description": "Globs of repository-relative folders or files that use this SQL Dialect; a folder covers every file below it."
}
},
"required": [
"dialect",
"include"
]
},
"ConfiguredSqlDialect": {
"type": "string",
"enum": [
"postgresql",
"mysql",
"sqlite",
"duckdb"
]
},
"HazardsConfigFile": {
"type": "object",
"additionalProperties": false,
"properties": {
"disabled_rules": {
"type": "array",
"items": {
"type": "string"
},
"description": "Names of Hazard line rules turned off across the repository. A turned-off rule adds no Hazard line and no Finding."
}
}
}
}
}