Preparing report...

Report for github.com/c3mb0/clickhouse

(v1.3.10)

A    Great!    Found 63 issues across 91 files

Tweet

gofmt81%

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!


gocyclo83%

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.

    • bootstrap.go
    • Line 73: warning: cyclomatic complexity 24 of function open() is high (> 15) (gocyclo)
    • stmt.go
    • Line 105: warning: cyclomatic complexity 20 of function (*stmt).bind() is high (> 15) (gocyclo)
    • lib/column/decimal.go
    • Line 122: warning: cyclomatic complexity 23 of function (*Decimal).write64() is high (> 15) (gocyclo)
    • Line 62: warning: cyclomatic complexity 21 of function (*Decimal).write32() is high (> 15) (gocyclo)
    • clickhouse.go
    • Line 174: warning: cyclomatic complexity 21 of function (*clickhouse).CheckNamedValue() is high (> 15) (gocyclo)
    • clickhouse_test.go
    • Line 344: warning: cyclomatic complexity 37 of function Test_Select() is high (> 15) (gocyclo)
    • Line 768: warning: cyclomatic complexity 26 of function Test_With_Totals() is high (> 15) (gocyclo)
    • Line 963: warning: cyclomatic complexity 18 of function Test_Ternary_Operator() is high (> 15) (gocyclo)
    • helpers.go
    • Line 13: warning: cyclomatic complexity 23 of function numInput() is high (> 15) (gocyclo)
    • issues_test.go
    • Line 164: warning: cyclomatic complexity 19 of function TestNullableEnumWithoutLeadZero() is high (> 15) (gocyclo)

golint54%

Golint is a linter for Go source code.

    • lib/column/uuid.go
    • Line 13: warning: exported const UUIDLen should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported var ErrInvalidUUIDFormat should have comment or be unexported (golint)
    • Line 19: warning: exported type UUID should have comment or be unexported (golint)
    • Line 107: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • clickhouse.go
    • Line 24: warning: exported type Date should have comment or be unexported (golint)
    • Line 25: warning: exported type DateTime should have comment or be unexported (golint)
    • Line 26: warning: exported type UUID should have comment or be unexported (golint)
    • Line 30: warning: exported var ErrInsertInNotBatchMode should have comment or be unexported (golint)
    • lib/binary/compress_settings.go
    • Line 3: warning: exported type CompressionMethodByte should have comment or be unexported (golint)
    • Line 6: warning: exported const NONE should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: comment on exported const CompressHeaderSize should be of the form "CompressHeaderSize ..." (golint)
    • Line 17: warning: comment on exported const HeaderSize should be of the form "HeaderSize ..." (golint)
    • lib/binary/encoder.go
    • Line 11: warning: exported function NewEncoder should have comment or be unexported (golint)
    • Line 18: warning: exported type Encoder should have comment or be unexported (golint)
    • Line 25: warning: exported method Encoder.SelectCompress should have comment or be unexported (golint)
    • Line 32: warning: exported method Encoder.Get should have comment or be unexported (golint)
    • Line 39: warning: exported method Encoder.Uvarint should have comment or be unexported (golint)
    • Line 47: warning: exported method Encoder.Bool should have comment or be unexported (golint)
    • Line 54: warning: exported method Encoder.Int8 should have comment or be unexported (golint)
    • Line 58: warning: exported method Encoder.Int16 should have comment or be unexported (golint)
    • Line 62: warning: exported method Encoder.Int32 should have comment or be unexported (golint)
    • Line 66: warning: exported method Encoder.Int64 should have comment or be unexported (golint)
    • Line 70: warning: exported method Encoder.UInt8 should have comment or be unexported (golint)
    • Line 78: warning: exported method Encoder.UInt16 should have comment or be unexported (golint)
    • Line 87: warning: exported method Encoder.UInt32 should have comment or be unexported (golint)
    • Line 98: warning: exported method Encoder.UInt64 should have comment or be unexported (golint)
    • Line 113: warning: exported method Encoder.Float32 should have comment or be unexported (golint)
    • Line 117: warning: exported method Encoder.Float64 should have comment or be unexported (golint)
    • Line 132: warning: exported method Encoder.RawString should have comment or be unexported (golint)
    • Line 146: warning: exported method Encoder.Flush should have comment or be unexported (golint)
    • Line 153: warning: exported type WriteFlusher should have comment or be unexported (golint)
    • Line 157: warning: exported function Str2Bytes should have comment or be unexported (golint)
    • lib/column/nullable.go
    • Line 11: warning: exported type Nullable should have comment or be unexported (golint)
    • Line 16: warning: exported method Nullable.ScanType should have comment or be unexported (golint)
    • Line 28: warning: exported method Nullable.ReadNull should have comment or be unexported (golint)
    • Line 53: warning: exported method Nullable.WriteNull should have comment or be unexported (golint)
    • lib/column/ip.go
    • Line 28: warning: exported method IP.MarshalBinary should have comment or be unexported (golint)
    • array.go
    • Line 7: warning: exported function Array should have comment or be unexported (golint)
    • Line 11: warning: exported function ArrayFixedString should have comment or be unexported (golint)
    • Line 15: warning: exported function ArrayDate should have comment or be unexported (golint)
    • Line 19: warning: exported function ArrayDateTime should have comment or be unexported (golint)
    • lib/types/uuid.go
    • Line 10: warning: error var InvalidUUIDFormatError should have name of the form ErrFoo (golint)
    • Line 10: warning: exported var InvalidUUIDFormatError should have comment or be unexported (golint)
    • Line 12: warning: comment on exported type UUID should be of the form "UUID ..." (with optional leading article) (golint)
    • Line 15: warning: exported method UUID.Value should have comment or be unexported (golint)
    • Line 19: warning: exported method UUID.MarshalBinary should have comment or be unexported (golint)
    • Line 23: warning: exported method UUID.Scan should have comment or be unexported (golint)
    • Line 65: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • write_column.go
    • Line 11: warning: comment on exported type Clickhouse should be of the form "Clickhouse ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported type ColumnWriter should be of the form "ColumnWriter ..." (with optional leading article) (golint)
    • Line 38: warning: exported function OpenDirect should have comment or be unexported (golint)
    • lib/cityhash102/cityhash.go
    • Line 74: warning: exported type Uint128 should have comment or be unexported (golint)
    • Line 76: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 80: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 84: warning: exported method Uint128.Lower64 should have comment or be unexported (golint)
    • Line 84: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 88: warning: exported method Uint128.Higher64 should have comment or be unexported (golint)
    • Line 88: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 92: warning: exported method Uint128.Bytes should have comment or be unexported (golint)
    • Line 92: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 171: warning: don't use underscores in Go names; func weakHashLen32WithSeeds_3 should be weakHashLen32WithSeeds3 (golint)
    • Line 202: warning: exported function CityHash64 should have comment or be unexported (golint)
    • Line 206: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 248: warning: exported function CityHash64WithSeed should have comment or be unexported (golint)
    • Line 252: warning: exported function CityHash64WithSeeds should have comment or be unexported (golint)
    • Line 298: warning: exported function CityHash128WithSeed should have comment or be unexported (golint)
    • Line 374: warning: exported function CityHash128 should have comment or be unexported (golint)
    • lib/column/column.go
    • Line 12: warning: exported type Column should have comment or be unexported (golint)
    • Line 22: warning: exported function Factory should have comment or be unexported (golint)
    • lib/data/block.go
    • Line 17: warning: exported type Block should have comment or be unexported (golint)
    • Line 27: warning: exported method Block.Copy should have comment or be unexported (golint)
    • Line 35: warning: exported method Block.ColumnNames should have comment or be unexported (golint)
    • Line 125: warning: exported method Block.AppendRow should have comment or be unexported (golint)
    • Line 156: warning: exported method Block.Reserve should have comment or be unexported (golint)
    • Line 175: warning: exported method Block.Reset should have comment or be unexported (golint)
    • connect.go
    • Line 103: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • lib/types/date.go
    • Line 10: warning: comment on exported type Date should be of the form "Date ..." (with optional leading article) (golint)
    • Line 15: warning: exported method Date.Value should have comment or be unexported (golint)
    • Line 23: warning: comment on exported type DateTime should be of the form "DateTime ..." (with optional leading article) (golint)
    • Line 28: warning: exported method DateTime.Value should have comment or be unexported (golint)
    • lib/data/block_write_column.go
    • Line 11: warning: exported method Block.WriteDate should have comment or be unexported (golint)
    • Line 17: warning: exported method Block.WriteDateTime should have comment or be unexported (golint)
    • Line 21: warning: exported method Block.WriteBool should have comment or be unexported (golint)
    • Line 28: warning: exported method Block.WriteInt8 should have comment or be unexported (golint)
    • Line 32: warning: exported method Block.WriteInt16 should have comment or be unexported (golint)
    • Line 36: warning: exported method Block.WriteInt32 should have comment or be unexported (golint)
    • Line 40: warning: exported method Block.WriteInt64 should have comment or be unexported (golint)
    • Line 44: warning: exported method Block.WriteUInt8 should have comment or be unexported (golint)
    • Line 48: warning: exported method Block.WriteUInt16 should have comment or be unexported (golint)
    • Line 52: warning: exported method Block.WriteUInt32 should have comment or be unexported (golint)
    • Line 56: warning: exported method Block.WriteUInt64 should have comment or be unexported (golint)
    • Line 60: warning: exported method Block.WriteFloat32 should have comment or be unexported (golint)
    • Line 64: warning: exported method Block.WriteFloat64 should have comment or be unexported (golint)
    • Line 68: warning: exported method Block.WriteBytes should have comment or be unexported (golint)
    • Line 78: warning: exported method Block.WriteString should have comment or be unexported (golint)
    • Line 88: warning: exported method Block.WriteFixedString should have comment or be unexported (golint)
    • Line 92: warning: exported method Block.WriteArray should have comment or be unexported (golint)
    • Line 96: warning: exported method Block.WriteArrayWithValue should have comment or be unexported (golint)
    • lib/binary/decoder.go
    • Line 9: warning: exported function NewDecoder should have comment or be unexported (golint)
    • Line 16: warning: exported type Decoder should have comment or be unexported (golint)
    • Line 23: warning: exported method Decoder.SelectCompress should have comment or be unexported (golint)
    • Line 27: warning: exported method Decoder.Get should have comment or be unexported (golint)
    • Line 34: warning: exported method Decoder.Bool should have comment or be unexported (golint)
    • Line 42: warning: exported method Decoder.Uvarint should have comment or be unexported (golint)
    • Line 46: warning: exported method Decoder.Int8 should have comment or be unexported (golint)
    • Line 54: warning: exported method Decoder.Int16 should have comment or be unexported (golint)
    • Line 62: warning: exported method Decoder.Int32 should have comment or be unexported (golint)
    • Line 70: warning: exported method Decoder.Int64 should have comment or be unexported (golint)
    • Line 78: warning: exported method Decoder.UInt8 should have comment or be unexported (golint)
    • Line 86: warning: exported method Decoder.UInt16 should have comment or be unexported (golint)
    • Line 93: warning: exported method Decoder.UInt32 should have comment or be unexported (golint)
    • Line 103: warning: exported method Decoder.UInt64 should have comment or be unexported (golint)
    • Line 117: warning: exported method Decoder.Float32 should have comment or be unexported (golint)
    • Line 125: warning: exported method Decoder.Float64 should have comment or be unexported (golint)
    • Line 133: warning: exported method Decoder.Fixed should have comment or be unexported (golint)
    • Line 156: warning: exported method Decoder.ReadByte should have comment or be unexported (golint)
    • Line 163: warning: exported type FixedReader should have comment or be unexported (golint)
    • lib/protocol/protocol.go
    • Line 4: warning: exported const DBMS_MIN_REVISION_WITH_SERVER_TIMEZONE should have comment (or a comment on this block) or be unexported (golint)
    • Line 9: warning: exported const ClientHello should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported const CompressEnable should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported const StateComplete should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported const ServerHello should have comment (or a comment on this block) or be unexported (golint)
    • lib/data/client_info.go
    • Line 9: warning: exported const ClientName should have comment or be unexported (golint)
    • Line 12: warning: exported const ClickHouseRevision should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type ClientInfo should have comment or be unexported (golint)
    • lib/column/array.go
    • Line 13: warning: exported type Array should have comment or be unexported (golint)
    • Line 27: warning: exported method Array.ReadArray should have comment or be unexported (golint)
    • Line 63: warning: exported method Array.Depth should have comment or be unexported (golint)
    • lib/cityhash102/city64.go
    • Line 8: warning: exported type City64 should have comment or be unexported (golint)
    • Line 15: warning: exported function New64 should have comment or be unexported (golint)
    • Line 19: warning: exported method City64.Sum should have comment or be unexported (golint)
    • Line 19: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 26: warning: exported method City64.Sum64 should have comment or be unexported (golint)
    • Line 26: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 30: warning: exported method City64.Reset should have comment or be unexported (golint)
    • Line 30: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 34: warning: exported method City64.BlockSize should have comment or be unexported (golint)
    • Line 34: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 38: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 43: warning: exported method City64.Size should have comment or be unexported (golint)
    • Line 43: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.

    • bootstrap.go
    • Line 81: warning: ineffectual assignment to secure (ineffassign)
    • Line 81: warning: ineffectual assignment to secure (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!