Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
3 occurrences in this check
func adjust has a cyclomatic complexity of 17 with "high" risk
1086	GCTunerThreshold float64 `toml:"gc-tuner-threshold" json:"gc-tuner-threshold"`
1087}
1088
1089func (c *PDServerConfig) adjust(meta *configutil.ConfigMetaData) error {1090	configutil.AdjustDuration(&c.MaxResetTSGap, defaultMaxResetTSGap)
1091	if !meta.IsDefined("use-region-storage") {
1092		c.UseRegionStorage = defaultUseRegionStorage
func adjust has a cyclomatic complexity of 29 with "very-high" risk
 733	defaultStoreLimitVersion = "v1"
 734)
 735
 736func (c *ScheduleConfig) adjust(meta *configutil.ConfigMetaData, reloading bool) error { 737	if !meta.IsDefined("max-snapshot-count") {
 738		configutil.AdjustUint64(&c.MaxSnapshotCount, defaultMaxSnapshotCount)
 739	}
func Adjust has a cyclomatic complexity of 20 with "high" risk
 389}
 390
 391// Adjust is used to adjust the PD configurations.
 392func (c *Config) Adjust(meta *toml.MetaData, reloading bool) error { 393	configMetaData := configutil.NewConfigMetadata(meta)
 394	if err := configMetaData.CheckUndecoded(); err != nil {
 395		c.WarningMsgs = append(c.WarningMsgs, err.Error())