Preparing report...

Report for github.com/algolia/algoliasearch-client-go

(v2.25.0+incompatible)

A+    Excellent!    Found 30 issues across 47 files

Tweet

gofmt93%

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


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!


golint48%

Golint is a linter for Go source code.

    • algoliasearch/types_object.go
    • Line 8: warning: exported type CreateObjectRes should have comment or be unexported (golint)
    • Line 14: warning: exported type UpdateObjectRes should have comment or be unexported (golint)
    • Line 24: warning: exported type Object should have comment or be unexported (golint)
    • Line 26: warning: exported method Object.ObjectID should have comment or be unexported (golint)
    • algoliasearch/types_rule.go
    • Line 3: warning: exported type Rule should have comment or be unexported (golint)
    • Line 20: warning: exported type RulePatternAnchoring should have comment or be unexported (golint)
    • Line 23: warning: exported const Is should have comment (or a comment on this block) or be unexported (golint)
    • Line 46: warning: exported type RuleConsequence should have comment or be unexported (golint)
    • Line 52: warning: exported type QueryIncrementalEdit should have comment or be unexported (golint)
    • Line 56: warning: exported type PromotedObject should have comment or be unexported (golint)
    • Line 61: warning: exported type SaveRuleRes should have comment or be unexported (golint)
    • Line 66: warning: exported type BatchRulesRes should have comment or be unexported (golint)
    • Line 71: warning: exported type DeleteRuleRes should have comment or be unexported (golint)
    • Line 76: warning: exported type ClearRulesRes should have comment or be unexported (golint)
    • Line 81: warning: exported type SearchRulesRes should have comment or be unexported (golint)
    • algoliasearch/index_test.go
    • Line 219: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 229: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 250: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 260: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • algoliasearch/types_batch.go
    • Line 3: warning: exported type BatchOperation should have comment or be unexported (golint)
    • Line 8: warning: exported type BatchOperationIndexed should have comment or be unexported (golint)
    • Line 13: warning: exported type BatchRes should have comment or be unexported (golint)
    • Line 18: warning: exported type MultipleBatchRes should have comment or be unexported (golint)
    • algoliasearch/types_key.go
    • Line 3: warning: exported type Key should have comment or be unexported (golint)
    • Line 20: warning: exported type AddKeyRes should have comment or be unexported (golint)
    • Line 25: warning: exported type UpdateKeyRes should have comment or be unexported (golint)
    • algoliasearch/errors.go
    • Line 9: warning: error var NoMoreHitsErr should have name of the form ErrFoo (golint)
    • Line 9: warning: exported var NoMoreHitsErr should have comment or be unexported (golint)
    • Line 10: warning: error var NoMoreSynonymsErr should have name of the form ErrFoo (golint)
    • Line 11: warning: error var NoMoreRulesErr should have name of the form ErrFoo (golint)
    • Line 12: warning: error var ExhaustionOfTryableHostsErr should have name of the form ErrFoo (golint)
    • Line 24: warning: exported function NewNetError should have comment or be unexported (golint)
    • Line 33: warning: exported method NetError.Timeout should have comment or be unexported (golint)
    • Line 34: warning: exported method NetError.Temporary should have comment or be unexported (golint)
    • algoliasearch/types_query.go
    • Line 7: warning: exported type MultipleQueryRes should have comment or be unexported (golint)
    • Line 13: warning: exported type QueryRes should have comment or be unexported (golint)
    • Line 43: warning: exported type IndexedQuery should have comment or be unexported (golint)
    • algoliasearch/types_synonyms.go
    • Line 4: warning: exported const AltCorrection1 should have comment (or a comment on this block) or be unexported (golint)
    • Line 8: warning: exported type SearchSynonymsRes should have comment or be unexported (golint)
    • Line 13: warning: exported type Synonym should have comment or be unexported (golint)
    • Line 35: warning: exported function NewAltCorrectionSynonym should have comment or be unexported (golint)
    • Line 44: warning: exported function NewOneWaySynonym should have comment or be unexported (golint)
    • Line 53: warning: exported function NewPlaceholderSynonym should have comment or be unexported (golint)
    • Line 62: warning: exported function NewSynonym should have comment or be unexported (golint)
    • algoliasearch/types_task.go
    • Line 3: warning: exported type DeleteTaskRes should have comment or be unexported (golint)
    • Line 8: warning: exported type UpdateTaskRes should have comment or be unexported (golint)
    • Line 13: warning: exported type UpdateTaskWithIDRes should have comment or be unexported (golint)
    • Line 18: warning: exported type TaskStatusRes should have comment or be unexported (golint)
    • algoliasearch/retry_strategy.go
    • Line 19: warning: exported type Outcome should have comment or be unexported (golint)
    • Line 22: warning: exported const DefaultReadTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported type TryableHost should have comment or be unexported (golint)
    • Line 45: warning: exported type RetryStrategy should have comment or be unexported (golint)
    • Line 90: warning: exported function NewRetryStrategy should have comment or be unexported (golint)
    • algoliasearch/types_abtesting.go
    • Line 9: warning: exported type ABTest should have comment or be unexported (golint)
    • Line 15: warning: exported const ISO8601 should have comment or be unexported (golint)
    • Line 17: warning: exported method ABTest.MarshalJSON should have comment or be unexported (golint)
    • Line 31: warning: exported type Variant should have comment or be unexported (golint)
    • Line 37: warning: exported type ABTestTaskRes should have comment or be unexported (golint)
    • Line 43: warning: exported type GetABTestsRes should have comment or be unexported (golint)
    • Line 49: warning: exported type ABTestResponse should have comment or be unexported (golint)
    • Line 60: warning: exported type VariantResponse should have comment or be unexported (golint)
    • algoliasearch/call/kind.go
    • Line 3: warning: exported type Kind should have comment or be unexported (golint)
    • Line 6: warning: exported const Read should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported function IsRead should have comment or be unexported (golint)
    • Line 12: warning: exported function IsWrite should have comment or be unexported (golint)
    • Line 13: warning: exported function IsAnalytics should have comment or be unexported (golint)
    • Line 14: warning: exported function IsReadWrite should have comment or be unexported (golint)
    • algoliasearch/partial_update_op.go
    • Line 3: warning: exported type PartialUpdateOp should have comment or be unexported (golint)
    • Line 8: warning: exported function IncrementOp should have comment or be unexported (golint)
    • Line 15: warning: exported function DecrementOp should have comment or be unexported (golint)
    • Line 22: warning: exported function AddOp should have comment or be unexported (golint)
    • Line 29: warning: exported function RemoveOp should have comment or be unexported (golint)
    • Line 36: warning: exported function AddUniqueOp should have comment or be unexported (golint)
    • algoliasearch/transport.go
    • Line 43: warning: exported const DefaultConnectTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 54: warning: comment on exported function NewTransportWithHosts should be of the form "NewTransportWithHosts ..." (golint)
    • Line 176: warning: if block ends with a return statement, so drop this else and outdent its block (golint)

gocyclo91%

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.

    • algoliasearch/index_test.go
    • Line 458: warning: cyclomatic complexity 50 of function TestIndexingAndSearch() is high (> 15) (gocyclo)
    • Line 1282: warning: cyclomatic complexity 28 of function TestBatchPartialUpdate() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 18 of function settingsAreEqualByComparable() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell87%

Misspell Finds commonly misspelled English words

    • algoliasearch/index_test.go
    • Line 283: warning: "succesive" is a misspelling of "successive" (misspell)
    • Line 738: warning: "occurences" is a misspelling of "occurrences" (misspell)
    • Line 756: warning: "occurences" is a misspelling of "occurrences" (misspell)
    • Line 1197: warning: "compatibily" is a misspelling of "compatibility" (misspell)
    • Line 1223: warning: "compatibily" is a misspelling of "compatibility" (misspell)