vorteil/direktiv

View on GitHub
pkg/flow/server.go

Summary

Maintainability
C
1 day
Test Coverage

Function initLegacyServer has 118 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 3 hrs to fix

    Function Run has 72 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 18 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