Preparing report...

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

(v0.0.0-20220125142658-e279fa0cf123)

A    Great!    Found 23 issues across 29 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!


gocyclo93%

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.

    • util/utils.go
    • Line 104: warning: cyclomatic complexity 20 of function UncheckedGetOrCreateGitopsEngineInstanceByInstanceNamespaceUID() is high (> 15) (gocyclo)
    • Line 223: warning: cyclomatic complexity 18 of function UncheckedGetOrCreateGitopsEngineClusterByKubeSystemNamespaceUID() is high (> 15) (gocyclo)

golint31%

Golint is a linter for Go source code.

    • config/db/clusteraccess.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.UnsafeListAllClusterAccess should have comment or be unexported (golint)
    • Line 21: warning: exported method PostgreSQLDatabaseQueries.GetClusterAccessByPrimaryKey should have comment or be unexported (golint)
    • Line 59: warning: exported method PostgreSQLDatabaseQueries.CreateClusterAccess should have comment or be unexported (golint)
    • Line 85: warning: exported method PostgreSQLDatabaseQueries.DeleteClusterAccessById should have comment or be unexported (golint)
    • config/db/kubernetesresourcetodbresourcemapping.go
    • Line 11: warning: don't use underscores in Go names; const K8sToDBMapping_Namespace should be K8sToDBMappingNamespace (golint)
    • Line 14: warning: don't use underscores in Go names; const K8sToDBMapping_ManagedEnvironment should be K8sToDBMappingManagedEnvironment (golint)
    • Line 15: warning: don't use underscores in Go names; const K8sToDBMapping_GitopsEngineCluster should be K8sToDBMappingGitopsEngineCluster (golint)
    • Line 16: warning: don't use underscores in Go names; const K8sToDBMapping_GitopsEngineInstance should be K8sToDBMappingGitopsEngineInstance (golint)
    • Line 19: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteKubernetesResourceToDBResourceMapping should have comment or be unexported (golint)
    • Line 41: warning: exported method PostgreSQLDatabaseQueries.GetDBResourceMappingForKubernetesResource should have comment or be unexported (golint)
    • Line 81: warning: exported method PostgreSQLDatabaseQueries.CreateKubernetesResourceToDBResourceMapping should have comment or be unexported (golint)
    • config/db/operations.go
    • Line 9: warning: comment on exported method PostgreSQLDatabaseQueries.UnsafeListAllOperations should be of the form "UnsafeListAllOperations ..." (golint)
    • Line 23: warning: exported method PostgreSQLDatabaseQueries.CreateOperation should have comment or be unexported (golint)
    • Line 89: warning: exported method PostgreSQLDatabaseQueries.UncheckedGetOperationById should have comment or be unexported (golint)
    • Line 123: warning: exported method PostgreSQLDatabaseQueries.GetOperationById should have comment or be unexported (golint)
    • Line 162: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteOperationById should have comment or be unexported (golint)
    • Line 182: warning: exported method PostgreSQLDatabaseQueries.DeleteOperationById should have comment or be unexported (golint)
    • Line 207: warning: exported method PostgreSQLDatabaseQueries.ListOperationsByResourceIdAndTypeAndOwnerId should have comment or be unexported (golint)
    • config/db/syncoperation.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.UncheckedGetSyncOperationById should have comment or be unexported (golint)
    • Line 41: warning: exported method PostgreSQLDatabaseQueries.UncheckedCreateSyncOperation should have comment or be unexported (golint)
    • Line 79: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteSyncOperationById should have comment or be unexported (golint)
    • Line 103: warning: exported method PostgreSQLDatabaseQueries.UpdateSyncOperationRemoveApplicationField should have comment or be unexported (golint)
    • Line 129: warning: exported method SyncOperation.DisposeAppScoped should have comment or be unexported (golint)
    • hack/service_account.go
    • Line 21: warning: exported const ArgoCDManagerServiceAccount should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported var ArgoCDManagerNamespacePolicyRules should have comment or be unexported (golint)
    • Line 88: warning: exported function CreateServiceAccount should have comment or be unexported (golint)
    • Line 111: warning: exported function InstallServiceAccount should have comment or be unexported (golint)
    • util/log.go
    • Line 4: warning: don't use underscores in Go names; const LogLevel_Debug should be LogLevelDebug (golint)
    • Line 4: warning: exported const LogLevel_Debug should have comment (or a comment on this block) or be unexported (golint)
    • Line 8: warning: don't use underscores in Go names; const LogLevel_Warn should be LogLevelWarn (golint)
    • config/db/application.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.GetApplicationById should have comment or be unexported (golint)
    • Line 58: warning: exported method PostgreSQLDatabaseQueries.UncheckedGetApplicationById should have comment or be unexported (golint)
    • Line 91: warning: exported method PostgreSQLDatabaseQueries.CreateApplication should have comment or be unexported (golint)
    • Line 136: warning: exported method PostgreSQLDatabaseQueries.UnsafeListAllApplications should have comment or be unexported (golint)
    • Line 151: warning: exported method PostgreSQLDatabaseQueries.DeleteApplicationById should have comment or be unexported (golint)
    • Line 177: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteApplicationById should have comment or be unexported (golint)
    • Line 195: warning: exported method PostgreSQLDatabaseQueries.UncheckedCreateApplication should have comment or be unexported (golint)
    • Line 230: warning: exported method PostgreSQLDatabaseQueries.UncheckedUpdateApplication should have comment or be unexported (golint)
    • config/db/applicationstates.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.UnsafeListAllApplicationStates should have comment or be unexported (golint)
    • Line 21: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteApplicationStateById should have comment or be unexported (golint)
    • Line 39: warning: exported method PostgreSQLDatabaseQueries.UncheckedCreateApplicationState should have comment or be unexported (golint)
    • Line 64: warning: exported method PostgreSQLDatabaseQueries.UncheckedUpdateApplicationState should have comment or be unexported (golint)
    • Line 89: warning: exported method PostgreSQLDatabaseQueries.UncheckedGetApplicationStateById should have comment or be unexported (golint)
    • config/db/clusteruser.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.UnsafeListAllClusterUsers should have comment or be unexported (golint)
    • Line 21: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteClusterUserById should have comment or be unexported (golint)
    • Line 41: warning: exported method PostgreSQLDatabaseQueries.CreateClusterUser should have comment or be unexported (golint)
    • Line 77: warning: exported method PostgreSQLDatabaseQueries.GetClusterUserByUsername should have comment or be unexported (golint)
    • Line 112: warning: exported method PostgreSQLDatabaseQueries.GetClusterUserById should have comment or be unexported (golint)
    • config/db/gitopsengineinstance.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.UnsafeListAllGitopsEngineInstances should have comment or be unexported (golint)
    • Line 21: warning: exported method PostgreSQLDatabaseQueries.ListAllGitopsEngineInstancesForGitopsEngineClusterIdAndOwnerId should have comment or be unexported (golint)
    • Line 50: warning: exported method PostgreSQLDatabaseQueries.UncheckedGetGitopsEngineInstanceById should have comment or be unexported (golint)
    • Line 83: warning: exported method PostgreSQLDatabaseQueries.GetGitopsEngineInstanceById should have comment or be unexported (golint)
    • Line 124: warning: exported method PostgreSQLDatabaseQueries.CreateGitopsEngineInstance should have comment or be unexported (golint)
    • Line 166: warning: exported method PostgreSQLDatabaseQueries.DeleteGitopsEngineInstanceById should have comment or be unexported (golint)
    • Line 172: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteGitopsEngineInstanceById should have comment or be unexported (golint)
    • config/db/utils.go
    • Line 136: warning: exported method Operation.ShortString should have comment or be unexported (golint)
    • Line 146: warning: exported method Operation.LongString should have comment or be unexported (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)
    • config/db/gitopsenginecluster.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.UncheckedGetGitopsEngineClusterById should have comment or be unexported (golint)
    • Line 40: warning: exported method PostgreSQLDatabaseQueries.GetGitopsEngineClusterById should have comment or be unexported (golint)
    • Line 91: warning: exported method PostgreSQLDatabaseQueries.ListGitopsEngineClusterByCredentialId should have comment or be unexported (golint)
    • Line 140: warning: exported method PostgreSQLDatabaseQueries.CreateGitopsEngineCluster should have comment or be unexported (golint)
    • Line 175: warning: exported method PostgreSQLDatabaseQueries.UnsafeListAllGitopsEngineClusters should have comment or be unexported (golint)
    • Line 189: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteGitopsEngineClusterById should have comment or be unexported (golint)
    • config/db/managedenvironment.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.CreateManagedEnvironment should have comment or be unexported (golint)
    • Line 41: warning: exported method PostgreSQLDatabaseQueries.UnsafeListAllManagedEnvironments should have comment or be unexported (golint)
    • Line 54: warning: exported method PostgreSQLDatabaseQueries.ListManagedEnvironmentForClusterCredentialsAndOwnerId should have comment or be unexported (golint)
    • Line 81: warning: exported method PostgreSQLDatabaseQueries.UncheckedGetManagedEnvironmentById should have comment or be unexported (golint)
    • Line 114: warning: exported method PostgreSQLDatabaseQueries.GetManagedEnvironmentById should have comment or be unexported (golint)
    • Line 153: warning: exported method PostgreSQLDatabaseQueries.DeleteManagedEnvironmentById should have comment or be unexported (golint)
    • Line 177: warning: comment on exported method PostgreSQLDatabaseQueries.UncheckedDeleteManagedEnvironmentById should be of the form "UncheckedDeleteManagedEnvironmentById ..." (golint)
    • config/db/queries.go
    • Line 40: warning: exported type UnsafeDatabaseQueries should have comment or be unexported (golint)
    • Line 52: warning: exported type AllDatabaseQueries should have comment or be unexported (golint)
    • Line 57: warning: exported type DatabaseQueries should have comment or be unexported (golint)
    • Line 177: warning: exported type CloseableQueries should have comment or be unexported (golint)
    • Line 184: warning: exported type PostgreSQLDatabaseQueries should have comment or be unexported (golint)
    • Line 202: warning: exported function NewProductionPostgresDBQueries should have comment or be unexported (golint)
    • Line 218: warning: exported function NewUnsafePostgresDBQueries should have comment or be unexported (golint)
    • Line 235: warning: exported method PostgreSQLDatabaseQueries.CloseDatabase should have comment or be unexported (golint)
    • Line 249: warning: comment on exported function NewAccessDeniedError should be of the form "NewAccessDeniedError ..." (golint)
    • Line 254: warning: exported function IsAccessDeniedError should have comment or be unexported (golint)
    • Line 263: warning: exported function IsResultNotFoundError should have comment or be unexported (golint)
    • config/db/types.go
    • Line 14: warning: don't use underscores in Go names; struct field Gitopsenginecluster_id should be GitopsengineclusterID (golint)
    • Line 20: warning: don't use underscores in Go names; struct field Clustercredentials_id should be ClustercredentialsID (golint)
    • Line 29: warning: don't use underscores in Go names; struct field Gitopsengineinstance_id should be GitopsengineinstanceID (golint)
    • Line 34: warning: don't use underscores in Go names; struct field Namespace_name should be NamespaceName (golint)
    • Line 35: warning: don't use underscores in Go names; struct field Namespace_uid should be NamespaceUID (golint)
    • Line 39: warning: don't use underscores in Go names; struct field EngineCluster_id should be EngineClusterID (golint)
    • Line 47: warning: don't use underscores in Go names; struct field Managedenvironment_id should be ManagedenvironmentID (golint)
    • Line 55: warning: don't use underscores in Go names; struct field Clustercredentials_id should be ClustercredentialsID (golint)
    • Line 80: warning: don't use underscores in Go names; struct field Clustercredentials_cred_id should be ClustercredentialsCredID (golint)
    • Line 89: warning: don't use underscores in Go names; struct field Kube_config should be KubeConfig (golint)
    • Line 92: warning: don't use underscores in Go names; struct field Kube_config_context should be KubeConfigContext (golint)
    • Line 95: warning: don't use underscores in Go names; struct field Serviceaccount_bearer_token should be ServiceaccountBearerToken (golint)
    • Line 98: warning: don't use underscores in Go names; struct field Serviceaccount_ns should be ServiceaccountNs (golint)
    • Line 108: warning: don't use underscores in Go names; struct field Clusteruser_id should be ClusteruserID (golint)
    • Line 109: warning: don't use underscores in Go names; struct field User_name should be UserName (golint)
    • Line 113: warning: exported type ClusterAccess should have comment or be unexported (golint)
    • Line 120: warning: don't use underscores in Go names; struct field Clusteraccess_user_id should be ClusteraccessUserID (golint)
    • Line 124: warning: don't use underscores in Go names; struct field Clusteraccess_managed_environment_id should be ClusteraccessManagedEnvironmentID (golint)
    • Line 128: warning: don't use underscores in Go names; struct field Clusteraccess_gitops_engine_instance_id should be ClusteraccessGitopsEngineInstanceID (golint)
    • Line 135: warning: exported type OperationState should have comment or be unexported (golint)
    • Line 138: warning: don't use underscores in Go names; const OperationState_Waiting should be OperationStateWaiting (golint)
    • Line 138: warning: exported const OperationState_Waiting should have comment (or a comment on this block) or be unexported (golint)
    • Line 139: warning: don't use underscores in Go names; const OperationState_In_Progress should be OperationStateInProgress (golint)
    • Line 140: warning: don't use underscores in Go names; const OperationState_Completed should be OperationStateCompleted (golint)
    • Line 141: warning: don't use underscores in Go names; const OperationState_Failed should be OperationStateFailed (golint)
    • Line 145: warning: don't use underscores in Go names; const OperationResourceType_SyncOperation should be OperationResourceTypeSyncOperation (golint)
    • Line 145: warning: exported const OperationResourceType_SyncOperation should have comment (or a comment on this block) or be unexported (golint)
    • Line 146: warning: don't use underscores in Go names; const OperationResourceType_Application should be OperationResourceTypeApplication (golint)
    • Line 149: warning: exported type Operation should have comment or be unexported (golint)
    • Line 155: warning: don't use underscores in Go names; struct field Operation_id should be OperationID (golint)
    • Line 161: warning: don't use underscores in Go names; struct field Instance_id should be InstanceID (golint)
    • Line 164: warning: don't use underscores in Go names; struct field Resource_id should be ResourceID (golint)
    • Line 167: warning: don't use underscores in Go names; struct field Operation_owner_user_id should be OperationOwnerUserID (golint)
    • Line 176: warning: don't use underscores in Go names; struct field Resource_type should be ResourceType (golint)
    • Line 179: warning: don't use underscores in Go names; struct field Created_on should be CreatedOn (golint)
    • Line 183: warning: don't use underscores in Go names; struct field Last_state_update should be LastStateUpdate (golint)
    • Line 193: warning: don't use underscores in Go names; struct field Human_readable_state should be HumanReadableState (golint)
    • Line 196: warning: exported type Application should have comment or be unexported (golint)
    • Line 201: warning: don't use underscores in Go names; struct field Application_id should be ApplicationID (golint)
    • Line 213: warning: don't use underscores in Go names; struct field Spec_field should be SpecField (golint)
    • Line 216: warning: don't use underscores in Go names; struct field Engine_instance_inst_id should be EngineInstanceInstID (golint)
    • Line 220: warning: don't use underscores in Go names; struct field Managed_environment_id should be ManagedEnvironmentID (golint)
    • Line 223: warning: exported type ApplicationState should have comment or be unexported (golint)
    • Line 229: warning: don't use underscores in Go names; struct field Applicationstate_application_id should be ApplicationstateApplicationID (golint)
    • Line 243: warning: don't use underscores in Go names; struct field Sync_Status should be SyncStatus (golint)
    • Line 251: warning: comment on exported type DeploymentToApplicationMapping should be of the form "DeploymentToApplicationMapping ..." (with optional leading article) (golint)
    • Line 263: warning: don't use underscores in Go names; struct field Deploymenttoapplicationmapping_uid_id should be DeploymenttoapplicationmappingUIDID (golint)
    • Line 270: warning: don't use underscores in Go names; struct field Application_id should be ApplicationID (golint)
    • Line 276: warning: don't use underscores in Go names; const APICRToDatabaseMapping_ResourceType_GitOpsDeploymentSyncRun should be APICRToDatabaseMappingResourceTypeGitOpsDeploymentSyncRun (golint)
    • Line 276: warning: exported const APICRToDatabaseMapping_ResourceType_GitOpsDeploymentSyncRun should have comment (or a comment on this block) or be unexported (golint)
    • Line 278: warning: don't use underscores in Go names; const APICRToDatabaseMapping_DBRelationType_SyncOperation should be APICRToDatabaseMappingDBRelationTypeSyncOperation (golint)
    • Line 281: warning: exported type APICRToDatabaseMapping should have comment or be unexported (golint)
    • Line 299: warning: comment on exported type KubernetesToDBResourceMapping should be of the form "KubernetesToDBResourceMapping ..." (with optional leading article) (golint)
    • Line 331: warning: exported type SyncOperation should have comment or be unexported (golint)
    • Line 336: warning: don't use underscores in Go names; struct field SyncOperation_id should be SyncOperationID (golint)
    • Line 338: warning: don't use underscores in Go names; struct field Application_id should be ApplicationID (golint)
    • Line 340: warning: don't use underscores in Go names; struct field Operation_id should be OperationID (golint)
    • Line 347: warning: comment on exported type DisposableResource should be of the form "DisposableResource ..." (with optional leading article) (golint)
    • Line 352: warning: exported type AppScopedDisposableResource should have comment or be unexported (golint)
    • util/utils.go
    • Line 13: warning: comment on exported const GitOpsEngineSingleInstanceNamespace should be of the form "GitOpsEngineSingleInstanceNamespace ..." (golint)
    • Line 27: warning: exported function UncheckedGetOrCreateManagedEnvironmentByNamespaceUID should have comment or be unexported (golint)
    • Line 338: warning: exported function UncheckedGetOrCreateDeploymentToApplicationMapping should have comment or be unexported (golint)
    • config/db/apicrtodatabasemapping.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteAPICRToDatabaseMapping should have comment or be unexported (golint)
    • Line 36: warning: exported method PostgreSQLDatabaseQueries.CreateAPICRToDatabaseMapping should have comment or be unexported (golint)
    • Line 66: warning: exported method PostgreSQLDatabaseQueries.GetDatabaseMappingForAPICR should have comment or be unexported (golint)
    • Line 106: warning: exported method PostgreSQLDatabaseQueries.UncheckedListAPICRToDatabaseMappingByAPINamespaceAndName should have comment or be unexported (golint)
    • Line 145: warning: exported method APICRToDatabaseMapping.DisposeAppScoped should have comment or be unexported (golint)
    • config/db/clustercredentials.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.UnsafeListAllClusterCredentials should have comment or be unexported (golint)
    • Line 24: warning: exported method PostgreSQLDatabaseQueries.CreateClusterCredentials should have comment or be unexported (golint)
    • Line 57: warning: exported method PostgreSQLDatabaseQueries.UncheckedGetClusterCredentialsById should have comment or be unexported (golint)
    • Line 84: warning: exported method PostgreSQLDatabaseQueries.GetClusterCredentialsById should have comment or be unexported (golint)
    • Line 130: warning: exported method PostgreSQLDatabaseQueries.ListClusterCredentialsByHost should have comment or be unexported (golint)
    • Line 244: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteClusterCredentialsById should have comment or be unexported (golint)
    • config/db/deploymenttoapplicationmapping.go
    • Line 8: warning: exported method PostgreSQLDatabaseQueries.UncheckedListDeploymentToApplicationMappingByNamespaceAndName should have comment or be unexported (golint)
    • Line 43: warning: exported method PostgreSQLDatabaseQueries.UncheckedGetDeploymentToApplicationMappingByDeplId should have comment or be unexported (golint)
    • Line 80: warning: exported method PostgreSQLDatabaseQueries.UncheckedGetDeploymentToApplicationMappingByApplicationId should have comment or be unexported (golint)
    • Line 113: warning: exported method PostgreSQLDatabaseQueries.GetDeploymentToApplicationMappingByDeplId should have comment or be unexported (golint)
    • Line 163: warning: exported method PostgreSQLDatabaseQueries.DeleteDeploymentToApplicationMappingByDeplId should have comment or be unexported (golint)
    • Line 191: warning: exported method PostgreSQLDatabaseQueries.UncheckedDeleteDeploymentToApplicationMappingByDeplId should have comment or be unexported (golint)
    • Line 209: warning: exported method PostgreSQLDatabaseQueries.CreateDeploymentToApplicationMapping should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell93%

Misspell Finds commonly misspelled English words