vorteil/direktiv

View on GitHub
pkg/flow/server.go

Summary

Maintainability
C
7 hrs
Test Coverage

Function initLegacyServer has 99 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func initLegacyServer(circuit *core.Circuit, config *core.Config, db *gorm.DB, dbManager *database.SQLStore) (*server, error) {
    srv := new(server)
    srv.ID = uuid.New()
    srv.initJQ()
    srv.config = config
Severity: Major
Found in pkg/flow/server.go - About 2 hrs to fix

    Function Run has 70 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func Run(circuit *core.Circuit) error {
        config := &core.Config{}
        if err := env.Parse(config); err != nil {
            return fmt.Errorf("parsing env variables: %w", err)
        }
    Severity: Minor
    Found in pkg/flow/server.go - About 1 hr to fix

      Function initLegacyServer has 13 return statements (exceeds 4 allowed).
      Open

      func initLegacyServer(circuit *core.Circuit, config *core.Config, db *gorm.DB, dbManager *database.SQLStore) (*server, error) {
          srv := new(server)
          srv.ID = uuid.New()
          srv.initJQ()
          srv.config = config
      Severity: Major
      Found in pkg/flow/server.go - About 1 hr to fix

        Function Run has 12 return statements (exceeds 4 allowed).
        Open

        func Run(circuit *core.Circuit) error {
            config := &core.Config{}
            if err := env.Parse(config); err != nil {
                return fmt.Errorf("parsing env variables: %w", err)
            }
        Severity: Major
        Found in pkg/flow/server.go - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status