Preparing report...

Report for github.com/karmi/go-elasticsearch

A+    Excellent!    Found 19 issues across 70 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo82%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.


golint95%

Golint is a linter for Go source code.

    • go-elasticsearch/internal/cmd/generate/commands/gentests/model.go
    • Line 96: warning: don't use underscores in Go names; var sec_keys should be secKeys (golint)
    • Line 127: warning: don't use underscores in Go names; var skip_v should be skipV (golint)
    • Line 128: warning: don't use underscores in Go names; var skip_r should be skipR (golint)
    • Line 134: warning: don't use underscores in Go names; var skip_rr should be skipRr (golint)
    • Line 550: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 597: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 713: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 727: warning: if block ends with a return statement, so drop this else and outdent its block (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign82%

IneffAssign detects ineffectual assignments in Go code.

    • go-elasticsearch/internal/cmd/generate/main.go
    • Line 4: warning: no required module provides package github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/commands; to add it: (ineffassign)
    • Line 5: warning: no required module provides package github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/commands/gensource; to add it: (ineffassign)
    • Line 6: warning: no required module provides package github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/commands/gentests; to add it: (ineffassign)
    • Line 4: warning: could not import github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/commands (invalid package name: "") (ineffassign)
    • Line 5: warning: could not import github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/commands/gensource (invalid package name: "") (ineffassign)
    • Line 6: warning: could not import github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/commands/gentests (invalid package name: "") (ineffassign)
    • go-elasticsearch/elasticsearch_benchmark_test.go
    • Line 67: warning: InfoRequest not declared by package esapi (ineffassign)
    • Line 88: warning: IndexRequest not declared by package esapi (ineffassign)
    • Line 114: warning: client.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 117: warning: client.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 118: warning: client.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 119: warning: client.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 120: warning: client.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 121: warning: client.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 136: warning: SearchRequest not declared by package esapi (ineffassign)
    • Line 156: warning: client.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 157: warning: client.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 158: warning: client.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 159: warning: client.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 160: warning: client.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 161: warning: client.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 162: warning: client.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 183: warning: BulkRequest not declared by package esapi (ineffassign)
    • Line 208: warning: client.Bulk undefined (type *elasticsearch.Client has no field or method Bulk) (ineffassign)
    • Line 210: warning: client.Bulk undefined (type *elasticsearch.Client has no field or method Bulk) (ineffassign)
    • Line 211: warning: client.Bulk undefined (type *elasticsearch.Client has no field or method Bulk) (ineffassign)
    • Line 212: warning: client.Bulk undefined (type *elasticsearch.Client has no field or method Bulk) (ineffassign)
    • Line 213: warning: client.Bulk undefined (type *elasticsearch.Client has no field or method Bulk) (ineffassign)
    • go-elasticsearch/esapi/esapi.response_example_test.go
    • Line 12: warning: es.Info undefined (type *elasticsearch.Client has no field or method Info) (ineffassign)
    • Line 35: warning: es.Info undefined (type *elasticsearch.Client has no field or method Info) (ineffassign)
    • Line 44: warning: es.Info undefined (type *elasticsearch.Client has no field or method Info) (ineffassign)
    • go-elasticsearch/esapi/esapi_benchmark_test.go
    • Line 81: warning: es.Info undefined (type *elasticsearch.Client has no field or method Info) (ineffassign)
    • Line 90: warning: es.Info undefined (type *elasticsearch.Client has no field or method Info) (ineffassign)
    • Line 90: warning: es.Info undefined (type *elasticsearch.Client has no field or method Info) (ineffassign)
    • Line 99: warning: InfoRequest not declared by package esapi (ineffassign)
    • Line 109: warning: es.Cluster undefined (type *elasticsearch.Client has no field or method Cluster) (ineffassign)
    • Line 118: warning: es.Cluster undefined (type *elasticsearch.Client has no field or method Cluster) (ineffassign)
    • Line 119: warning: es.Cluster undefined (type *elasticsearch.Client has no field or method Cluster) (ineffassign)
    • Line 120: warning: es.Cluster undefined (type *elasticsearch.Client has no field or method Cluster) (ineffassign)
    • Line 121: warning: es.Cluster undefined (type *elasticsearch.Client has no field or method Cluster) (ineffassign)
    • Line 133: warning: ClusterHealthRequest not declared by package esapi (ineffassign)
    • Line 143: warning: ClusterHealthRequest not declared by package esapi (ineffassign)
    • Line 155: warning: es.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 158: warning: es.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 159: warning: es.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 160: warning: es.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 161: warning: es.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 162: warning: es.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 163: warning: es.Index undefined (type *elasticsearch.Client has no field or method Index) (ineffassign)
    • Line 182: warning: IndexRequest not declared by package esapi (ineffassign)
    • Line 201: warning: IndexRequest not declared by package esapi (ineffassign)
    • Line 226: warning: es.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 226: warning: es.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 226: warning: es.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 239: warning: eserr.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 239: warning: eserr.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 239: warning: eserr.Search undefined (type *elasticsearch.Client has no field or method Search) (ineffassign)
    • Line 252: warning: SearchRequest not declared by package esapi (ineffassign)
    • Line 264: warning: SearchRequest not declared by package esapi (ineffassign)
    • go-elasticsearch/internal/cmd/generate/commands/gensource/command.go
    • Line 16: warning: no required module provides package github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/commands; to add it: (ineffassign)
    • Line 17: warning: no required module provides package github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/utils; to add it: (ineffassign)
    • Line 16: warning: could not import github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/commands (invalid package name: "") (ineffassign)
    • Line 17: warning: could not import github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/utils (invalid package name: "") (ineffassign)
    • go-elasticsearch/internal/cmd/generate/commands/gentests/command.go
    • Line 18: warning: no required module provides package github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/commands; to add it: (ineffassign)
    • Line 19: warning: no required module provides package github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/utils; to add it: (ineffassign)
    • Line 18: warning: could not import github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/commands (invalid package name: "") (ineffassign)
    • Line 19: warning: could not import github.com/karmi/go-elasticsearch/v8/internal/cmd/generate/utils (invalid package name: "") (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!