Preparing report...

Report for github.com/juicedata/juicefs

(v1.2.3)

A+    Excellent!    Found 77 issues across 264 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!


gofmt98%

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!


gocyclo71%

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.

    • pkg/object/sftp.go
    • Line 448: warning: cyclomatic complexity 27 of function newSftp() is high (> 15) (gocyclo)
    • Line 363: warning: cyclomatic complexity 16 of function (*sftpStore).List() is high (> 15) (gocyclo)
    • cmd/objbench.go
    • Line 654: warning: cyclomatic complexity 110 of function functionalTesting() is high (> 15) (gocyclo)
    • Line 123: warning: cyclomatic complexity 31 of function objbench() is high (> 15) (gocyclo)
    • Line 442: warning: cyclomatic complexity 24 of function (*benchMarkObj).run() is high (> 15) (gocyclo)
    • cmd/fsck.go
    • Line 73: warning: cyclomatic complexity 28 of function fsck() is high (> 15) (gocyclo)
    • cmd/clone.go
    • Line 59: warning: cyclomatic complexity 18 of function clone() is high (> 15) (gocyclo)
    • cmd/format.go
    • Line 360: warning: cyclomatic complexity 54 of function format() is high (> 15) (gocyclo)
    • Line 218: warning: cyclomatic complexity 17 of function createStorage() is high (> 15) (gocyclo)
    • pkg/sync/sync.go
    • Line 777: warning: cyclomatic complexity 38 of function produce() is high (> 15) (gocyclo)
    • Line 1240: warning: cyclomatic complexity 36 of function Sync() is high (> 15) (gocyclo)
    • Line 1126: warning: cyclomatic complexity 32 of function startProducer() is high (> 15) (gocyclo)
    • Line 617: warning: cyclomatic complexity 30 of function worker() is high (> 15) (gocyclo)
    • Line 232: warning: cyclomatic complexity 28 of function doCheckSum() is high (> 15) (gocyclo)
    • Line 79: warning: cyclomatic complexity 24 of function ListAll() is high (> 15) (gocyclo)
    • cmd/mount_unix.go
    • Line 421: warning: cyclomatic complexity 22 of function prepareMp() is high (> 15) (gocyclo)
    • Line 702: warning: cyclomatic complexity 18 of function launchMount() is high (> 15) (gocyclo)
    • cmd/quota.go
    • Line 102: warning: cyclomatic complexity 21 of function quota() is high (> 15) (gocyclo)
    • pkg/vfs/fill.go
    • Line 57: warning: cyclomatic complexity 19 of function (*VFS).cache() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 19 of function (*VFS).resolve() is high (> 15) (gocyclo)
    • cmd/main.go
    • Line 268: warning: cyclomatic complexity 22 of function setup() is high (> 15) (gocyclo)
    • Line 119: warning: cyclomatic complexity 20 of function handleSysMountArgs() is high (> 15) (gocyclo)
    • pkg/meta/sql.go
    • Line 1707: warning: cyclomatic complexity 114 of function (*dbMeta).doRename() is high (> 15) (gocyclo)
    • Line 1414: warning: cyclomatic complexity 58 of function (*dbMeta).doUnlink() is high (> 15) (gocyclo)
    • Line 1267: warning: cyclomatic complexity 44 of function (*dbMeta).doMknod() is high (> 15) (gocyclo)
    • Line 3619: warning: cyclomatic complexity 40 of function (*dbMeta).DumpMeta() is high (> 15) (gocyclo)
    • Line 4012: warning: cyclomatic complexity 40 of function (*dbMeta).doCloneEntry() is high (> 15) (gocyclo)
    • Line 1574: warning: cyclomatic complexity 37 of function (*dbMeta).doRmdir() is high (> 15) (gocyclo)
    • Line 3858: warning: cyclomatic complexity 35 of function (*dbMeta).LoadMeta() is high (> 15) (gocyclo)
    • Line 2318: warning: cyclomatic complexity 33 of function (*dbMeta).CopyFileRange() is high (> 15) (gocyclo)
    • Line 354: warning: cyclomatic complexity 25 of function (*dbMeta).doInit() is high (> 15) (gocyclo)
    • Line 2759: warning: cyclomatic complexity 24 of function (*dbMeta).doCompactChunk() is high (> 15) (gocyclo)
    • Line 2013: warning: cyclomatic complexity 23 of function (*dbMeta).doLink() is high (> 15) (gocyclo)
    • Line 3258: warning: cyclomatic complexity 23 of function (*dbMeta).dumpEntry() is high (> 15) (gocyclo)
    • Line 3417: warning: cyclomatic complexity 22 of function (*dbMeta).dumpDir() is high (> 15) (gocyclo)
    • Line 1078: warning: cyclomatic complexity 21 of function (*dbMeta).doTruncate() is high (> 15) (gocyclo)
    • Line 2902: warning: cyclomatic complexity 19 of function (*dbMeta).scanTrashSlices() is high (> 15) (gocyclo)
    • Line 1150: warning: cyclomatic complexity 18 of function (*dbMeta).doFallocate() is high (> 15) (gocyclo)
    • Line 3353: warning: cyclomatic complexity 17 of function (*dbMeta).dumpEntryFast() is high (> 15) (gocyclo)
    • Line 4324: warning: cyclomatic complexity 16 of function (*dbMeta).doSetFacl() is high (> 15) (gocyclo)
    • Line 2701: warning: cyclomatic complexity 16 of function (*dbMeta).doCleanupDelayedSlices() is high (> 15) (gocyclo)
    • Line 2628: warning: cyclomatic complexity 16 of function (*dbMeta).deleteChunk() is high (> 15) (gocyclo)
    • pkg/sync/cluster.go
    • Line 243: warning: cyclomatic complexity 20 of function launchWorker() is high (> 15) (gocyclo)
    • Line 137: warning: cyclomatic complexity 17 of function startManager() is high (> 15) (gocyclo)
    • cmd/sync.go
    • Line 301: warning: cyclomatic complexity 39 of function createSyncStorage() is high (> 15) (gocyclo)
    • Line 431: warning: cyclomatic complexity 18 of function doSync() is high (> 15) (gocyclo)
    • cmd/debug.go
    • Line 212: warning: cyclomatic complexity 19 of function getPprofPort() is high (> 15) (gocyclo)
    • pkg/meta/base_test.go
    • Line 397: warning: cyclomatic complexity 206 of function testMetaClient() is high (> 15) (gocyclo)
    • Line 2584: warning: cyclomatic complexity 62 of function testClone() is high (> 15) (gocyclo)
    • Line 1831: warning: cyclomatic complexity 51 of function testTrash() is high (> 15) (gocyclo)
    • Line 1109: warning: cyclomatic complexity 49 of function testLocks() is high (> 15) (gocyclo)
    • Line 2931: warning: cyclomatic complexity 46 of function testQuota() is high (> 15) (gocyclo)
    • Line 1391: warning: cyclomatic complexity 45 of function testCompaction() is high (> 15) (gocyclo)
    • Line 2177: warning: cyclomatic complexity 42 of function testAttrFlags() is high (> 15) (gocyclo)
    • Line 1035: warning: cyclomatic complexity 41 of function testListLocks() is high (> 15) (gocyclo)
    • Line 2375: warning: cyclomatic complexity 35 of function testCheckAndRepair() is high (> 15) (gocyclo)
    • Line 1770: warning: cyclomatic complexity 25 of function testCloseSession() is high (> 15) (gocyclo)
    • Line 3086: warning: cyclomatic complexity 24 of function testAtime() is high (> 15) (gocyclo)
    • Line 2106: warning: cyclomatic complexity 23 of function testConcurrentDir() is high (> 15) (gocyclo)
    • Line 217: warning: cyclomatic complexity 19 of function testACL() is high (> 15) (gocyclo)
    • Line 1977: warning: cyclomatic complexity 19 of function testParents() is high (> 15) (gocyclo)
    • Line 969: warning: cyclomatic complexity 17 of function testStickyBit() is high (> 15) (gocyclo)
    • Line 63: warning: cyclomatic complexity 17 of function TestKeyDB() is high (> 15) (gocyclo)
    • pkg/meta/random_test.go
    • Line 1445: warning: cyclomatic complexity 31 of function (*fsMachine).checkFSTree() is high (> 15) (gocyclo)
    • Line 758: warning: cyclomatic complexity 28 of function (*fsMachine).rename() is high (> 15) (gocyclo)
    • Line 174: warning: cyclomatic complexity 24 of function (*fsMachine).create() is high (> 15) (gocyclo)
    • Line 615: warning: cyclomatic complexity 19 of function (*fsMachine).copy_file_range() is high (> 15) (gocyclo)
    • Line 327: warning: cyclomatic complexity 19 of function (*fsMachine).symlink() is high (> 15) (gocyclo)
    • pkg/meta/sql_lock.go
    • Line 159: warning: cyclomatic complexity 28 of function (*dbMeta).Setlk() is high (> 15) (gocyclo)
    • Line 32: warning: cyclomatic complexity 21 of function (*dbMeta).Flock() is high (> 15) (gocyclo)
    • cmd/warmup.go
    • Line 189: warning: cyclomatic complexity 29 of function warmup() is high (> 15) (gocyclo)
    • cmd/bench.go
    • Line 308: warning: cyclomatic complexity 21 of function bench() is high (> 15) (gocyclo)
    • cmd/load.go
    • Line 67: warning: cyclomatic complexity 19 of function load() is high (> 15) (gocyclo)
    • pkg/object/redis.go
    • Line 80: warning: cyclomatic complexity 19 of function (*redisStore).ListAll() is high (> 15) (gocyclo)
    • Line 181: warning: cyclomatic complexity 18 of function newRedis() is high (> 15) (gocyclo)
    • cmd/mount.go
    • Line 559: warning: cyclomatic complexity 39 of function mount() is high (> 15) (gocyclo)
    • Line 187: warning: cyclomatic complexity 17 of function cacheDirPathToAbs() is high (> 15) (gocyclo)
    • sdk/java/libjfs/main.go
    • Line 410: warning: cyclomatic complexity 34 of function jfs_init() is high (> 15) (gocyclo)
    • Line 97: warning: cyclomatic complexity 18 of function errno() is high (> 15) (gocyclo)
    • pkg/meta/utils.go
    • Line 379: warning: cyclomatic complexity 24 of function (*baseMeta).getDirSummary() is high (> 15) (gocyclo)
    • Line 259: warning: cyclomatic complexity 21 of function (*baseMeta).emptyDir() is high (> 15) (gocyclo)
    • Line 482: warning: cyclomatic complexity 18 of function (*baseMeta).getTreeSummary() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 17 of function updateLocks() is high (> 15) (gocyclo)
    • pkg/chunk/disk_cache.go
    • Line 1277: warning: cyclomatic complexity 21 of function (*cacheFile).ReadAt() is high (> 15) (gocyclo)
    • Line 722: warning: cyclomatic complexity 19 of function (*cacheStore).cleanupFull() is high (> 15) (gocyclo)
    • Line 797: warning: cyclomatic complexity 16 of function (*cacheStore).uploadStaging() is high (> 15) (gocyclo)
    • pkg/meta/redis.go
    • Line 1594: warning: cyclomatic complexity 103 of function (*redisMeta).doRename() is high (> 15) (gocyclo)
    • Line 1342: warning: cyclomatic complexity 47 of function (*redisMeta).doUnlink() is high (> 15) (gocyclo)
    • Line 3515: warning: cyclomatic complexity 44 of function (*redisMeta).dumpEntries() is high (> 15) (gocyclo)
    • Line 1200: warning: cyclomatic complexity 39 of function (*redisMeta).doMknod() is high (> 15) (gocyclo)
    • Line 2247: warning: cyclomatic complexity 32 of function (*redisMeta).CopyFileRange() is high (> 15) (gocyclo)
    • Line 4134: warning: cyclomatic complexity 31 of function (*redisMeta).doCloneEntry() is high (> 15) (gocyclo)
    • Line 3792: warning: cyclomatic complexity 30 of function (*redisMeta).DumpMeta() is high (> 15) (gocyclo)
    • Line 1488: warning: cyclomatic complexity 28 of function (*redisMeta).doRmdir() is high (> 15) (gocyclo)
    • Line 103: warning: cyclomatic complexity 28 of function newRedisMeta() is high (> 15) (gocyclo)
    • Line 4012: warning: cyclomatic complexity 27 of function (*redisMeta).LoadMeta() is high (> 15) (gocyclo)
    • Line 3689: warning: cyclomatic complexity 25 of function (*redisMeta).dumpDir() is high (> 15) (gocyclo)
    • Line 954: warning: cyclomatic complexity 24 of function (*redisMeta).doTruncate() is high (> 15) (gocyclo)
    • Line 2837: warning: cyclomatic complexity 22 of function (*redisMeta).doCompactChunk() is high (> 15) (gocyclo)
    • Line 1884: warning: cyclomatic complexity 22 of function (*redisMeta).doLink() is high (> 15) (gocyclo)
    • Line 1957: warning: cyclomatic complexity 21 of function (*redisMeta).doReaddir() is high (> 15) (gocyclo)
    • Line 842: warning: cyclomatic complexity 20 of function (*redisMeta).shouldRetry() is high (> 15) (gocyclo)
    • Line 1044: warning: cyclomatic complexity 17 of function (*redisMeta).doFallocate() is high (> 15) (gocyclo)
    • Line 2043: warning: cyclomatic complexity 17 of function (*redisMeta).doCleanStaleSession() is high (> 15) (gocyclo)
    • Line 3097: warning: cyclomatic complexity 17 of function (*redisMeta).scanTrashSlices() is high (> 15) (gocyclo)
    • Line 702: warning: cyclomatic complexity 16 of function (*redisMeta).handleLuaResult() is high (> 15) (gocyclo)
    • pkg/fs/fs.go
    • Line 736: warning: cyclomatic complexity 28 of function (*FileSystem).doResolve() is high (> 15) (gocyclo)
    • Line 676: warning: cyclomatic complexity 19 of function (*FileSystem).lookup() is high (> 15) (gocyclo)
    • pkg/vfs/vfs_unix.go
    • Line 312: warning: cyclomatic complexity 22 of function (*VFS).Ioctl() is high (> 15) (gocyclo)
    • Line 144: warning: cyclomatic complexity 17 of function (*VFS).SetAttr() is high (> 15) (gocyclo)
    • Line 101: warning: cyclomatic complexity 16 of function setattrStr() is high (> 15) (gocyclo)
    • pkg/vfs/reader.go
    • Line 368: warning: cyclomatic complexity 19 of function (*fileReader).guessSession() is high (> 15) (gocyclo)
    • pkg/object/gluster.go
    • Line 264: warning: cyclomatic complexity 18 of function newGluster() is high (> 15) (gocyclo)
    • Line 201: warning: cyclomatic complexity 16 of function (*gluster).List() is high (> 15) (gocyclo)
    • cmd/config.go
    • Line 128: warning: cyclomatic complexity 75 of function config() is high (> 15) (gocyclo)
    • pkg/meta/base.go
    • Line 2590: warning: cyclomatic complexity 52 of function (*baseMeta).mergeAttr() is high (> 15) (gocyclo)
    • Line 1748: warning: cyclomatic complexity 45 of function (*baseMeta).Check() is high (> 15) (gocyclo)
    • Line 1201: warning: cyclomatic complexity 35 of function (*baseMeta).Rename() is high (> 15) (gocyclo)
    • Line 2008: warning: cyclomatic complexity 28 of function (*baseMeta).compactChunk() is high (> 15) (gocyclo)
    • Line 1629: warning: cyclomatic complexity 24 of function (*baseMeta).GetPaths() is high (> 15) (gocyclo)
    • Line 2493: warning: cyclomatic complexity 23 of function (*baseMeta).cloneEntry() is high (> 15) (gocyclo)
    • Line 690: warning: cyclomatic complexity 21 of function (*baseMeta).Lookup() is high (> 15) (gocyclo)
    • Line 440: warning: cyclomatic complexity 21 of function (*baseMeta).refresh() is high (> 15) (gocyclo)
    • Line 1335: warning: cyclomatic complexity 20 of function (*baseMeta).Open() is high (> 15) (gocyclo)
    • Line 2428: warning: cyclomatic complexity 19 of function (*baseMeta).Clone() is high (> 15) (gocyclo)
    • cmd/info.go
    • Line 76: warning: cyclomatic complexity 28 of function info() is high (> 15) (gocyclo)
    • pkg/chunk/cached_store.go
    • Line 751: warning: cyclomatic complexity 22 of function NewCachedStore() is high (> 15) (gocyclo)
    • Line 96: warning: cyclomatic complexity 21 of function (*rSlice).ReadAt() is high (> 15) (gocyclo)
    • Line 560: warning: cyclomatic complexity 19 of function (*Config).SelfCheck() is high (> 15) (gocyclo)
    • Line 673: warning: cyclomatic complexity 18 of function (*cachedStore).load() is high (> 15) (gocyclo)
    • cmd/summary.go
    • Line 84: warning: cyclomatic complexity 16 of function summary() is high (> 15) (gocyclo)
    • pkg/vfs/vfs.go
    • Line 873: warning: cyclomatic complexity 27 of function (*VFS).CopyFileRange() is high (> 15) (gocyclo)
    • Line 651: warning: cyclomatic complexity 27 of function (*VFS).Read() is high (> 15) (gocyclo)
    • Line 1384: warning: cyclomatic complexity 17 of function decodeACL() is high (> 15) (gocyclo)
    • cmd/gc.go
    • Line 76: warning: cyclomatic complexity 56 of function gc() is high (> 15) (gocyclo)
    • pkg/meta/dump.go
    • Line 478: warning: cyclomatic complexity 45 of function decodeEntry() is high (> 15) (gocyclo)
    • Line 227: warning: cyclomatic complexity 17 of function (*DumpedEntry).writeJSON() is high (> 15) (gocyclo)
    • pkg/meta/quota.go
    • Line 396: warning: cyclomatic complexity 26 of function (*baseMeta).HandleQuota() is high (> 15) (gocyclo)
    • pkg/gateway/gateway.go
    • Line 883: warning: cyclomatic complexity 19 of function (*jfsObjects).ListMultipartUploads() is high (> 15) (gocyclo)
    • Line 541: warning: cyclomatic complexity 18 of function (*jfsObjects).CopyObject() is high (> 15) (gocyclo)
    • pkg/object/hdfs.go
    • Line 209: warning: cyclomatic complexity 19 of function (*hdfsclient).List() is high (> 15) (gocyclo)
    • Line 296: warning: cyclomatic complexity 19 of function newHDFS() is high (> 15) (gocyclo)
    • Line 127: warning: cyclomatic complexity 17 of function (*hdfsclient).Put() is high (> 15) (gocyclo)
    • pkg/meta/tkv.go
    • Line 1458: warning: cyclomatic complexity 100 of function (*kvMeta).doRename() is high (> 15) (gocyclo)
    • Line 2962: warning: cyclomatic complexity 59 of function (*kvMeta).DumpMeta() is high (> 15) (gocyclo)
    • Line 1224: warning: cyclomatic complexity 45 of function (*kvMeta).doUnlink() is high (> 15) (gocyclo)
    • Line 1091: warning: cyclomatic complexity 38 of function (*kvMeta).doMknod() is high (> 15) (gocyclo)
    • Line 1363: warning: cyclomatic complexity 31 of function (*kvMeta).doRmdir() is high (> 15) (gocyclo)
    • Line 1934: warning: cyclomatic complexity 30 of function (*kvMeta).CopyFileRange() is high (> 15) (gocyclo)
    • Line 3400: warning: cyclomatic complexity 24 of function (*kvMeta).doCloneEntry() is high (> 15) (gocyclo)
    • Line 3289: warning: cyclomatic complexity 23 of function (*kvMeta).LoadMeta() is high (> 15) (gocyclo)
    • Line 2834: warning: cyclomatic complexity 22 of function (*kvMeta).dumpDir() is high (> 15) (gocyclo)
    • Line 2741: warning: cyclomatic complexity 20 of function (*kvMeta).dumpEntry() is high (> 15) (gocyclo)
    • Line 2323: warning: cyclomatic complexity 18 of function (*kvMeta).doCompactChunk() is high (> 15) (gocyclo)
    • Line 1719: warning: cyclomatic complexity 18 of function (*kvMeta).doLink() is high (> 15) (gocyclo)
    • Line 565: warning: cyclomatic complexity 17 of function (*kvMeta).doCleanStaleSession() is high (> 15) (gocyclo)
    • Line 1781: warning: cyclomatic complexity 17 of function (*kvMeta).doReaddir() is high (> 15) (gocyclo)
    • pkg/vfs/vfs_test.go
    • Line 597: warning: cyclomatic complexity 65 of function TestInternalFile() is high (> 15) (gocyclo)
    • Line 189: warning: cyclomatic complexity 55 of function TestVFSIO() is high (> 15) (gocyclo)
    • Line 80: warning: cyclomatic complexity 42 of function TestVFSBasic() is high (> 15) (gocyclo)
    • Line 354: warning: cyclomatic complexity 35 of function TestVFSXattrs() is high (> 15) (gocyclo)
    • Line 496: warning: cyclomatic complexity 30 of function TestVFSLocks() is high (> 15) (gocyclo)
    • Line 867: warning: cyclomatic complexity 17 of function TestReaddirCache() is high (> 15) (gocyclo)
    • cmd/stats.go
    • Line 295: warning: cyclomatic complexity 16 of function (*statsWatcher).printDiff() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell99%

Misspell Finds commonly misspelled English words