42Atomys/webhooked

View on GitHub
pkg/storage/postgres/postgres.go

Summary

Maintainability
A
1 hr
Test Coverage

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

      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

      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

      There are no issues that match your filters.

      Category
      Status