prysmaticlabs / prysm

Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
3 occurrences in this check
func main has a cyclomatic complexity of 18 with "high" risk
151	appFlags = cmd.WrapFlags(append(appFlags, features.BeaconChainFlags...))
152}
153
154func main() {155	// rctx = root context with cancellation.
156	// note other instances of ctx in this func are *cli.Context.
157	rctx, cancel := context.WithCancel(context.Background())
func startDB has a cyclomatic complexity of 24 with "high" risk
 434	close(b.stop)
 435}
 436
 437func (b *BeaconNode) startDB(cliCtx *cli.Context, depositAddress string) error { 438	baseDir := cliCtx.String(cmd.DataDirFlag.Name)
 439	dbPath := filepath.Join(baseDir, kv.BeaconNodeDbDirName)
 440	clearDB := cliCtx.Bool(cmd.ClearDB.Name)
func New has a cyclomatic complexity of 41 with "very-high" risk
 126
 127// New creates a new node instance, sets up configuration options, and registers
 128// every required service to the node.
 129func New(cliCtx *cli.Context, cancel context.CancelFunc, opts ...Option) (*BeaconNode, error) { 130	if err := configureTracing(cliCtx); err != nil {
 131		return nil, err
 132	}