Preparing report...

Report for github.com/nais/naiserator

A+    Excellent!    Found 67 issues across 101 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!


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.


golint34%

Golint is a linter for Go source code.

    • naiserator/pkg/resourcecreator/pod/helpers.go
    • Line 12: warning: exported function FromFilesSecretVolume should have comment or be unexported (golint)
    • Line 24: warning: exported function WithAdditionalSecret should have comment or be unexported (golint)
    • Line 29: warning: exported function WithAdditionalEnvFromSecret should have comment or be unexported (golint)
    • Line 33: warning: exported function FromFilesVolumeMount should have comment or be unexported (golint)
    • Line 45: warning: exported function EnvFromSecret should have comment or be unexported (golint)
    • Line 55: warning: exported function ResourceLimits should have comment or be unexported (golint)
    • Line 68: warning: exported function AppClientID should have comment or be unexported (golint)
    • naiserator/pkg/synchronizer/synchronizer.go
    • Line 241: warning: error should be the last type when returning multiple items (golint)
    • Line 257: warning: error should be the last type when returning multiple items (golint)
    • Line 257: warning: exported method Synchronizer.Sync should have comment or be unexported (golint)
    • Line 407: warning: exported method Synchronizer.MonitorRollout should have comment or be unexported (golint)
    • naiserator/pkg/util/strings.go
    • Line 14: warning: exported function StrTrimRight should have comment or be unexported (golint)
    • Line 22: warning: exported function StrTrimMiddle should have comment or be unexported (golint)
    • Line 34: warning: exported function GeneratePassword should have comment or be unexported (golint)
    • naiserator/pkg/test/helper.go
    • Line 12: warning: exported function EnvWrapper should have comment or be unexported (golint)
    • Line 34: warning: exported function NamedResource should have comment or be unexported (golint)
    • Line 43: warning: exported function EnvValue should have comment or be unexported (golint)
    • Line 52: warning: exported function GetVolumeByName should have comment or be unexported (golint)
    • Line 62: warning: exported function GetVolumeMountByName should have comment or be unexported (golint)
    • Line 72: warning: exported function GetContainerByName should have comment or be unexported (golint)
    • naiserator/pkg/kafka/producer.go
    • Line 12: warning: exported type Producer should have comment or be unexported (golint)
    • Line 17: warning: exported type Message should have comment or be unexported (golint)
    • Line 19: warning: exported type Interface should have comment or be unexported (golint)
    • Line 23: warning: exported function New should have comment or be unexported (golint)
    • Line 46: warning: exported method Producer.Produce should have comment or be unexported (golint)
    • naiserator/pkg/util/url.go
    • Line 16: warning: exported function ValidateUrl should have comment or be unexported (golint)
    • Line 31: warning: exported function AppendPathToIngress should have comment or be unexported (golint)
    • Line 37: warning: exported function ResolveIngressClass should have comment or be unexported (golint)
    • naiserator/pkg/controllers/application.go
    • Line 9: warning: exported type ApplicationReconciler should have comment or be unexported (golint)
    • Line 13: warning: exported function NewAppReconciler should have comment or be unexported (golint)
    • Line 21: warning: exported method ApplicationReconciler.Reconcile should have comment or be unexported (golint)
    • Line 25: warning: exported method ApplicationReconciler.SetupWithManager should have comment or be unexported (golint)
    • naiserator/pkg/test/goldenfile/goldenfile.go
    • Line 49: warning: exported type SubTest should have comment or be unexported (golint)
    • Line 57: warning: exported type Match should have comment or be unexported (golint)
    • Line 64: warning: exported type TestCase should have comment or be unexported (golint)
    • Line 193: warning: exported type CreateOperationsCallback should have comment or be unexported (golint)
    • Line 195: warning: exported function Run should have comment or be unexported (golint)
    • naiserator/pkg/util/numbers.go
    • Line 3: warning: exported function Int32p should have comment or be unexported (golint)
    • Line 7: warning: exported function Int64p should have comment or be unexported (golint)
    • Line 11: warning: exported function Intp should have comment or be unexported (golint)
    • naiserator/pkg/readonly/client.go
    • Line 14: warning: comment on exported function NewClient should be of the form "NewClient ..." (golint)
    • Line 21: warning: exported type Client should have comment or be unexported (golint)
    • Line 25: warning: exported method Client.Get should have comment or be unexported (golint)
    • Line 30: warning: exported method Client.List should have comment or be unexported (golint)
    • Line 35: warning: exported method Client.Create should have comment or be unexported (golint)
    • Line 40: warning: exported method Client.Delete should have comment or be unexported (golint)
    • Line 45: warning: exported method Client.Update should have comment or be unexported (golint)
    • Line 50: warning: exported method Client.Patch should have comment or be unexported (golint)
    • Line 55: warning: exported method Client.DeleteAllOf should have comment or be unexported (golint)
    • Line 60: warning: exported method Client.Status should have comment or be unexported (golint)
    • naiserator/pkg/resourcecreator/google/sql/user.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 22: warning: exported const GoogleSQLPasswordSuffix should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported type GoogleSqlUser should have comment or be unexported (golint)
    • Line 37: warning: exported function SetupNewGoogleSqlUser should have comment or be unexported (golint)
    • Line 45: warning: exported method GoogleSqlUser.KeyWithSuffixMatchingUser should have comment or be unexported (golint)
    • Line 71: warning: exported method GoogleSqlUser.CreateUserEnvVars should have comment or be unexported (golint)
    • Line 109: warning: exported method GoogleSqlUser.Create should have comment or be unexported (golint)
    • Line 157: warning: exported function GoogleSQLSecretName should have comment or be unexported (golint)
    • Line 182: warning: exported function MergeAndFilterSQLUsers should have comment or be unexported (golint)
    • Line 210: warning: exported function MapEnvToVars should have comment or be unexported (golint)
    • Line 217: warning: exported function AppendGoogleSQLUserSecretEnvs should have comment or be unexported (golint)
    • naiserator/updater/updater.go
    • Line 21: warning: exported function CreateOrUpdate should have comment or be unexported (golint)
    • Line 55: warning: exported function CreateOrRecreate should have comment or be unexported (golint)
    • Line 66: warning: exported function CreateIfNotExists should have comment or be unexported (golint)
    • Line 77: warning: exported function DeleteIfExists should have comment or be unexported (golint)
    • Line 88: warning: comment on exported function FindAll should be of the form "FindAll ..." (golint)
    • Line 138: warning: exported function CopyImmutable should have comment or be unexported (golint)
    • naiserator/pkg/resourcecreator/google/sql/instance.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 21: warning: exported const AvailabilityTypeRegional should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported function GoogleSqlInstance should have comment or be unexported (golint)
    • Line 76: warning: exported function CloudSqlInstanceWithDefaults should have comment or be unexported (golint)
    • Line 103: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 132: warning: exported function CreateInstance should have comment or be unexported (golint)
    • naiserator/pkg/test/deepcomp/deepcomp.go
    • Line 12: warning: exported function Compare should have comment or be unexported (golint)
    • Line 25: warning: comment on exported function Subset should be of the form "Subset ..." (golint)
    • Line 31: warning: comment on exported function Absent should be of the form "Absent ..." (golint)
    • Line 37: warning: comment on exported function Exact should be of the form "Exact ..." (golint)
    • naiserator/pkg/controllers/naisjob.go
    • Line 14: warning: exported function NewNaisjobReconciler should have comment or be unexported (golint)
    • Line 22: warning: exported method NaisjobReconciler.Reconcile should have comment or be unexported (golint)
    • Line 26: warning: exported method NaisjobReconciler.SetupWithManager should have comment or be unexported (golint)
    • naiserator/pkg/test/deepcomp/diffset.go
    • Line 11: warning: exported type MatchType should have comment or be unexported (golint)
    • Line 13: warning: exported type ErrorType should have comment or be unexported (golint)
    • Line 16: warning: exported const MatchRegex should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported type Diffset should have comment or be unexported (golint)
    • Line 31: warning: exported type Diff should have comment or be unexported (golint)
    • Line 55: warning: exported method Diffset.Filter should have comment or be unexported (golint)
    • naiserator/pkg/resourcecreator/pod/pod.go
    • Line 37: warning: exported function CreateSpec should have comment or be unexported (golint)
    • Line 119: warning: exported function CreateAppContainer should have comment or be unexported (golint)
    • Line 155: warning: exported function CreateNaisjobContainer should have comment or be unexported (golint)
    • Line 192: warning: exported function CreateAppObjectMeta should have comment or be unexported (golint)
    • Line 220: warning: exported function CreateNaisjobObjectMeta should have comment or be unexported (golint)
    • naiserator/pkg/naiserator/config/config.go
    • Line 15: warning: exported type KafkaTLS should have comment or be unexported (golint)
    • Line 23: warning: exported type Kafka should have comment or be unexported (golint)
    • Line 31: warning: exported type Log should have comment or be unexported (golint)
    • Line 36: warning: exported type Informer should have comment or be unexported (golint)
    • Line 40: warning: exported type Synchronizer should have comment or be unexported (golint)
    • Line 46: warning: exported type Features should have comment or be unexported (golint)
    • Line 58: warning: exported type Securelogs should have comment or be unexported (golint)
    • Line 63: warning: exported type Proxy should have comment or be unexported (golint)
    • Line 68: warning: exported type Vault should have comment or be unexported (golint)
    • Line 75: warning: exported type GatewayMapping should have comment or be unexported (golint)
    • Line 80: warning: exported type HostAlias should have comment or be unexported (golint)
    • Line 85: warning: exported type Ratelimit should have comment or be unexported (golint)
    • Line 90: warning: exported type ServiceHosts should have comment or be unexported (golint)
    • Line 96: warning: exported type Config should have comment or be unexported (golint)
    • Line 119: warning: exported const ApiServerIp should have comment (or a comment on this block) or be unexported (golint)
    • Line 268: warning: exported function New should have comment or be unexported (golint)
    • naiserator/pkg/scheme/listers.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 22: warning: comment on exported function GenericListers should be of the form "GenericListers ..." (golint)
    • Line 44: warning: comment on exported function GCPListers should be of the form "GCPListers ..." (golint)
    • naiserator/pkg/resourcecreator/resource/source.go
    • Line 17: warning: exported type Source should have comment or be unexported (golint)
    • Line 28: warning: exported function CreateObjectMeta should have comment or be unexported (golint)
    • Line 48: warning: comment on exported function CreateAppNamespaceHash should be of the form "CreateAppNamespaceHash ..." (golint)
    • Line 68: warning: exported function CreateEvent should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell97%

Misspell Finds commonly misspelled English words