Preparing report...

Report for github.com/ca-gip/kubi

A    Great!    Found 20 issues across 27 files

Tweet

gofmt92%

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!


gocyclo96%

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.


golint37%

Golint is a linter for Go source code.

    • kubi/pkg/apis/ca-gip/v1/types.go
    • Line 7: warning: comment on exported type NetworkPolicyConfig should be of the form "NetworkPolicyConfig ..." (with optional leading article) (golint)
    • Line 21: warning: comment on exported type NetworkPolicyConfigSpec should be of the form "NetworkPolicyConfigSpec ..." (with optional leading article) (golint)
    • Line 27: warning: exported type EgressType should have comment or be unexported (golint)
    • Line 32: warning: exported type IngressType should have comment or be unexported (golint)
    • Line 36: warning: comment on exported type NetworkPolicyConfigSpecStatus should be of the form "NetworkPolicyConfigSpecStatus ..." (with optional leading article) (golint)
    • Line 41: warning: comment on exported type NetworkPolicyConfigList should be of the form "NetworkPolicyConfigList ..." (with optional leading article) (golint)
    • Line 52: warning: comment on exported type Project should be of the form "Project ..." (with optional leading article) (golint)
    • Line 66: warning: exported type ProjectSpec should have comment or be unexported (golint)
    • Line 77: warning: exported const ProjectStatusCreated should have comment (or a comment on this block) or be unexported (golint)
    • Line 80: warning: exported type ProjectSpecStatus should have comment or be unexported (golint)
    • Line 84: warning: comment on exported type ProjectList should be of the form "ProjectList ..." (with optional leading article) (golint)
    • kubi/pkg/types/types.go
    • Line 10: warning: exported type LdapConfig should have comment or be unexported (golint)
    • Line 32: warning: exported type Config should have comment or be unexported (golint)
    • Line 49: warning: comment on exported type KubeConfig should be of the form "KubeConfig ..." (with optional leading article) (golint)
    • Line 60: warning: exported type KubeConfigCluster should have comment or be unexported (golint)
    • Line 65: warning: exported type KubeConfigClusterData should have comment or be unexported (golint)
    • Line 70: warning: exported type KubeConfigContext should have comment or be unexported (golint)
    • Line 75: warning: exported type KubeConfigContextData should have comment or be unexported (golint)
    • Line 80: warning: exported type KubeConfigUser should have comment or be unexported (golint)
    • Line 85: warning: exported type KubeConfigUserToken should have comment or be unexported (golint)
    • Line 89: warning: exported type AuthJWTClaims should have comment or be unexported (golint)
    • Line 105: warning: exported type Project should have comment or be unexported (golint)
    • Line 113: warning: exported method Project.Namespace should have comment or be unexported (golint)
    • Line 122: warning: exported type ResponseError should have comment or be unexported (golint)
    • Line 127: warning: exported type Auth should have comment or be unexported (golint)
    • kubi/internal/services/ldap.go
    • Line 12: warning: exported var DnsParser should have comment or be unexported (golint)
    • Line 14: warning: comment on exported function GetUserNamespaces should be of the form "GetUserNamespaces ..." (golint)
    • Line 28: warning: comment on exported function NamespaceParser should be of the form "NamespaceParser ..." (golint)
    • Line 51: warning: comment on exported function GetUserNamespace should be of the form "GetUserNamespace ..." (golint)
    • Line 57: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 66: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 80: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 84: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 88: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 92: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 95: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • kubi/internal/services/provisionner.go
    • Line 29: warning: comment on exported function RefreshK8SResources should be of the form "RefreshK8SResources ..." (golint)
    • Line 37: warning: comment on exported function GenerateResources should be of the form "GenerateResources ..." (golint)
    • Line 52: warning: comment on exported function GenerateProjects should be of the form "GenerateProjects ..." (golint)
    • Line 126: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 153: warning: comment on exported function GenerateUserRoleBinding should be of the form "GenerateUserRoleBinding ..." (golint)
    • Line 233: warning: exported function GenerateAppRoleBinding should have comment or be unexported (golint)
    • Line 281: warning: exported function GenerateDefaultRoleBinding should have comment or be unexported (golint)
    • Line 329: warning: comment on exported function GenerateAppServiceAccount should be of the form "GenerateAppServiceAccount ..." (golint)
    • Line 445: warning: comment on exported function WatchProjects should be of the form "WatchProjects ..." (golint)
    • Line 521: warning: comment on exported function WatchNetPolConfig should be of the form "WatchNetPolConfig ..." (golint)
    • Line 697: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • kubi/internal/services/token-provider.go
    • Line 20: warning: exported type TokenIssuer should have comment or be unexported (golint)
    • Line 30: warning: comment on exported method TokenIssuer.GenerateExtraToken should be of the form "GenerateExtraToken ..." (golint)
    • Line 42: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 69: warning: exported method TokenIssuer.GenerateUserToken should have comment or be unexported (golint)
    • Line 151: warning: exported method TokenIssuer.GenerateJWT should have comment or be unexported (golint)
    • Line 248: warning: exported method TokenIssuer.CurrentJWT should have comment or be unexported (golint)
    • Line 256: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 266: 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 272: warning: exported method TokenIssuer.VerifyToken should have comment or be unexported (golint)
    • Line 276: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 281: warning: error should be the last type when returning multiple items (golint)
    • kubi/internal/utils/logger.go
    • Line 12: warning: exported var LogErr should have comment or be unexported (golint)
    • Line 13: warning: exported var LogOther should have comment or be unexported (golint)
    • Line 15: warning: exported var Log should have comment or be unexported (golint)
    • Line 23: warning: exported type LogWrapper should have comment or be unexported (golint)
    • kubi/internal/authprovider/ldap.go
    • Line 12: warning: exported type Authenticator should have comment or be unexported (golint)
    • Line 15: warning: comment on exported function GetUserGroups should be of the form "GetUserGroups ..." (golint)
    • Line 40: warning: comment on exported function GetAllGroups should be of the form "GetAllGroups ..." (golint)
    • Line 64: warning: comment on exported function AuthenticateUser should be of the form "AuthenticateUser ..." (golint)
    • Line 189: warning: comment on exported function HasAdminAccess should be of the form "HasAdminAccess ..." (golint)
    • Line 211: warning: comment on exported function HasApplicationAccess should be of the form "HasApplicationAccess ..." (golint)
    • Line 238: warning: comment on exported function HasViewerAccess should be of the form "HasViewerAccess ..." (golint)
    • Line 282: warning: comment on exported function HasServiceAccess should be of the form "HasServiceAccess ..." (golint)
    • Line 307: warning: comment on exported function HasOpsAccess should be of the form "HasOpsAccess ..." (golint)
    • kubi/internal/utils/config.go
    • Line 21: warning: exported var Config should have comment or be unexported (golint)
    • Line 23: warning: comment on exported function MakeConfig should be of the form "MakeConfig ..." (golint)
    • Line 175: warning: comment on exported var DefaultWatchOptionModifier should be of the form "DefaultWatchOptionModifier ..." (golint)
    • kubi/internal/utils/helpers.go
    • Line 5: warning: exported function IsEmpty should have comment or be unexported (golint)
    • Line 9: warning: comment on exported function Check should be of the form "Check ..." (golint)
    • Line 16: warning: exported function Checkf should have comment or be unexported (golint)
    • Line 34: warning: exported function AppendIfMissing should have comment or be unexported (golint)
    • Line 43: warning: exported function Union should have comment or be unexported (golint)
    • kubi/internal/utils/prometheus.go
    • Line 8: warning: exported var TokenCounter should have comment or be unexported (golint)
    • Line 13: warning: exported var Histogram should have comment or be unexported (golint)
    • Line 19: warning: exported var ProjectCreation should have comment or be unexported (golint)
    • Line 24: warning: exported var NamespaceCreation should have comment or be unexported (golint)
    • Line 29: warning: exported var RoleBindingsCreation should have comment or be unexported (golint)
    • Line 34: warning: exported var ServiceAccountCreation should have comment or be unexported (golint)
    • Line 39: warning: exported var NetworkPolicyCreation should have comment or be unexported (golint)
    • kubi/internal/utils/constants.go
    • Line 4: warning: comment on exported const ECDSAPublicPath should be of the form "ECDSAPublicPath ..." (golint)
    • Line 6: warning: exported const ECDSAKeyPath should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported const Empty should have comment (or a comment on this block) or be unexported (golint)
    • Line 57: warning: exported var BlacklistedNamespaces should have comment or be unexported (golint)
    • Line 66: warning: exported var WhitelistedRoles should have comment or be unexported (golint)
    • Line 72: warning: exported var AllEnvironments should have comment or be unexported (golint)
    • Line 84: warning: exported var LdapMapping should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign92%

IneffAssign detects ineffectual assignments in Go code.

    • /home/shawn/mygo/src/github.com/gojp/goreportcard/_repos/src/github.com/ca-gip/kubi/internal/services/provisionner.go
    • Line 10: warning: no required module provides package github.com/ca-gip/kubi/pkg/generated/clientset/versioned; to add it: (ineffassign)
    • Line 10: warning: could not import github.com/ca-gip/kubi/pkg/generated/clientset/versioned (invalid package name: "") (ineffassign)
    • Line 10: warning: no required module provides package github.com/ca-gip/kubi/pkg/generated/clientset/versioned; to add it: (ineffassign)
    • Line 10: warning: could not import github.com/ca-gip/kubi/pkg/generated/clientset/versioned (invalid package name: "") (ineffassign)
    • Line 10: warning: no required module provides package github.com/ca-gip/kubi/pkg/generated/clientset/versioned; to add it: (ineffassign)
    • Line 10: warning: could not import github.com/ca-gip/kubi/pkg/generated/clientset/versioned (invalid package name: "") (ineffassign)
    • kubi/internal/services/provisionner.go
    • Line 10: warning: no required module provides package github.com/ca-gip/kubi/pkg/generated/clientset/versioned; to add it: (ineffassign)
    • Line 10: warning: could not import github.com/ca-gip/kubi/pkg/generated/clientset/versioned (invalid package name: "") (ineffassign)

misspell96%

Misspell Finds commonly misspelled English words