horizoncd/horizon

View on GitHub
core/cmd/cmd.go

Summary

Maintainability
D
2 days
Test Coverage

Showing 3 of 3 total issues

Function Init has 392 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func Init(ctx context.Context, flags *Flags, coreConfig *config.Config) {
// init roles
file, err := os.OpenFile(flags.RoleConfigFile, os.O_RDONLY, 0644)
if err != nil {
panic(err)
Severity: Major
Found in core/cmd/cmd.go - About 1 day to fix

    File cmd.go has 664 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    // Copyright © 2023 Horizoncd.
    //
    // Licensed under the Apache License, Version 2.0 (the "License");
    // you may not use this file except in compliance with the License.
    // You may obtain a copy of the License at
    Severity: Minor
    Found in core/cmd/cmd.go - About 5 hrs to fix

      Function Init has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
      Open

      func Init(ctx context.Context, flags *Flags, coreConfig *config.Config) {
      // init roles
      file, err := os.OpenFile(flags.RoleConfigFile, os.O_RDONLY, 0644)
      if err != nil {
      panic(err)
      Severity: Minor
      Found in core/cmd/cmd.go - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status