Preparing report...

Report for github.com/hypermodeinc/dgraph

(v1.2.8)

A+    Excellent!    Found 109 issues across 339 files

Tweet

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!


gofmt82%

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


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo81%

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.

    • types/conversion.go
    • Line 36: warning: cyclomatic complexity 83 of function Convert() is high (> 15) (gocyclo)
    • Line 311: warning: cyclomatic complexity 33 of function Marshal() is high (> 15) (gocyclo)
    • Line 443: warning: cyclomatic complexity 19 of function ObjectValue() is high (> 15) (gocyclo)
    • worker/tokens.go
    • Line 113: warning: cyclomatic complexity 17 of function getInequalityTokens() is high (> 15) (gocyclo)
    • worker/draft.go
    • Line 151: warning: cyclomatic complexity 40 of function (*node).applyMutations() is high (> 15) (gocyclo)
    • Line 778: warning: cyclomatic complexity 40 of function (*node).Run() is high (> 15) (gocyclo)
    • Line 1230: warning: cyclomatic complexity 22 of function (*node).calculateSnapshot() is high (> 15) (gocyclo)
    • Line 339: warning: cyclomatic complexity 16 of function (*node).applyCommitted() is high (> 15) (gocyclo)
    • Line 453: warning: cyclomatic complexity 16 of function (*node).processApplyCh() is high (> 15) (gocyclo)
    • query/outputnode.go
    • Line 904: warning: cyclomatic complexity 77 of function (*SubGraph).preTraverse() is high (> 15) (gocyclo)
    • Line 419: warning: cyclomatic complexity 31 of function (*encoder).encode() is high (> 15) (gocyclo)
    • Line 546: warning: cyclomatic complexity 18 of function (*encoder).normalize() is high (> 15) (gocyclo)
    • posting/index.go
    • Line 438: warning: cyclomatic complexity 19 of function (*List).AddMutationWithIndex() is high (> 15) (gocyclo)
    • Line 569: warning: cyclomatic complexity 18 of function (*rebuilder).Run() is high (> 15) (gocyclo)
    • Line 366: warning: cyclomatic complexity 16 of function (*Txn).addMutationHelper() is high (> 15) (gocyclo)
    • gql/state.go
    • Line 273: warning: cyclomatic complexity 34 of function lexFuncOrArg() is high (> 15) (gocyclo)
    • Line 410: warning: cyclomatic complexity 18 of function lexQuery() is high (> 15) (gocyclo)
    • Line 232: warning: cyclomatic complexity 17 of function lexInsideSchema() is high (> 15) (gocyclo)
    • chunker/json_parser.go
    • Line 315: warning: cyclomatic complexity 33 of function (*NQuadBuffer).mapToNquads() is high (> 15) (gocyclo)
    • Line 125: warning: cyclomatic complexity 17 of function handleBasicType() is high (> 15) (gocyclo)
    • chunker/rdf_state.go
    • Line 513: warning: cyclomatic complexity 29 of function isPnCharsBase() is high (> 15) (gocyclo)
    • Line 73: warning: cyclomatic complexity 23 of function lexText() is high (> 15) (gocyclo)
    • posting/list.go
    • Line 634: warning: cyclomatic complexity 27 of function (*List).iterate() is high (> 15) (gocyclo)
    • Line 438: warning: cyclomatic complexity 17 of function (*List).addMutationInternal() is high (> 15) (gocyclo)
    • conn/node.go
    • Line 648: warning: cyclomatic complexity 16 of function (*Node).RunReadIndexLoop() is high (> 15) (gocyclo)
    • x/keys.go
    • Line 471: warning: cyclomatic complexity 16 of function Parse() is high (> 15) (gocyclo)
    • schema/parse.go
    • Line 89: warning: cyclomatic complexity 21 of function parseScalarPair() is high (> 15) (gocyclo)
    • Line 174: warning: cyclomatic complexity 17 of function parseIndexDirective() is high (> 15) (gocyclo)
    • Line 247: warning: cyclomatic complexity 17 of function resolveTokenizers() is high (> 15) (gocyclo)
    • query/query.go
    • Line 1930: warning: cyclomatic complexity 67 of function ProcessGraph() is high (> 15) (gocyclo)
    • Line 2570: warning: cyclomatic complexity 33 of function (*Request).ProcessQuery() is high (> 15) (gocyclo)
    • Line 1127: warning: cyclomatic complexity 31 of function (*SubGraph).valueVarAggregation() is high (> 15) (gocyclo)
    • Line 512: warning: cyclomatic complexity 28 of function treeCopy() is high (> 15) (gocyclo)
    • Line 632: warning: cyclomatic complexity 22 of function (*params).fill() is high (> 15) (gocyclo)
    • Line 957: warning: cyclomatic complexity 21 of function evalLevelAgg() is high (> 15) (gocyclo)
    • Line 1385: warning: cyclomatic complexity 21 of function (*SubGraph).populateUidValVar() is high (> 15) (gocyclo)
    • Line 1637: warning: cyclomatic complexity 20 of function (*SubGraph).fillVars() is high (> 15) (gocyclo)
    • Line 1299: warning: cyclomatic complexity 19 of function (*SubGraph).populateVarMap() is high (> 15) (gocyclo)
    • Line 1507: warning: cyclomatic complexity 16 of function (*SubGraph).populateFacetVars() is high (> 15) (gocyclo)
    • worker/task.go
    • Line 1579: warning: cyclomatic complexity 57 of function parseSrcFn() is high (> 15) (gocyclo)
    • Line 592: warning: cyclomatic complexity 42 of function (*queryState).handleUidPostings() is high (> 15) (gocyclo)
    • Line 852: warning: cyclomatic complexity 37 of function (*queryState).helpProcessTask() is high (> 15) (gocyclo)
    • Line 326: warning: cyclomatic complexity 36 of function (*queryState).handleValuePostings() is high (> 15) (gocyclo)
    • Line 1128: warning: cyclomatic complexity 32 of function (*queryState).handleCompareFunction() is high (> 15) (gocyclo)
    • Line 2111: warning: cyclomatic complexity 21 of function (*queryState).handleHasFunction() is high (> 15) (gocyclo)
    • Line 1842: warning: cyclomatic complexity 20 of function applyFacetsTree() is high (> 15) (gocyclo)
    • Line 509: warning: cyclomatic complexity 19 of function retrieveValuesAndFacets() is high (> 15) (gocyclo)
    • Line 1255: warning: cyclomatic complexity 19 of function (*queryState).handleMatchFunction() is high (> 15) (gocyclo)
    • Line 1018: warning: cyclomatic complexity 19 of function (*queryState).handleRegexFunction() is high (> 15) (gocyclo)
    • Line 2038: warning: cyclomatic complexity 16 of function (*queryState).evaluate() is high (> 15) (gocyclo)
    • gql/math.go
    • Line 169: warning: cyclomatic complexity 43 of function parseMathFunc() is high (> 15) (gocyclo)
    • Line 158: warning: cyclomatic complexity 22 of function isMathFunc() is high (> 15) (gocyclo)
    • query/shortest.go
    • Line 465: warning: cyclomatic complexity 25 of function shortestPath() is high (> 15) (gocyclo)
    • Line 296: warning: cyclomatic complexity 24 of function runKShortestPaths() is high (> 15) (gocyclo)
    • Line 151: warning: cyclomatic complexity 24 of function (*SubGraph).expandOut() is high (> 15) (gocyclo)
    • worker/sort.go
    • Line 520: warning: cyclomatic complexity 19 of function intersectBucket() is high (> 15) (gocyclo)
    • Line 177: warning: cyclomatic complexity 17 of function sortWithIndex() is high (> 15) (gocyclo)
    • Line 300: warning: cyclomatic complexity 17 of function multiSort() is high (> 15) (gocyclo)
    • dgraph/cmd/zero/zero.go
    • Line 416: warning: cyclomatic complexity 33 of function (*Server).Connect() is high (> 15) (gocyclo)
    • Line 333: warning: cyclomatic complexity 17 of function (*Server).createProposals() is high (> 15) (gocyclo)
    • ee/backup/s3_handler.go
    • Line 242: warning: cyclomatic complexity 19 of function (*s3Handler).Load() is high (> 15) (gocyclo)
    • Line 61: warning: cyclomatic complexity 16 of function (*s3Handler).setup() is high (> 15) (gocyclo)
    • worker/groups.go
    • Line 853: warning: cyclomatic complexity 35 of function (*groupi).processOracleDeltaStream() is high (> 15) (gocyclo)
    • Line 755: warning: cyclomatic complexity 21 of function (*groupi).receiveMembershipUpdates() is high (> 15) (gocyclo)
    • Line 287: warning: cyclomatic complexity 21 of function (*groupi).applyState() is high (> 15) (gocyclo)
    • types/geofilter.go
    • Line 125: warning: cyclomatic complexity 20 of function queryTokensGeo() is high (> 15) (gocyclo)
    • Line 246: warning: cyclomatic complexity 17 of function (GeoQueryData).isWithin() is high (> 15) (gocyclo)
    • query/math.go
    • Line 35: warning: cyclomatic complexity 17 of function processBinary() is high (> 15) (gocyclo)
    • dgraph/cmd/alpha/http.go
    • Line 292: warning: cyclomatic complexity 31 of function mutationHandler() is high (> 15) (gocyclo)
    • Line 167: warning: cyclomatic complexity 18 of function queryHandler() is high (> 15) (gocyclo)
    • edgraph/server.go
    • Line 83: warning: cyclomatic complexity 28 of function (*Server).Alter() is high (> 15) (gocyclo)
    • Line 778: warning: cyclomatic complexity 22 of function processQuery() is high (> 15) (gocyclo)
    • Line 683: warning: cyclomatic complexity 16 of function (*Server).doQuery() is high (> 15) (gocyclo)
    • Line 227: warning: cyclomatic complexity 16 of function (*Server).doMutate() is high (> 15) (gocyclo)
    • Line 1132: warning: cyclomatic complexity 16 of function validateNQuads() is high (> 15) (gocyclo)
    • worker/mutation.go
    • Line 268: warning: cyclomatic complexity 24 of function checkSchema() is high (> 15) (gocyclo)
    • Line 341: warning: cyclomatic complexity 17 of function ValidateAndConvert() is high (> 15) (gocyclo)
    • query/recurse.go
    • Line 29: warning: cyclomatic complexity 34 of function (*SubGraph).expandRecurse() is high (> 15) (gocyclo)
    • posting/mvcc.go
    • Line 146: warning: cyclomatic complexity 16 of function ReadPostingList() is high (> 15) (gocyclo)
    • gql/parser.go
    • Line 2813: warning: cyclomatic complexity 93 of function godeep() is high (> 15) (gocyclo)
    • Line 1639: warning: cyclomatic complexity 63 of function parseFunction() is high (> 15) (gocyclo)
    • Line 2539: warning: cyclomatic complexity 58 of function getRoot() is high (> 15) (gocyclo)
    • Line 2364: warning: cyclomatic complexity 36 of function parseDirective() is high (> 15) (gocyclo)
    • Line 354: warning: cyclomatic complexity 27 of function substituteVariables() is high (> 15) (gocyclo)
    • Line 553: warning: cyclomatic complexity 25 of function ParseWithNeedVars() is high (> 15) (gocyclo)
    • Line 1270: warning: cyclomatic complexity 24 of function parseArguments() is high (> 15) (gocyclo)
    • Line 1146: warning: cyclomatic complexity 23 of function parseGqlVariables() is high (> 15) (gocyclo)
    • Line 2162: warning: cyclomatic complexity 21 of function parseFilter() is high (> 15) (gocyclo)
    • Line 917: warning: cyclomatic complexity 19 of function getQuery() is high (> 15) (gocyclo)
    • Line 834: warning: cyclomatic complexity 19 of function parseRecurseArgs() is high (> 15) (gocyclo)
    • Line 1380: warning: cyclomatic complexity 18 of function (*FilterTree).stringHelper() is high (> 15) (gocyclo)
    • Line 1989: warning: cyclomatic complexity 17 of function tryParseFacetList() is high (> 15) (gocyclo)
    • Line 2087: warning: cyclomatic complexity 17 of function parseGroupby() is high (> 15) (gocyclo)
    • Line 1496: warning: cyclomatic complexity 16 of function parseGeoArgs() is high (> 15) (gocyclo)
    • chunker/rdf_parser.go
    • Line 81: warning: cyclomatic complexity 47 of function ParseRDF() is high (> 15) (gocyclo)
    • Line 260: warning: cyclomatic complexity 17 of function parseFacetsRDF() is high (> 15) (gocyclo)
    • chunker/chunk.go
    • Line 165: warning: cyclomatic complexity 21 of function (*jsonChunker).Chunk() is high (> 15) (gocyclo)
    • types/s2.go
    • Line 134: warning: cyclomatic complexity 20 of function convertToGeom() is high (> 15) (gocyclo)
    • dgraph/cmd/zero/raft.go
    • Line 298: warning: cyclomatic complexity 25 of function (*node).applyProposal() is high (> 15) (gocyclo)
    • Line 621: warning: cyclomatic complexity 21 of function (*node).Run() is high (> 15) (gocyclo)
    • Line 172: warning: cyclomatic complexity 19 of function (*node).handleMemberProposal() is high (> 15) (gocyclo)
    • query/groupby.go
    • Line 273: warning: cyclomatic complexity 24 of function (*SubGraph).fillGroupedVars() is high (> 15) (gocyclo)
    • Line 203: warning: cyclomatic complexity 17 of function (*SubGraph).formResult() is high (> 15) (gocyclo)
    • algo/packed.go
    • Line 151: warning: cyclomatic complexity 22 of function DifferencePacked() is high (> 15) (gocyclo)
    • Line 46: warning: cyclomatic complexity 18 of function IntersectWithLinPacked() 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!