fallow_config/config/
health.rs1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4const fn default_max_cyclomatic() -> u16 {
5 20
6}
7
8const fn default_max_cognitive() -> u16 {
9 15
10}
11
12#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema)]
14#[serde(rename_all = "camelCase")]
15pub struct HealthConfig {
16 #[serde(default = "default_max_cyclomatic")]
19 pub max_cyclomatic: u16,
20
21 #[serde(default = "default_max_cognitive")]
24 pub max_cognitive: u16,
25
26 #[serde(default)]
28 pub ignore: Vec<String>,
29}
30
31impl Default for HealthConfig {
32 fn default() -> Self {
33 Self {
34 max_cyclomatic: default_max_cyclomatic(),
35 max_cognitive: default_max_cognitive(),
36 ignore: vec![],
37 }
38 }
39}