Preparing report...

Report for github.com/cozy/cozy-stack

(v0.0.0-20230424083744-823b20b31a89)

A+    Excellent!    Found 93 issues across 517 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo82%

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.

    • cmd/files.go
    • Line 227: warning: cyclomatic complexity 19 of function lsCmd() is high (> 15) (gocyclo)
    • Line 152: warning: cyclomatic complexity 17 of function execCommand() is high (> 15) (gocyclo)
    • worker/exec/konnector.go
    • Line 122: warning: cyclomatic complexity 19 of function beforeHookKonnector() is high (> 15) (gocyclo)
    • Line 280: warning: cyclomatic complexity 18 of function (*konnectorWorker).ensureFolderToSave() is high (> 15) (gocyclo)
    • Line 182: warning: cyclomatic complexity 16 of function (*konnectorWorker).PrepareWorkDir() is high (> 15) (gocyclo)
    • model/sharing/sharing.go
    • Line 1489: warning: cyclomatic complexity 29 of function (*Sharing).checkSharingTreesConsistency() is high (> 15) (gocyclo)
    • Line 1038: warning: cyclomatic complexity 25 of function CheckSharings() is high (> 15) (gocyclo)
    • Line 1224: warning: cyclomatic complexity 21 of function (*Sharing).checkSharingTriggers() is high (> 15) (gocyclo)
    • Line 593: warning: cyclomatic complexity 18 of function (*Sharing).RevokeByNotification() is high (> 15) (gocyclo)
    • Line 507: warning: cyclomatic complexity 16 of function (*Sharing).RevokeRecipientBySelf() is high (> 15) (gocyclo)
    • model/sharing/files.go
    • Line 522: warning: cyclomatic complexity 29 of function (*Sharing).ApplyBulkFiles() is high (> 15) (gocyclo)
    • Line 680: warning: cyclomatic complexity 27 of function copySafeFieldsToDir() is high (> 15) (gocyclo)
    • Line 421: warning: cyclomatic complexity 18 of function (*Sharing).GetNoLongerSharedDir() is high (> 15) (gocyclo)
    • Line 172: warning: cyclomatic complexity 16 of function EnsureSharedWithMeDir() is high (> 15) (gocyclo)
    • worker/mails/mail.go
    • Line 33: warning: cyclomatic complexity 25 of function SendMail() is high (> 15) (gocyclo)
    • Line 137: warning: cyclomatic complexity 18 of function doSendMail() is high (> 15) (gocyclo)
    • model/vfs/vfsswift/impl_v1.go
    • Line 674: warning: cyclomatic complexity 27 of function (*swiftFileCreation).Close() is high (> 15) (gocyclo)
    • Line 205: warning: cyclomatic complexity 21 of function (*swiftVFS).CreateFile() is high (> 15) (gocyclo)
    • web/sharings/sharings.go
    • Line 527: warning: cyclomatic complexity 22 of function PostDiscovery() is high (> 15) (gocyclo)
    • Line 851: warning: cyclomatic complexity 22 of function wrapErrors() is high (> 15) (gocyclo)
    • Line 30: warning: cyclomatic complexity 16 of function CreateSharing() is high (> 15) (gocyclo)
    • model/sharing/setup.go
    • Line 241: warning: cyclomatic complexity 19 of function FindMatchingDocs() is high (> 15) (gocyclo)
    • Line 63: warning: cyclomatic complexity 19 of function (*Sharing).Setup() is high (> 15) (gocyclo)
    • worker/migrations/migrations.go
    • Line 115: warning: cyclomatic complexity 18 of function removeUnwantedFolders() is high (> 15) (gocyclo)
    • Line 235: warning: cyclomatic complexity 17 of function migrateToSwiftV3() is high (> 15) (gocyclo)
    • Line 320: warning: cyclomatic complexity 16 of function copyTheFilesToSwiftV3() is high (> 15) (gocyclo)
    • web/permissions/permissions.go
    • Line 302: warning: cyclomatic complexity 17 of function patchPermission() is high (> 15) (gocyclo)
    • Line 105: warning: cyclomatic complexity 17 of function createPermission() is high (> 15) (gocyclo)
    • model/sharing/shared.go
    • Line 317: warning: cyclomatic complexity 27 of function UpdateShared() is high (> 15) (gocyclo)
    • Line 172: warning: cyclomatic complexity 20 of function isFileNoLongerShared() is high (> 15) (gocyclo)
    • model/sharing/upload.go
    • Line 676: warning: cyclomatic complexity 20 of function (*Sharing).UploadExistingFile() is high (> 15) (gocyclo)
    • Line 520: warning: cyclomatic complexity 17 of function (*Sharing).UploadNewFile() is high (> 15) (gocyclo)
    • Line 234: warning: cyclomatic complexity 17 of function (*Sharing).uploadFile() is high (> 15) (gocyclo)
    • model/sharing/open_file.go
    • Line 130: warning: cyclomatic complexity 16 of function (*FileOpener).GetSharecode() is high (> 15) (gocyclo)
    • Line 257: warning: cyclomatic complexity 16 of function (*FileOpener).PrepareRequestForSharedFile() is high (> 15) (gocyclo)
    • model/sharing/rule.go
    • Line 51: warning: cyclomatic complexity 32 of function (*Sharing).ValidateRules() is high (> 15) (gocyclo)
    • Line 124: warning: cyclomatic complexity 18 of function (Rule).Accept() is high (> 15) (gocyclo)
    • web/instances/fixers.go
    • Line 346: warning: cyclomatic complexity 31 of function serviceTriggersFixer() is high (> 15) (gocyclo)
    • Line 240: warning: cyclomatic complexity 25 of function orphanAccountFixer() is high (> 15) (gocyclo)
    • model/job/worker.go
    • Line 265: warning: cyclomatic complexity 19 of function (*Worker).work() is high (> 15) (gocyclo)
    • Line 390: warning: cyclomatic complexity 18 of function (*task).run() is high (> 15) (gocyclo)
    • web/auth/oauth.go
    • Line 144: warning: cyclomatic complexity 28 of function authorizeForm() is high (> 15) (gocyclo)
    • Line 56: warning: cyclomatic complexity 24 of function checkAuthorizeParams() is high (> 15) (gocyclo)
    • Line 791: warning: cyclomatic complexity 23 of function accessToken() is high (> 15) (gocyclo)
    • model/vfs/vfsswift/impl_v2.go
    • Line 660: warning: cyclomatic complexity 27 of function (*swiftFileCreationV2).Close() is high (> 15) (gocyclo)
    • Line 213: warning: cyclomatic complexity 21 of function (*swiftVFSV2).CreateFile() is high (> 15) (gocyclo)
    • web/files/files.go
    • Line 1445: warning: cyclomatic complexity 32 of function FindFilesMango() is high (> 15) (gocyclo)
    • Line 463: warning: cyclomatic complexity 26 of function CopyVersionHandler() is high (> 15) (gocyclo)
    • Line 1933: warning: cyclomatic complexity 25 of function FileDocFromReq() is high (> 15) (gocyclo)
    • Line 1890: warning: cyclomatic complexity 18 of function wrapVfsError() is high (> 15) (gocyclo)
    • Line 200: warning: cyclomatic complexity 16 of function OverwriteFileContentHandler() is high (> 15) (gocyclo)
    • model/sharing/member.go
    • Line 242: warning: cyclomatic complexity 25 of function (*Sharing).DelegateAddContacts() is high (> 15) (gocyclo)
    • Line 981: warning: cyclomatic complexity 20 of function (*Sharing).NotifyRecipients() is high (> 15) (gocyclo)
    • client/jobs.go
    • Line 76: warning: cyclomatic complexity 21 of function (*Client).JobPush() is high (> 15) (gocyclo)
    • model/app/installer.go
    • Line 360: warning: cyclomatic complexity 35 of function (*Installer).update() is high (> 15) (gocyclo)
    • Line 95: warning: cyclomatic complexity 18 of function NewInstaller() is high (> 15) (gocyclo)
    • pkg/statik/statik.go
    • Line 194: warning: cyclomatic complexity 26 of function generateSource() is high (> 15) (gocyclo)
    • Line 356: warning: cyclomatic complexity 20 of function parseExternalsFile() is high (> 15) (gocyclo)
    • model/sharing/oauth.go
    • Line 358: warning: cyclomatic complexity 22 of function (*Sharing).SendAnswer() is high (> 15) (gocyclo)
    • Line 450: warning: cyclomatic complexity 18 of function (*Sharing).ProcessAnswer() is high (> 15) (gocyclo)
    • Line 30: warning: cyclomatic complexity 18 of function (*Member).CreateSharingRequest() is high (> 15) (gocyclo)
    • web/instances/instances.go
    • Line 52: warning: cyclomatic complexity 19 of function createHandler() is high (> 15) (gocyclo)
    • Line 429: warning: cyclomatic complexity 17 of function lastActivity() is high (> 15) (gocyclo)
    • web/settings/passphrase.go
    • Line 235: warning: cyclomatic complexity 25 of function updatePassphrase() is high (> 15) (gocyclo)
    • Line 139: warning: cyclomatic complexity 19 of function registerPassphraseFlagship() 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!