Preparing report...

Report for github.com/Azure/aks-engine

A+    Excellent!    Found 81 issues across 322 files

Tweet

gofmt99%

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.

    • aks-engine/pkg/engine/engine_test.go
    • Line 3017: warning: cyclomatic complexity 27 of function TestGetComponentFuncMap() is high (> 15) (gocyclo)
    • Line 2272: warning: cyclomatic complexity 24 of function TestGetAddonFuncMap() is high (> 15) (gocyclo)
    • Line 83: warning: cyclomatic complexity 24 of function TestExpected() is high (> 15) (gocyclo)
    • Line 1599: warning: cyclomatic complexity 19 of function TestGetClusterAutoscalerAddonFuncMap() is high (> 15) (gocyclo)
    • aks-engine/pkg/api/addons.go
    • Line 18: warning: cyclomatic complexity 88 of function (*ContainerService).setAddonsConfig() is high (> 15) (gocyclo)
    • Line 1073: warning: cyclomatic complexity 19 of function assignDefaultAddonVals() is high (> 15) (gocyclo)
    • aks-engine/pkg/api/converterfromapi_test.go
    • Line 19: warning: cyclomatic complexity 29 of function TestConvertCloudProfileToVLabs() is high (> 15) (gocyclo)
    • Line 176: warning: cyclomatic complexity 27 of function TestConvertAzureEnvironmentSpecConfigToVLabs() is high (> 15) (gocyclo)
    • Line 822: warning: cyclomatic complexity 16 of function TestConvertComponentsToVlabs() is high (> 15) (gocyclo)
    • aks-engine/pkg/api/defaults-kubelet_test.go
    • Line 19: warning: cyclomatic complexity 27 of function TestKubeletConfigDefaults() is high (> 15) (gocyclo)
    • Line 738: warning: cyclomatic complexity 22 of function TestProtectKernelDefaults() is high (> 15) (gocyclo)
    • Line 514: warning: cyclomatic complexity 18 of function TestKubeletConfigEnableSecureKubelet() is high (> 15) (gocyclo)
    • aks-engine/pkg/engine/artifacts_test.go
    • Line 13: warning: cyclomatic complexity 115 of function TestKubernetesAddonSettingsInit() is high (> 15) (gocyclo)
    • Line 1017: warning: cyclomatic complexity 26 of function TestKubernetesComponentSettingsInit() is high (> 15) (gocyclo)
    • aks-engine/pkg/engine/transform/transform.go
    • Line 604: warning: cyclomatic complexity 40 of function (*Transformer).NormalizeResourcesForK8sAgentUpgrade() is high (> 15) (gocyclo)
    • Line 434: warning: cyclomatic complexity 30 of function (*Transformer).NormalizeResourcesForK8sMasterUpgrade() is high (> 15) (gocyclo)
    • Line 254: warning: cyclomatic complexity 30 of function (*Transformer).NormalizeForK8sVMASScalingUp() is high (> 15) (gocyclo)
    • aks-engine/pkg/operations/kubernetesupgrade/upgrader.go
    • Line 322: warning: cyclomatic complexity 42 of function (*Upgrader).upgradeAgentPools() is high (> 15) (gocyclo)
    • Line 558: warning: cyclomatic complexity 25 of function (*Upgrader).upgradeAgentScaleSets() is high (> 15) (gocyclo)
    • Line 172: warning: cyclomatic complexity 22 of function (*Upgrader).upgradeMasterNodes() is high (> 15) (gocyclo)
    • aks-engine/pkg/api/vlabs/validate.go
    • Line 1254: warning: cyclomatic complexity 84 of function (*KubernetesConfig).Validate() is high (> 15) (gocyclo)
    • Line 656: warning: cyclomatic complexity 71 of function (*Properties).validateAddons() is high (> 15) (gocyclo)
    • Line 187: warning: cyclomatic complexity 55 of function (*Properties).ValidateOrchestratorProfile() is high (> 15) (gocyclo)
    • Line 428: warning: cyclomatic complexity 51 of function (*Properties).validateAgentPoolProfiles() is high (> 15) (gocyclo)
    • Line 354: warning: cyclomatic complexity 29 of function (*Properties).validateMasterProfile() is high (> 15) (gocyclo)
    • Line 1135: warning: cyclomatic complexity 17 of function (*AgentPoolProfile).validateOrchestratorSpecificProperties() is high (> 15) (gocyclo)
    • Line 910: warning: cyclomatic complexity 17 of function (*Properties).validateServicePrincipalProfile() is high (> 15) (gocyclo)
    • Line 866: warning: cyclomatic complexity 16 of function (*Properties).validateVNET() is high (> 15) (gocyclo)
    • aks-engine/pkg/api/defaults.go
    • Line 86: warning: cyclomatic complexity 178 of function (*ContainerService).setOrchestratorDefaults() is high (> 15) (gocyclo)
    • Line 711: warning: cyclomatic complexity 34 of function (*Properties).setAgentProfileDefaults() is high (> 15) (gocyclo)
    • Line 797: warning: cyclomatic complexity 29 of function (*ContainerService).setWindowsProfileDefaults() is high (> 15) (gocyclo)
    • Line 924: warning: cyclomatic complexity 23 of function (*ContainerService).SetDefaultCerts() is high (> 15) (gocyclo)
    • aks-engine/pkg/api/defaults_test.go
    • Line 1565: warning: cyclomatic complexity 63 of function TestMasterProfileDefaults() is high (> 15) (gocyclo)
    • Line 3410: warning: cyclomatic complexity 26 of function TestSetVMSSDefaultsAndZones() is high (> 15) (gocyclo)
    • Line 1276: warning: cyclomatic complexity 24 of function TestContainerRuntime() is high (> 15) (gocyclo)
    • Line 5335: warning: cyclomatic complexity 22 of function TestImageReference() is high (> 15) (gocyclo)
    • Line 353: warning: cyclomatic complexity 22 of function TestAssignDefaultAddonVals() is high (> 15) (gocyclo)
    • Line 3915: warning: cyclomatic complexity 22 of function TestSetCustomCloudProfileDefaults() is high (> 15) (gocyclo)
    • Line 1081: warning: cyclomatic complexity 21 of function TestKubernetesImageBase() is high (> 15) (gocyclo)
    • aks-engine/pkg/api/types_test.go
    • Line 3517: warning: cyclomatic complexity 35 of function TestCloudProviderDefaults() is high (> 15) (gocyclo)
    • Line 2745: warning: cyclomatic complexity 21 of function TestWindowsProfile() is high (> 15) (gocyclo)
    • Line 803: warning: cyclomatic complexity 18 of function TestHasStorageProfile() is high (> 15) (gocyclo)
    • Line 3170: warning: cyclomatic complexity 16 of function TestIsContainerMonitoringEnabled() is high (> 15) (gocyclo)
    • aks-engine/pkg/api/convertertoapi_test.go
    • Line 122: warning: cyclomatic complexity 30 of function TestCustomCloudProfile() is high (> 15) (gocyclo)
    • Line 281: warning: cyclomatic complexity 28 of function TestConvertAzureEnvironmentSpecConfig() is high (> 15) (gocyclo)
    • Line 1067: warning: cyclomatic complexity 16 of function TestConvertComponentsToAPI() is high (> 15) (gocyclo)
    • aks-engine/pkg/api/components.go
    • Line 175: warning: cyclomatic complexity 19 of function assignDefaultComponentVals() is high (> 15) (gocyclo)
    • Line 11: warning: cyclomatic complexity 18 of function (*ContainerService).setComponentsConfig() is high (> 15) (gocyclo)
    • Line 259: warning: cyclomatic complexity 18 of function getComponentDefaultContainerImage() is high (> 15) (gocyclo)
    • aks-engine/pkg/api/common/versions_test.go
    • Line 258: warning: cyclomatic complexity 27 of function TestGetVersionsBetween() is high (> 15) (gocyclo)
    • Line 398: warning: cyclomatic complexity 19 of function Test_GetValidPatchVersion() is high (> 15) (gocyclo)
    • Line 574: warning: cyclomatic complexity 17 of function Test_RationalizeReleaseAndVersion() is high (> 15) (gocyclo)

golint87%

Golint is a linter for Go source code.

    • aks-engine/pkg/engine/armtype.go
    • Line 193: warning: comment on exported type DeploymentWithResourceGroupARM should be of the form "DeploymentWithResourceGroupARM ..." (with optional leading article) (golint)
    • aks-engine/pkg/engine/keyvaults.go
    • Line 14: warning: exported function CreateKeyVaultVMAS should have comment or be unexported (golint)
    • Line 100: warning: exported function CreateKeyVaultVMSS should have comment or be unexported (golint)
    • Line 151: warning: exported function CreateKeyVaultKey should have comment or be unexported (golint)
    • aks-engine/pkg/api/common/const.go
    • Line 69: warning: exported const LegacyControlPlaneVMPrefix should have comment or be unexported (golint)
    • Line 254: warning: exported const WindowsArtifactComponentName should have comment or be unexported (golint)
    • Line 255: warning: exported const WindowsArtifactAzureStackComponentName should have comment or be unexported (golint)
    • Line 267: warning: exported const KubernetesImageBaseTypeGCR should have comment (or a comment on this block) or be unexported (golint)
    • aks-engine/pkg/api/types.go
    • Line 787: warning: comment on exported method Properties.HasEphemeralDisks should be of the form "HasEphemeralDisks ..." (golint)
    • Line 1201: warning: exported method Properties.NeedsAuditdRules should have comment or be unexported (golint)
    • Line 1446: warning: comment on exported method AgentPoolProfile.IsEphemeral should be of the form "IsEphemeral ..." (golint)
    • Line 1827: warning: exported method KubernetesConfig.ShouldCreateNewUserAssignedIdentity should have comment or be unexported (golint)
    • aks-engine/pkg/armhelpers/httpMockClient.go
    • Line 476: warning: comment on exported method HTTPMockClient.RegisterDeployOperationFailure should be of the form "RegisterDeployOperationFailure ..." (golint)
    • Line 576: warning: comment on exported method HTTPMockClient.RegisterEnsureDefaultLogAnalyticsWorkspaceUseExisting should be of the form "RegisterEnsureDefaultLogAnalyticsWorkspaceUseExisting ..." (golint)
    • Line 606: warning: comment on exported method HTTPMockClient.RegisterEnsureDefaultLogAnalyticsWorkspaceCreateNew should be of the form "RegisterEnsureDefaultLogAnalyticsWorkspaceCreateNew ..." (golint)
    • Line 637: warning: comment on exported method HTTPMockClient.RegisterEnsureDefaultLogAnalyticsWorkspaceCreateNewInMC should be of the form "RegisterEnsureDefaultLogAnalyticsWorkspaceCreateNewInMC ..." (golint)
    • aks-engine/pkg/helpers/ssh/types.go
    • Line 10: warning: exported type RemoteFile should have comment or be unexported (golint)
    • Line 17: warning: exported function NewRemoteFile should have comment or be unexported (golint)
    • Line 26: warning: exported type AuthConfig should have comment or be unexported (golint)
    • Line 32: warning: exported type JumpBox should have comment or be unexported (golint)
    • Line 39: warning: exported type RemoteHost should have comment or be unexported (golint)
    • aks-engine/pkg/engine/transform/transform.go
    • Line 142: warning: exported method Transformer.RemoveImmutableResourceProperties should have comment or be unexported (golint)
    • Line 153: warning: exported method Transformer.RemoveJumpboxResourcesFromTemplate should have comment or be unexported (golint)
    • Line 175: warning: exported method Transformer.RemoveKMSResourcesFromTemplate should have comment or be unexported (golint)
    • aks-engine/pkg/api/common/helper.go
    • Line 443: warning: exported function GetDockerConfigTestCases should have comment or be unexported (golint)
    • Line 452: warning: exported function GetContainerdConfigTestCases should have comment or be unexported (golint)
    • aks-engine/pkg/engine/template_generator.go
    • Line 29: warning: exported type ARMTemplate should have comment or be unexported (golint)
    • Line 138: warning: exported method TemplateGenerator.GetJumpboxCustomDataJSON should have comment or be unexported (golint)
    • Line 829: warning: exported method TemplateGenerator.GenerateTemplateV2 should have comment or be unexported (golint)
    • aks-engine/pkg/api/const.go
    • Line 169: warning: comment on exported const DefaultAzureArcOnboardingAddonEnabled should be of the form "DefaultAzureArcOnboardingAddonEnabled ..." (golint)
    • Line 216: warning: comment on exported const AddonModeEnsureExists should be of the form "AddonModeEnsureExists ..." (golint)
    • Line 218: warning: comment on exported const AddonModeReconcile should be of the form "AddonModeReconcile ..." (golint)
    • Line 278: warning: exported const CloudProviderBackoffModeV2 should have comment (or a comment on this block) or be unexported (golint)
    • Line 314: warning: exported const DefaultMicrosoftAptRepositoryURL should have comment (or a comment on this block) or be unexported (golint)
    • aks-engine/pkg/armhelpers/mockclients.go
    • Line 420: warning: comment on exported method MockKubernetesClient.DeleteClusterRole should be of the form "DeleteClusterRole ..." (golint)
    • Line 468: warning: comment on exported method MockKubernetesClient.GetDaemonSet should be of the form "GetDaemonSet ..." (golint)
    • Line 703: warning: comment on exported method MockAKSEngineClient.MakeFakeVirtualMachineScaleSetVMWithGivenName should be of the form "MakeFakeVirtualMachineScaleSetVMWithGivenName ..." (golint)
    • aks-engine/pkg/armhelpers/azurestack/httpMockClient.go
    • Line 435: warning: comment on exported method HTTPMockClient.RegisterDeployOperationFailure should be of the form "RegisterDeployOperationFailure ..." (golint)
    • Line 535: warning: comment on exported method HTTPMockClient.RegisterEnsureDefaultLogAnalyticsWorkspaceUseExisting should be of the form "RegisterEnsureDefaultLogAnalyticsWorkspaceUseExisting ..." (golint)
    • Line 565: warning: comment on exported method HTTPMockClient.RegisterEnsureDefaultLogAnalyticsWorkspaceCreateNew should be of the form "RegisterEnsureDefaultLogAnalyticsWorkspaceCreateNew ..." (golint)
    • aks-engine/pkg/api/common/types.go
    • Line 6: warning: exported type ContainerdConfig should have comment or be unexported (golint)
    • Line 13: warning: exported type ContainerdCNIPlugin should have comment or be unexported (golint)
    • Line 17: warning: exported type ContainerdRuntime should have comment or be unexported (golint)
    • Line 21: warning: exported type ContainerdPlugin should have comment or be unexported (golint)
    • Line 26: warning: exported type IoContainerdGrpcV1Cri should have comment or be unexported (golint)
    • Line 32: warning: exported type Plugins should have comment or be unexported (golint)
    • Line 36: warning: exported type DockerConfig should have comment or be unexported (golint)
    • Line 46: warning: exported type LogOpts should have comment or be unexported (golint)
    • Line 51: warning: exported type DockerDaemonRuntime should have comment or be unexported (golint)
    • aks-engine/pkg/helpers/ssh.go
    • Line 14: warning: exported function SSHClient should have comment or be unexported (golint)
    • Line 30: warning: exported function SSHClientConfig should have comment or be unexported (golint)
    • Line 41: warning: exported function PublicKeyAuth should have comment or be unexported (golint)
    • aks-engine/pkg/engine/vmextensions.go
    • Line 17: warning: exported function CreateAKSBillingExtension should have comment or be unexported (golint)
    • Line 50: warning: exported function CreateCustomScriptExtension should have comment or be unexported (golint)
    • Line 158: warning: exported function CreateAgentVMASAKSBillingExtension should have comment or be unexported (golint)
    • aks-engine/pkg/api/k8s_versions.go
    • Line 54: warning: exported const KubeRBACProxyImageReference should have comment (or a comment on this block) or be unexported (golint)
    • Line 370: warning: exported function GetK8sComponentsByVersionMap should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign99%

IneffAssign detects ineffectual assignments in Go code.

    • aks-engine/test/e2e/kubernetes/kubernetes_test.go
    • Line 798: warning: ineffectual assignment to err (ineffassign)
    • Line 1007: warning: ineffectual assignment to err (ineffassign)
    • Line 1571: warning: ineffectual assignment to err (ineffassign)
    • Line 1706: warning: ineffectual assignment to err (ineffassign)
    • Line 2444: warning: ineffectual assignment to err (ineffassign)
    • Line 2463: warning: ineffectual assignment to err (ineffassign)
    • Line 2517: warning: ineffectual assignment to err (ineffassign)
    • Line 2953: warning: ineffectual assignment to err (ineffassign)
    • Line 2973: warning: ineffectual assignment to err (ineffassign)
    • Line 2996: warning: ineffectual assignment to out (ineffassign)

misspell99%

Misspell Finds commonly misspelled English words