Preparing report...

Report for github.com/redhat-appstudio/managed-gitops/backend

(v0.0.0-20220118131406-aeef4a56e099)

A    Great!    Found 23 issues across 32 files

Tweet

gofmt87%

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!


gocyclo84%

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.

    • eventloop/application_event_runner.go
    • Line 148: warning: cyclomatic complexity 41 of function (*applicationEventLoopRunner_Action).applicationEventRunner_handleSyncRunModified() is high (> 15) (gocyclo)
    • Line 510: warning: cyclomatic complexity 19 of function (*applicationEventLoopRunner_Action).applicationEventRunner_handleDeploymentModified() is high (> 15) (gocyclo)
    • Line 666: warning: cyclomatic complexity 17 of function (applicationEventLoopRunner_Action).cleanOldGitOpsDeploymentEntry() is high (> 15) (gocyclo)

golint50%

Golint is a linter for Go source code.

    • routes/managedenvironment/managedenviroment.go
    • Line 24: warning: comment on exported type ManagedEnvironmentListEntry should be of the form "ManagedEnvironmentListEntry ..." (with optional leading article) (golint)
    • Line 32: warning: exported type ManagedEnvironmentListResponse should have comment or be unexported (golint)
    • Line 36: warning: comment on exported type ManagedEnvironmentGetSingleEntry should be of the form "ManagedEnvironmentGetSingleEntry ..." (with optional leading article) (golint)
    • Line 46: warning: comment on exported type ManagedEnvironmentPostEntry should be of the form "ManagedEnvironmentPostEntry ..." (with optional leading article) (golint)
    • Line 58: warning: exported function HandleListManagedEnvironments should have comment or be unexported (golint)
    • Line 79: warning: comment on exported function HandlePostManagedEnvironment should be of the form "HandlePostManagedEnvironment ..." (golint)
    • Line 88: warning: comment on exported function HandleGetASpecificManagementEnvironment should be of the form "HandleGetASpecificManagementEnvironment ..." (golint)
    • apis/managed-gitops/v1alpha1/types.go
    • Line 3: warning: exported type GitOpsResourceType should have comment or be unexported (golint)
    • Line 6: warning: exported const GitOpsDeploymentTypeName should have comment (or a comment on this block) or be unexported (golint)
    • eventloop/sharedresourceloop.go
    • Line 141: warning: don't use underscores in Go names; const sharedResourceLoopMessage_getOrCreateSharedResources should be sharedResourceLoopMessageGetOrCreateSharedResources (golint)
    • Line 142: warning: don't use underscores in Go names; const sharedResourceLoopMessage_getOrCreateClusterUserByNamespaceUID should be sharedResourceLoopMessageGetOrCreateClusterUserByNamespaceUID (golint)
    • Line 143: warning: don't use underscores in Go names; const sharedResourceLoopMessage_getGitopsEngineInstanceById should be sharedResourceLoopMessageGetGitopsEngineInstanceByID (golint)
    • Line 157: warning: don't use underscores in Go names; type sharedResourceLoopMessage_getGitopsEngineInstanceByIdResponse should be sharedResourceLoopMessageGetGitopsEngineInstanceByIDResponse (golint)
    • Line 162: warning: don't use underscores in Go names; type sharedResourceLoopMessage_getOrCreateSharedResourcesResponse should be sharedResourceLoopMessageGetOrCreateSharedResourcesResponse (golint)
    • Line 170: warning: don't use underscores in Go names; type sharedResourceLoopMessage_getOrCreateClusterUserByNamespaceUIDRequest should be sharedResourceLoopMessageGetOrCreateClusterUserByNamespaceUIDRequest (golint)
    • Line 174: warning: don't use underscores in Go names; type sharedResourceLoopMessage_getOrCreateClusterUserByNamespaceUIDResponse should be sharedResourceLoopMessageGetOrCreateClusterUserByNamespaceUIDResponse (golint)
    • Line 265: warning: don't use underscores in Go names; func internalProcessMessage_GetGitopsEngineInstanceById should be internalProcessMessageGetGitopsEngineInstanceByID (golint)
    • Line 276: warning: don't use underscores in Go names; func internalProcessMessage_GetOrCreateClusterUserByNamespaceUID should be internalProcessMessageGetOrCreateClusterUserByNamespaceUID (golint)
    • Line 299: warning: don't use underscores in Go names; func internalProcessMessage_GetOrCreateSharedResources should be internalProcessMessageGetOrCreateSharedResources (golint)
    • eventloop/types.go
    • Line 9: warning: exported type EventLoopEventType should have comment or be unexported (golint)
    • Line 12: warning: exported const DeploymentModified should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: comment on exported const SyncRunModified should be of the form "SyncRunModified ..." (golint)
    • Line 34: warning: don't use underscores in Go names; const applicationEventLoopMessageType_WorkComplete should be applicationEventLoopMessageTypeWorkComplete (golint)
    • Line 35: warning: don't use underscores in Go names; const applicationEventLoopMessageType_Event should be applicationEventLoopMessageTypeEvent (golint)
    • routes/webhooks/webhooks.go
    • Line 15: warning: exported type WebHookInfo should have comment or be unexported (golint)
    • Line 22: warning: exported function ParseWebhookInfo should have comment or be unexported (golint)
    • util/util.go
    • Line 9: warning: comment on exported type ExponentialBackoff should be of the form "ExponentialBackoff ..." (with optional leading article) (golint)
    • Line 18: warning: exported method ExponentialBackoff.Reset should have comment or be unexported (golint)
    • Line 54: warning: exported method ExponentialBackoff.DelayOnFail should have comment or be unexported (golint)
    • eventloop/application_event_runner.go
    • Line 148: warning: don't use underscores in Go names; method applicationEventRunner_handleSyncRunModified should be applicationEventRunnerHandleSyncRunModified (golint)
    • Line 481: 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)
    • Line 510: warning: don't use underscores in Go names; method applicationEventRunner_handleDeploymentModified should be applicationEventRunnerHandleDeploymentModified (golint)
    • Line 745: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 798: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 1000: warning: don't use underscores in Go names; type applicationEventLoopRunner_Action should be applicationEventLoopRunnerAction (golint)
    • eventloop/task_retry_loop.go
    • Line 47: warning: don't use underscores in Go names; const taskRetryLoop_addTask should be taskRetryLoopAddTask (golint)
    • Line 48: warning: don't use underscores in Go names; const taskRetryLoop_removeTask should be taskRetryLoopRemoveTask (golint)
    • Line 49: warning: don't use underscores in Go names; const taskRetryLoop_workCompleted should be taskRetryLoopWorkCompleted (golint)
    • Line 50: warning: don't use underscores in Go names; const taskRetryLoop_tick should be taskRetryLoopTick (golint)
    • Line 62: warning: don't use underscores in Go names; type taskRetryMessage_addTask should be taskRetryMessageAddTask (golint)
    • Line 67: warning: don't use underscores in Go names; type taskRetryMessage_removeTask should be taskRetryMessageRemoveTask (golint)
    • Line 71: warning: don't use underscores in Go names; type taskRetryMessage_workCompleted should be taskRetryMessageWorkCompleted (golint)
    • util/proxyclient.go
    • Line 29: warning: exported type ProxyClientEvent should have comment or be unexported (golint)
    • Line 41: warning: exported type ProxyClientEventOptions should have comment or be unexported (golint)
    • Line 50: warning: exported type ClientAction should have comment or be unexported (golint)
    • Line 53: warning: exported const Get should have comment (or a comment on this block) or be unexported (golint)
    • Line 219: warning: comment on exported method ProxyClient.Status should be of the form "Status ..." (golint)
    • Line 238: warning: exported type ProxyClientEventReceiver should have comment or be unexported (golint)
    • Line 242: warning: exported type ProxyClientStatusWrapper should have comment or be unexported (golint)
    • Line 321: warning: exported method ProxyClientEvent.ObjectTypeOf should have comment or be unexported (golint)
    • Line 338: warning: exported method ListEventReceiver.ReceiveEvent should have comment or be unexported (golint)
    • util/server.go
    • Line 9: warning: exported function WaitForServerUp should have comment or be unexported (golint)
    • eventloop/preprocess_event_loop.go
    • Line 34: warning: exported type PreprocessEventLoop should have comment or be unexported (golint)
    • Line 39: warning: exported function NewPreprocessEventLoop should have comment or be unexported (golint)
    • Line 147: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 472: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • main_test.go
    • Line 29: warning: don't use underscores in Go names; var resp_app should be respApp (golint)
    • Line 29: warning: don't use underscores in Go names; var err_app should be errApp (golint)
    • Line 38: warning: don't use underscores in Go names; var resp_opr should be respOpr (golint)
    • Line 38: warning: don't use underscores in Go names; var err_opr should be errOpr (golint)
    • util/createHook.go
    • Line 11: warning: exported type TokenSource should have comment or be unexported (golint)
    • Line 15: warning: exported method TokenSource.Token should have comment or be unexported (golint)
    • Line 22: warning: comment on exported function CreateWebHook should be of the form "CreateWebHook ..." (golint)
    • routes/operations/operations.go
    • Line 22: warning: exported type Operation should have comment or be unexported (golint)
    • Line 31: warning: exported type OperationResource should have comment or be unexported (golint)
    • Line 35: warning: comment on exported method OperationResource.Register should be of the form "Register ..." (golint)
    • routes/application/application.go
    • Line 22: warning: exported type ApplicationListEntry should have comment or be unexported (golint)
    • Line 31: warning: exported type ApplicationEntry should have comment or be unexported (golint)
    • Line 42: warning: exported type Application should have comment or be unexported (golint)
    • Line 47: warning: exported type ApplicationResource should have comment or be unexported (golint)
    • Line 51: warning: comment on exported method ApplicationResource.Register should be of the form "Register ..." (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell87%

Misspell Finds commonly misspelled English words

    • routes/router.go
    • Line 36: warning: "Occured" is a misspelling of "Occurred" (misspell)
    • Line 40: warning: "Occured" is a misspelling of "Occurred" (misspell)