Report for github.com/knights-analytics/indexer

(v0.0.0-20250307125824-a98147b60236)

A+    Excellent!    Found 88 issues across 636 files

Tweet

gofmt97%

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!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo87%

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.

    • index/scorch/reader_test.go
    • Line 26: warning: cyclomatic complexity 39 of function TestIndexReader() is high (> 15) (gocyclo)
    • Line 338: warning: cyclomatic complexity 22 of function TestIndexDocIdOnlyReader() is high (> 15) (gocyclo)
    • Line 222: warning: cyclomatic complexity 21 of function TestIndexDocIdReader() is high (> 15) (gocyclo)
    • geo/parse.go
    • Line 49: warning: cyclomatic complexity 29 of function ExtractGeoPoint() is high (> 15) (gocyclo)
    • Line 380: warning: cyclomatic complexity 22 of function ExtractGeoShapeCoordinates() is high (> 15) (gocyclo)
    • index_impl.go
    • Line 537: warning: cyclomatic complexity 69 of function (*indexImpl).SearchInContext() is high (> 15) (gocyclo)
    • Line 848: warning: cyclomatic complexity 35 of function LoadAndHighlightFields() is high (> 15) (gocyclo)
    • mapping/field.go
    • Line 403: warning: cyclomatic complexity 33 of function (*FieldMapping).UnmarshalJSON() is high (> 15) (gocyclo)
    • index/upsidedown/reader_test.go
    • Line 315: warning: cyclomatic complexity 42 of function TestIndexDocIdOnlyReader() is high (> 15) (gocyclo)
    • Line 26: warning: cyclomatic complexity 35 of function TestIndexReader() is high (> 15) (gocyclo)
    • Line 201: warning: cyclomatic complexity 19 of function TestIndexDocIdReader() is high (> 15) (gocyclo)
    • mapping/analysis.go
    • Line 27: warning: cyclomatic complexity 20 of function (*customAnalysis).registerAll() is high (> 15) (gocyclo)
    • search/searcher/search_fuzzy.go
    • Line 148: warning: cyclomatic complexity 28 of function findFuzzyCandidateTerms() is high (> 15) (gocyclo)
    • Line 41: warning: cyclomatic complexity 17 of function NewFuzzySearcher() is high (> 15) (gocyclo)
    • search/sort.go
    • Line 48: warning: cyclomatic complexity 23 of function ParseSearchSortObj() is high (> 15) (gocyclo)
    • mapping/document.go
    • Line 463: warning: cyclomatic complexity 56 of function (*DocumentMapping).processProperty() is high (> 15) (gocyclo)
    • Line 385: warning: cyclomatic complexity 27 of function (*DocumentMapping).walkDocument() is high (> 15) (gocyclo)
    • Line 292: warning: cyclomatic complexity 19 of function (*DocumentMapping).UnmarshalJSON() is high (> 15) (gocyclo)
    • Line 54: warning: cyclomatic complexity 16 of function (*DocumentMapping).Validate() is high (> 15) (gocyclo)
    • search/searcher/search_phrase.go
    • Line 80: warning: cyclomatic complexity 35 of function NewMultiPhraseSearcher() is high (> 15) (gocyclo)
    • Line 439: warning: cyclomatic complexity 17 of function findPhrasePaths() is high (> 15) (gocyclo)
    • index/scorch/optimize.go
    • Line 306: warning: cyclomatic complexity 16 of function (*OptimizeTFRDisjunctionUnadorned).Finish() is high (> 15) (gocyclo)
    • Line 158: warning: cyclomatic complexity 16 of function (*OptimizeTFRConjunctionUnadorned).Finish() is high (> 15) (gocyclo)
    • index/upsidedown/upsidedown_test.go
    • Line 771: warning: cyclomatic complexity 45 of function TestIndexInsertUpdateDeleteWithMultipleTypesStored() is high (> 15) (gocyclo)
    • Line 184: warning: cyclomatic complexity 27 of function TestIndexInsertThenDelete() is high (> 15) (gocyclo)
    • Line 472: warning: cyclomatic complexity 22 of function TestIndexInsertWithStore() is high (> 15) (gocyclo)
    • Line 576: warning: cyclomatic complexity 19 of function TestIndexInternalCRUD() is high (> 15) (gocyclo)
    • Line 1053: warning: cyclomatic complexity 17 of function TestIndexUpdateComposites() is high (> 15) (gocyclo)
    • Line 380: warning: cyclomatic complexity 17 of function TestIndexInsertMultiple() is high (> 15) (gocyclo)
    • Line 670: warning: cyclomatic complexity 17 of function TestIndexBatch() is high (> 15) (gocyclo)
    • Line 108: warning: cyclomatic complexity 16 of function TestIndexInsert() is high (> 15) (gocyclo)
    • index/upsidedown/upsidedown.go
    • Line 794: warning: cyclomatic complexity 30 of function (*UpsideDownCouch).Batch() is high (> 15) (gocyclo)
    • Line 156: warning: cyclomatic complexity 27 of function (*UpsideDownCouch).batchRows() is high (> 15) (gocyclo)
    • Line 512: warning: cyclomatic complexity 20 of function (*UpsideDownCouch).mergeOldAndNew() is high (> 15) (gocyclo)
    • search/searcher/search_boolean.go
    • Line 210: warning: cyclomatic complexity 30 of function (*BooleanSearcher).Next() is high (> 15) (gocyclo)
    • Line 336: warning: cyclomatic complexity 21 of function (*BooleanSearcher).Advance() is high (> 15) (gocyclo)
    • index_alias_impl_test.go
    • Line 31: warning: cyclomatic complexity 40 of function TestIndexAliasSingle() is high (> 15) (gocyclo)
    • Line 720: warning: cyclomatic complexity 24 of function TestMultiSearchTimeout() is high (> 15) (gocyclo)
    • mapping/index.go
    • Line 227: warning: cyclomatic complexity 32 of function (*IndexMappingImpl).UnmarshalJSON() is high (> 15) (gocyclo)
    • index_alias_impl.go
    • Line 178: warning: cyclomatic complexity 18 of function (*indexAliasImpl).SearchInContext() is high (> 15) (gocyclo)
    • search/search.go
    • Line 275: warning: cyclomatic complexity 17 of function (*DocumentMatch).Complete() is high (> 15) (gocyclo)
    • search/query/query.go
    • Line 128: warning: cyclomatic complexity 62 of function ParseQuery() is high (> 15) (gocyclo)
    • Line 520: warning: cyclomatic complexity 54 of function ExtractSynonyms() is high (> 15) (gocyclo)
    • Line 685: warning: cyclomatic complexity 18 of function addSynonymsForTermWithMatchType() is high (> 15) (gocyclo)
    • Line 461: warning: cyclomatic complexity 18 of function ExtractFields() is high (> 15) (gocyclo)
    • index_test.go
    • Line 2950: warning: cyclomatic complexity 47 of function TestCopyIndex() is high (> 15) (gocyclo)
    • Line 66: warning: cyclomatic complexity 34 of function TestCrud() is high (> 15) (gocyclo)
    • Line 723: warning: cyclomatic complexity 28 of function TestBytesReadStored() is high (> 15) (gocyclo)
    • Line 563: warning: cyclomatic complexity 27 of function TestBytesRead() is high (> 15) (gocyclo)
    • Line 2513: warning: cyclomatic complexity 27 of function TestBatchMerge() is high (> 15) (gocyclo)
    • Line 1172: warning: cyclomatic complexity 23 of function TestDict() is high (> 15) (gocyclo)
    • Line 1537: warning: cyclomatic complexity 21 of function TestDocumentFieldArrayPositions() is high (> 15) (gocyclo)
    • Line 446: warning: cyclomatic complexity 20 of function TestBM25GlobalScoring() is high (> 15) (gocyclo)
    • Line 1642: warning: cyclomatic complexity 17 of function TestKeywordSearchBug207() is high (> 15) (gocyclo)
    • index/upsidedown/row.go
    • Line 930: warning: cyclomatic complexity 25 of function visitBackIndexRow() is high (> 15) (gocyclo)
    • Line 1051: warning: cyclomatic complexity 21 of function visitBackIndexRowFieldTerms() is high (> 15) (gocyclo)
    • index/scorch/scorch_test.go
    • Line 351: warning: cyclomatic complexity 55 of function TestIndexInsertThenDelete() is high (> 15) (gocyclo)
    • Line 1097: warning: cyclomatic complexity 53 of function TestIndexInsertUpdateDeleteWithMultipleTypesStored() is high (> 15) (gocyclo)
    • Line 1848: warning: cyclomatic complexity 31 of function TestIndexDocValueReaderWithMultipleDocs() is high (> 15) (gocyclo)
    • Line 711: warning: cyclomatic complexity 24 of function TestIndexInsertWithStore() is high (> 15) (gocyclo)
    • Line 817: warning: cyclomatic complexity 23 of function TestIndexInternalCRUD() is high (> 15) (gocyclo)
    • Line 66: warning: cyclomatic complexity 22 of function TestIndexOpenReopen() is high (> 15) (gocyclo)
    • Line 170: warning: cyclomatic complexity 22 of function TestIndexOpenReopenWithInsert() is high (> 15) (gocyclo)
    • Line 928: warning: cyclomatic complexity 21 of function TestIndexBatch() is high (> 15) (gocyclo)
    • Line 2314: warning: cyclomatic complexity 18 of function TestCancelIndexForceMerge() is high (> 15) (gocyclo)
    • Line 2204: warning: cyclomatic complexity 18 of function TestIndexForceMerge() is high (> 15) (gocyclo)
    • Line 1398: warning: cyclomatic complexity 17 of function TestIndexUpdateComposites() is high (> 15) (gocyclo)
    • Line 2578: warning: cyclomatic complexity 16 of function TestReadOnlyIndex() is high (> 15) (gocyclo)
    • search_test.go
    • Line 3973: warning: cyclomatic complexity 45 of function TestSynonymSearchQueries() is high (> 15) (gocyclo)
    • Line 1235: warning: cyclomatic complexity 38 of function TestMatchQueryPartialMatch() is high (> 15) (gocyclo)
    • Line 2876: warning: cyclomatic complexity 26 of function TestDateRangeFacetQueriesWithCustomDateTimeParser() is high (> 15) (gocyclo)
    • Line 3784: warning: cyclomatic complexity 22 of function TestThesaurusTermReader() is high (> 15) (gocyclo)
    • Line 3103: warning: cyclomatic complexity 17 of function TestDateRangeTimestampQueries() is high (> 15) (gocyclo)
    • Line 2583: warning: cyclomatic complexity 16 of function TestDateRangeStringQuery() is high (> 15) (gocyclo)
    • index/scorch/persister.go
    • Line 492: warning: cyclomatic complexity 27 of function prepareBoltSnapshot() is high (> 15) (gocyclo)
    • Line 86: warning: cyclomatic complexity 26 of function (*Scorch).persisterLoop() is high (> 15) (gocyclo)
    • Line 627: warning: cyclomatic complexity 16 of function (*Scorch).persistSnapshotDirect() is high (> 15) (gocyclo)
    • index/scorch/merge.go
    • Line 261: warning: cyclomatic complexity 24 of function (*Scorch).planMergeAtSnapshot() is high (> 15) (gocyclo)
    • Line 31: warning: cyclomatic complexity 19 of function (*Scorch).mergerLoop() is high (> 15) (gocyclo)
    • search_knn_test.go
    • Line 437: warning: cyclomatic complexity 42 of function TestVectorBase64Index() is high (> 15) (gocyclo)
    • Line 50: warning: cyclomatic complexity 28 of function TestSimilaritySearchPartitionedIndex() is high (> 15) (gocyclo)
    • Line 870: warning: cyclomatic complexity 22 of function verifyResult() is high (> 15) (gocyclo)
    • Line 1413: warning: cyclomatic complexity 19 of function TestKNNFiltering() is high (> 15) (gocyclo)
    • index/scorch/introducer.go
    • Line 337: warning: cyclomatic complexity 20 of function (*Scorch).introduceMerge() is high (> 15) (gocyclo)
    • Line 106: warning: cyclomatic complexity 18 of function (*Scorch).introduceSegment() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!