42Atomys/webhooked

View on GitHub

Showing 20 of 23 total issues

Function webhookService has 8 return statements (exceeds 4 allowed).
Open

func webhookService(s *Server, spec *config.WebhookSpec, r *http.Request) (responseTemplare string, err error) {
    ctx := r.Context()

    if spec == nil {
        return "", config.ErrSpecNotFound
Severity: Major
Found in internal/server/v1alpha1/handlers.go - About 50 mins to fix

    Function Load has 7 return statements (exceeds 4 allowed).
    Open

    func Load(cfgFile string) error {
        var k = koanf.New(".")
    
        // Load YAML config.
        if err := k.Load(file.Provider(cfgFile), yaml.Parser()); err != nil {
    Severity: Major
    Found in internal/config/configuration.go - About 45 mins to fix

      Function loadTemplate has 6 return statements (exceeds 4 allowed).
      Open

      func loadTemplate(spec, parentSpec *FormattingSpec, defaultTemplate string) (*FormattingSpec, error) {
          if spec == nil {
              spec = &FormattingSpec{}
          }
      
      
      Severity: Major
      Found in internal/config/configuration.go - About 40 mins to fix

        Method storage.Push has 6 return statements (exceeds 4 allowed).
        Open

        func (c storage) Push(ctx context.Context, value []byte) error {
            // ! Deprecation notice: End of life in v1.0.0
            if !c.config.UseFormattingToPerformQuery {
                request := fmt.Sprintf("INSERT INTO %s(%s) VALUES ($1)", c.config.TableName, c.config.DataField)
                if _, err := c.client.Query(request, value); err != nil {
        Severity: Major
        Found in pkg/storage/postgres/postgres.go - About 40 mins to fix

          Function NewStorage has 5 return statements (exceeds 4 allowed).
          Open

          func NewStorage(configRaw map[string]interface{}) (*storage, error) {
              var err error
          
              newClient := storage{
                  config: &config{},
          Severity: Major
          Found in pkg/storage/postgres/postgres.go - About 35 mins to fix

            Method Formatter.Render has 5 return statements (exceeds 4 allowed).
            Open

            func (d *Formatter) Render() (string, error) {
                d.mu.RLock()
                defer d.mu.RUnlock()
            
                if d.tmplString == "" {
            Severity: Major
            Found in pkg/formatting/formatter.go - About 35 mins to fix

              exported func NewStorage returns unexported type *postgres.storage, which can be annoying to use
              Open

              func NewStorage(configRaw map[string]interface{}) (*storage, error) {
              Severity: Minor
              Found in pkg/storage/postgres/postgres.go by golint

              exported func NewStorage returns unexported type *redis.storage, which can be annoying to use
              Open

              func NewStorage(configRaw map[string]interface{}) (*storage, error) {
              Severity: Minor
              Found in pkg/storage/redis/redis.go by golint

              func toJson should be toJSON
              Open

              func toJson(v interface{}) string {
              Severity: Minor
              Found in pkg/formatting/functions.go by golint

              func toPrettyJson should be toPrettyJSON
              Open

              func toPrettyJson(v interface{}) string {
              Severity: Minor
              Found in pkg/formatting/functions.go by golint

              a blank import should be only in a main or test package, or have a comment justifying it
              Open

                  _ "github.com/lib/pq"
              Severity: Minor
              Found in pkg/storage/postgres/postgres.go by golint

              var uniquenessUrl should be uniquenessURL
              Open

                  var uniquenessUrl = make(map[string]bool)
              Severity: Minor
              Found in internal/config/configuration.go by golint

              exported type ResponseSpec should have comment or be unexported
              Open

              type ResponseSpec struct {
              Severity: Minor
              Found in internal/config/structs.go by golint

              Your code does not pass gofmt in 1 place. Go fmt your code!
              Open

              package server
              Severity: Minor
              Found in internal/server/middlewares.go by gofmt

              exported type Server should have comment or be unexported
              Open

              type Server struct {
              Severity: Minor
              Found in internal/server/serve.go by golint

              struct field HttpCode should be HTTPCode
              Open

                  HttpCode int `mapstructure:"httpCode" json:"httpCode"`
              Severity: Minor
              Found in internal/config/structs.go by golint

              func fromJson should be fromJSON
              Open

              func fromJson(v interface{}) map[string]interface{} {
              Severity: Minor
              Found in pkg/formatting/functions.go by golint

              exported func NewStorage returns unexported type *rabbitmq.storage, which can be annoying to use
              Open

              func NewStorage(configRaw map[string]interface{}) (*storage, error) {
              Severity: Minor
              Found in pkg/storage/rabbitmq/rabbitmq.go by golint

              exported type Formatter should have comment or be unexported
              Open

              type Formatter struct {
              Severity: Minor
              Found in pkg/formatting/formatter.go by golint

              2: cannot find package "github.com/spf13/cobra" in any of:
              Open

                  "github.com/spf13/cobra"
              Severity: Minor
              Found in cmd/root.go by govet
              Severity
              Category
              Status
              Source
              Language