Preparing report...

Report for github.com/CS-SI/SafeScale/v21

(v21.11.0)

A+    Excellent!    Found 80 issues across 503 files

Tweet

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!


gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

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.

    • lib/server/resources/operations/converters/others.go
    • Line 298: warning: cyclomatic complexity 41 of function (*sizingToken).Validate() is high (> 15) (gocyclo)
    • Line 83: warning: cyclomatic complexity 31 of function HostSizingRequirementsFromStringToAbstract() is high (> 15) (gocyclo)
    • Line 453: warning: cyclomatic complexity 18 of function parseSizingString() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/aws/compute.go
    • Line 475: warning: cyclomatic complexity 33 of function (stack).CreateHost() is high (> 15) (gocyclo)
    • Line 973: warning: cyclomatic complexity 26 of function (stack).DeleteHost() is high (> 15) (gocyclo)
    • Line 775: warning: cyclomatic complexity 20 of function (stack).inspectInstance() is high (> 15) (gocyclo)
    • Line 1310: warning: cyclomatic complexity 16 of function (stack).UnbindSecurityGroupFromHost() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/aws/network.go
    • Line 62: warning: cyclomatic complexity 27 of function (stack).CreateNetwork() is high (> 15) (gocyclo)
    • Line 278: warning: cyclomatic complexity 20 of function (stack).DeleteNetwork() is high (> 15) (gocyclo)
    • Line 385: warning: cyclomatic complexity 17 of function (stack).CreateSubnet() is high (> 15) (gocyclo)
    • lib/client/ssh.go
    • Line 198: warning: cyclomatic complexity 43 of function (ssh).Copy() is high (> 15) (gocyclo)
    • Line 52: warning: cyclomatic complexity 16 of function (ssh).Run() is high (> 15) (gocyclo)
    • lib/utils/concurrency/task.go
    • Line 984: warning: cyclomatic complexity 24 of function (*task).Wait() is high (> 15) (gocyclo)
    • Line 1164: warning: cyclomatic complexity 21 of function (*task).WaitFor() is high (> 15) (gocyclo)
    • Line 241: warning: cyclomatic complexity 17 of function newTask() is high (> 15) (gocyclo)
    • lib/server/resources/operations/volume.go
    • Line 541: warning: cyclomatic complexity 72 of function (*volume).Attach() is high (> 15) (gocyclo)
    • Line 1015: warning: cyclomatic complexity 46 of function (*volume).Detach() is high (> 15) (gocyclo)
    • Line 430: warning: cyclomatic complexity 20 of function (*volume).Create() is high (> 15) (gocyclo)
    • Line 343: warning: cyclomatic complexity 17 of function (*volume).Delete() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/openstack/compute.go
    • Line 651: warning: cyclomatic complexity 47 of function (stack).CreateHost() is high (> 15) (gocyclo)
    • Line 1322: warning: cyclomatic complexity 32 of function (stack).DeleteHost() is high (> 15) (gocyclo)
    • Line 1127: warning: cyclomatic complexity 20 of function (stack).WaitHostState() is high (> 15) (gocyclo)
    • Line 497: warning: cyclomatic complexity 19 of function (stack).complementHost() is high (> 15) (gocyclo)
    • lib/server/resources/operations/clustertasks.go
    • Line 885: warning: cyclomatic complexity 73 of function (*Cluster).createHostResources() is high (> 15) (gocyclo)
    • Line 55: warning: cyclomatic complexity 44 of function (*Cluster).taskCreateCluster() is high (> 15) (gocyclo)
    • Line 641: warning: cyclomatic complexity 43 of function (*Cluster).createNetworkingResources() is high (> 15) (gocyclo)
    • Line 2291: warning: cyclomatic complexity 40 of function (*Cluster).taskCreateNode() is high (> 15) (gocyclo)
    • Line 1726: warning: cyclomatic complexity 36 of function (*Cluster).taskCreateMaster() is high (> 15) (gocyclo)
    • Line 465: warning: cyclomatic complexity 32 of function (*Cluster).determineSizingRequirements() is high (> 15) (gocyclo)
    • Line 1996: warning: cyclomatic complexity 23 of function (*Cluster).taskConfigureMasters() is high (> 15) (gocyclo)
    • Line 1353: warning: cyclomatic complexity 21 of function complementSizingRequirements() is high (> 15) (gocyclo)
    • Line 2571: warning: cyclomatic complexity 19 of function (*Cluster).taskConfigureNodes() is high (> 15) (gocyclo)
    • Line 1623: warning: cyclomatic complexity 17 of function (*Cluster).taskCreateMasters() is high (> 15) (gocyclo)
    • Line 2814: warning: cyclomatic complexity 17 of function (*Cluster).taskDeleteNode() is high (> 15) (gocyclo)
    • lib/server/resources/operations/metadatamaintenance/upgrade/tov21_05_0.go
    • Line 153: warning: cyclomatic complexity 57 of function (toV21_05_0).upgradeNetworkMetadataIfNeeded() is high (> 15) (gocyclo)
    • Line 512: warning: cyclomatic complexity 37 of function (toV21_05_0).upgradeHostMetadataIfNeeded() is high (> 15) (gocyclo)
    • Line 779: warning: cyclomatic complexity 27 of function (toV21_05_0).upgradeClusterMetadataIfNeeded() is high (> 15) (gocyclo)
    • Line 1411: warning: cyclomatic complexity 18 of function (toV21_05_0).cleanupDeprecatedClusterMetadata() is high (> 15) (gocyclo)
    • Line 1505: warning: cyclomatic complexity 16 of function (toV21_05_0).updateSecurityGroupBonds() is high (> 15) (gocyclo)
    • Line 1116: warning: cyclomatic complexity 16 of function (toV21_05_0).upgradeClusterNetworkPropertyIfNeeded() is high (> 15) (gocyclo)
    • lib/server/resources/operations/securitygroup.go
    • Line 313: warning: cyclomatic complexity 32 of function (*SecurityGroup).Create() is high (> 15) (gocyclo)
    • Line 655: warning: cyclomatic complexity 24 of function (*SecurityGroup).unbindFromSubnets() is high (> 15) (gocyclo)
    • Line 1325: warning: cyclomatic complexity 20 of function (*SecurityGroup).BindToSubnet() is high (> 15) (gocyclo)
    • Line 1540: warning: cyclomatic complexity 16 of function (*SecurityGroup).unbindFromSubnetHosts() is high (> 15) (gocyclo)
    • Line 574: warning: cyclomatic complexity 16 of function (*SecurityGroup).unbindFromHosts() is high (> 15) (gocyclo)
    • lib/server/resources/operations/host.go
    • Line 2369: warning: cyclomatic complexity 73 of function (*Host).RelaxedDeleteHost() is high (> 15) (gocyclo)
    • Line 813: warning: cyclomatic complexity 70 of function (*Host).Create() is high (> 15) (gocyclo)
    • Line 1282: warning: cyclomatic complexity 43 of function (*Host).setSecurityGroups() is high (> 15) (gocyclo)
    • Line 212: warning: cyclomatic complexity 28 of function (*Host).updateCachedInformation() is high (> 15) (gocyclo)
    • Line 1970: warning: cyclomatic complexity 26 of function (*Host).finalizeProvisioning() is high (> 15) (gocyclo)
    • Line 2150: warning: cyclomatic complexity 24 of function createSingleHostNetworking() is high (> 15) (gocyclo)
    • Line 3980: warning: cyclomatic complexity 21 of function (*Host).DisableSecurityGroup() is high (> 15) (gocyclo)
    • Line 3871: warning: cyclomatic complexity 21 of function (*Host).EnableSecurityGroup() is high (> 15) (gocyclo)
    • Line 580: warning: cyclomatic complexity 20 of function (*Host).unsafeReload() is high (> 15) (gocyclo)
    • Line 681: warning: cyclomatic complexity 20 of function (*Host).Reload() is high (> 15) (gocyclo)
    • Line 1745: warning: cyclomatic complexity 20 of function (*Host).waitInstallPhase() is high (> 15) (gocyclo)
    • Line 3742: warning: cyclomatic complexity 18 of function (*Host).UnbindSecurityGroup() is high (> 15) (gocyclo)
    • Line 3009: warning: cyclomatic complexity 16 of function (*Host).Start() is high (> 15) (gocyclo)
    • Line 3657: warning: cyclomatic complexity 16 of function (*Host).BindSecurityGroup() is high (> 15) (gocyclo)
    • Line 3099: warning: cyclomatic complexity 16 of function (*Host).Stop() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/aws/rpc.go
    • Line 1547: warning: cyclomatic complexity 25 of function (stack).rpcRunInstance() is high (> 15) (gocyclo)
    • Line 1735: warning: cyclomatic complexity 23 of function (stack).rpcTerminateInstance() is high (> 15) (gocyclo)
    • lib/utils/concurrency/taskgroup.go
    • Line 353: warning: cyclomatic complexity 23 of function (*taskGroup).WaitGroup() is high (> 15) (gocyclo)
    • Line 657: warning: cyclomatic complexity 20 of function (*taskGroup).WaitGroupFor() is high (> 15) (gocyclo)
    • Line 238: warning: cyclomatic complexity 20 of function (*taskGroup).StartWithTimeout() is high (> 15) (gocyclo)
    • Line 100: warning: cyclomatic complexity 19 of function newTaskGroup() is high (> 15) (gocyclo)
    • Line 557: warning: cyclomatic complexity 18 of function (*taskGroup).TryWaitGroup() is high (> 15) (gocyclo)
    • lib/utils/net/retry.go
    • Line 94: warning: cyclomatic complexity 19 of function normalizeErrorAndCheckIfRetriable() is high (> 15) (gocyclo)
    • Line 170: warning: cyclomatic complexity 16 of function oldNormalizeErrorAndCheckIfRetriable() is high (> 15) (gocyclo)
    • lib/server/iaas/factory.go
    • Line 508: warning: cyclomatic complexity 50 of function initMetadataLocationConfig() is high (> 15) (gocyclo)
    • Line 73: warning: cyclomatic complexity 37 of function UseService() is high (> 15) (gocyclo)
    • Line 376: warning: cyclomatic complexity 30 of function initObjectStorageLocationConfig() is high (> 15) (gocyclo)
    • lib/server/resources/operations/securitygroupunsafe.go
    • Line 38: warning: cyclomatic complexity 30 of function (*SecurityGroup).unsafeDelete() is high (> 15) (gocyclo)
    • Line 325: warning: cyclomatic complexity 19 of function (*SecurityGroup).unsafeBindToSubnet() is high (> 15) (gocyclo)
    • Line 413: warning: cyclomatic complexity 17 of function (*SecurityGroup).unsafeBindToHost() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/gcp/rpc.go
    • Line 1409: warning: cyclomatic complexity 22 of function (stack).rpcCreateExternalAddress() is high (> 15) (gocyclo)
    • Line 1165: warning: cyclomatic complexity 20 of function (stack).rpcCreateInstance() is high (> 15) (gocyclo)
    • Line 1928: warning: cyclomatic complexity 19 of function (stack).rpcRemoveTagsFromInstance() is high (> 15) (gocyclo)
    • Line 1851: warning: cyclomatic complexity 18 of function (stack).rpcAddTagsToInstance() is high (> 15) (gocyclo)
    • Line 439: warning: cyclomatic complexity 17 of function (stack).rpcCreateFirewallRule() is high (> 15) (gocyclo)
    • Line 515: warning: cyclomatic complexity 16 of function (stack).rpcListFirewallRules() is high (> 15) (gocyclo)
    • lib/server/handlers/ssh.go
    • Line 77: warning: cyclomatic complexity 37 of function (*sshHandler).GetConfig() is high (> 15) (gocyclo)
    • Line 434: warning: cyclomatic complexity 27 of function (*sshHandler).Copy() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/huaweicloud/error.go
    • Line 38: warning: cyclomatic complexity 36 of function NormalizeError() is high (> 15) (gocyclo)
    • Line 298: warning: cyclomatic complexity 16 of function reduceHuaweiAPIErrors() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 16 of function reduceOpenstackError() is high (> 15) (gocyclo)
    • lib/utils/retry/action.go
    • Line 596: warning: cyclomatic complexity 26 of function (action).loopWithHardTimeout() is high (> 15) (gocyclo)
    • Line 498: warning: cyclomatic complexity 20 of function (action).loopWithSoftTimeout() is high (> 15) (gocyclo)
    • lib/server/resources/operations/cluster.go
    • Line 2417: warning: cyclomatic complexity 59 of function (*Cluster).delete() is high (> 15) (gocyclo)
    • Line 589: warning: cyclomatic complexity 51 of function (*Cluster).Start() is high (> 15) (gocyclo)
    • Line 2951: warning: cyclomatic complexity 47 of function (*Cluster).unsafeUpdateClusterInventory() is high (> 15) (gocyclo)
    • Line 865: warning: cyclomatic complexity 46 of function (*Cluster).Stop() is high (> 15) (gocyclo)
    • Line 1108: warning: cyclomatic complexity 38 of function (*Cluster).AddNodes() is high (> 15) (gocyclo)
    • Line 3523: warning: cyclomatic complexity 28 of function (*Cluster).Shrink() is high (> 15) (gocyclo)
    • Line 2243: warning: cyclomatic complexity 24 of function (*Cluster).deleteNode() is high (> 15) (gocyclo)
    • Line 3390: warning: cyclomatic complexity 21 of function (*Cluster).ToProtocol() is high (> 15) (gocyclo)
    • Line 1313: warning: cyclomatic complexity 20 of function complementHostDefinition() is high (> 15) (gocyclo)
    • Line 1355: warning: cyclomatic complexity 17 of function (*Cluster).DeleteSpecificNode() is high (> 15) (gocyclo)
    • Line 2125: warning: cyclomatic complexity 17 of function (*Cluster).deleteMaster() is high (> 15) (gocyclo)
    • lib/server/resources/operations/installstep.go
    • Line 108: warning: cyclomatic complexity 46 of function (stepTargets).parse() is high (> 15) (gocyclo)
    • Line 463: warning: cyclomatic complexity 27 of function (*step).taskRunOnHost() is high (> 15) (gocyclo)
    • Line 319: warning: cyclomatic complexity 19 of function (*step).loopConcurrentlyOnHosts() is high (> 15) (gocyclo)
    • lib/server/listeners/host.go
    • Line 267: warning: cyclomatic complexity 27 of function (*HostListener).Create() is high (> 15) (gocyclo)
    • Line 412: warning: cyclomatic complexity 17 of function (*HostListener).Resize() is high (> 15) (gocyclo)
    • lib/server/resources/operations/bucket.go
    • Line 505: warning: cyclomatic complexity 31 of function (*bucket).Mount() is high (> 15) (gocyclo)
    • Line 671: warning: cyclomatic complexity 19 of function (*bucket).Unmount() is high (> 15) (gocyclo)
    • Line 346: warning: cyclomatic complexity 18 of function (*bucket).Create() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/huaweicloud/compute.go
    • Line 416: warning: cyclomatic complexity 51 of function (stack).CreateHost() is high (> 15) (gocyclo)
    • Line 1142: warning: cyclomatic complexity 24 of function (stack).DeleteHost() is high (> 15) (gocyclo)
    • Line 932: warning: cyclomatic complexity 20 of function (stack).complementHost() is high (> 15) (gocyclo)
    • lib/server/handlers/tenant.go
    • Line 305: warning: cyclomatic complexity 27 of function (*tenantHandler).Scan() is high (> 15) (gocyclo)
    • Line 164: warning: cyclomatic complexity 24 of function (*tenantHandler).Inspect() is high (> 15) (gocyclo)
    • lib/utils/concurrency/taskgroup_waitfor_abort_test.go
    • Line 492: warning: cyclomatic complexity 36 of function TestAbortThingsThatActuallyTakeTimeCleaningUpAndFailWhenWeAlreadyStartedWaitingFor() is high (> 15) (gocyclo)
    • Line 836: warning: cyclomatic complexity 27 of function TestAbortAlreadyFinishedSuccessfullyThingsThenWaitFor() is high (> 15) (gocyclo)
    • Line 186: warning: cyclomatic complexity 26 of function TestAbortThingsThatActuallyTakeTimeCleaningUpAndMayPanicWhenWeAlreadyStartedWaitingFor() is high (> 15) (gocyclo)
    • Line 353: warning: cyclomatic complexity 24 of function TestThingsThatActuallyTakeTimeCleaningUpAndMayPanicWhenWeAlreadyStartedWaitingFor() is high (> 15) (gocyclo)
    • Line 701: warning: cyclomatic complexity 20 of function TestAbortThingsThatActuallyTakeTimeCleaningUpAbortAndWaitForLater() is high (> 15) (gocyclo)
    • Line 42: warning: cyclomatic complexity 19 of function TestAbortThingsThatActuallyTakeTimeCleaningUpWhenWeAlreadyStartedWaitingFor() is high (> 15) (gocyclo)
    • lib/server/resources/operations/subnet.go
    • Line 1157: warning: cyclomatic complexity 35 of function (*Subnet).Delete() is high (> 15) (gocyclo)
    • Line 161: warning: cyclomatic complexity 30 of function LoadSubnet() is high (> 15) (gocyclo)
    • Line 814: warning: cyclomatic complexity 27 of function (*Subnet).AttachHost() is high (> 15) (gocyclo)
    • Line 1841: warning: cyclomatic complexity 25 of function (*Subnet).EnableSecurityGroup() is high (> 15) (gocyclo)
    • Line 1966: warning: cyclomatic complexity 22 of function (*Subnet).DisableSecurityGroup() is high (> 15) (gocyclo)
    • Line 1677: warning: cyclomatic complexity 20 of function (*Subnet).BindSecurityGroup() is high (> 15) (gocyclo)
    • lib/server/resources/operations/clusterinstall.go
    • Line 417: warning: cyclomatic complexity 25 of function (*Cluster).ExecuteScript() is high (> 15) (gocyclo)
    • Line 106: warning: cyclomatic complexity 23 of function (*Cluster).ComplementFeatureParameters() is high (> 15) (gocyclo)
    • Line 529: warning: cyclomatic complexity 17 of function (*Cluster).installNodeRequirements() is high (> 15) (gocyclo)
    • lib/system/ssh.go
    • Line 617: warning: cyclomatic complexity 31 of function (*SSHCommand).taskExecute() is high (> 15) (gocyclo)
    • Line 1059: warning: cyclomatic complexity 23 of function (*SSHConfig).WaitServerReady() is high (> 15) (gocyclo)
    • Line 535: warning: cyclomatic complexity 16 of function (*SSHCommand).RunWithTimeout() is high (> 15) (gocyclo)
    • lib/utils/concurrency/taskgroup_wait_abort_test.go
    • Line 533: warning: cyclomatic complexity 35 of function TestAbortThingsThatActuallyTakeTimeCleaningUpAndFailWhenWeAlreadyStartedWaiting() is high (> 15) (gocyclo)
    • Line 204: warning: cyclomatic complexity 27 of function TestAbortThingsThatActuallyTakeTimeCleaningUpAndMayPanicWhenWeAlreadyStartedWaiting() is high (> 15) (gocyclo)
    • Line 383: warning: cyclomatic complexity 24 of function TestThingsThatActuallyTakeTimeCleaningUpAndMayPanicWhenWeAlreadyStartedWaiting() is high (> 15) (gocyclo)
    • Line 42: warning: cyclomatic complexity 22 of function TestAbortThingsThatActuallyTakeTimeCleaningUpWhenWeAlreadyStartedWaiting() is high (> 15) (gocyclo)
    • Line 742: warning: cyclomatic complexity 21 of function TestAbortThingsThatActuallyTakeTimeCleaningUpAbortAndWaitLater() is high (> 15) (gocyclo)
    • Line 886: warning: cyclomatic complexity 19 of function TestAbortAlreadyFinishedSuccessfullyThingsThenWait() is high (> 15) (gocyclo)
    • lib/server/listeners/network.go
    • Line 48: warning: cyclomatic complexity 23 of function (*NetworkListener).Create() is high (> 15) (gocyclo)
    • Line 266: warning: cyclomatic complexity 18 of function (*NetworkListener).Delete() is high (> 15) (gocyclo)
    • lib/server/listeners/feature.go
    • Line 128: warning: cyclomatic complexity 21 of function (*FeatureListener).Check() is high (> 15) (gocyclo)
    • Line 319: warning: cyclomatic complexity 17 of function (*FeatureListener).Remove() is high (> 15) (gocyclo)
    • Line 237: warning: cyclomatic complexity 17 of function (*FeatureListener).Add() is high (> 15) (gocyclo)
    • lib/server/resources/operations/share.go
    • Line 683: warning: cyclomatic complexity 48 of function (*Share).Mount() is high (> 15) (gocyclo)
    • Line 342: warning: cyclomatic complexity 45 of function (*Share).Create() is high (> 15) (gocyclo)
    • Line 1104: warning: cyclomatic complexity 21 of function (*Share).Delete() is high (> 15) (gocyclo)
    • Line 959: warning: cyclomatic complexity 21 of function (*Share).Unmount() is high (> 15) (gocyclo)
    • lib/server/resources/operations/installworker.go
    • Line 1020: warning: cyclomatic complexity 39 of function (*worker).setReverseProxy() is high (> 15) (gocyclo)
    • Line 688: warning: cyclomatic complexity 38 of function (*worker).taskLaunchStep() is high (> 15) (gocyclo)
    • Line 1444: warning: cyclomatic complexity 31 of function (*worker).setNetworkingSecurity() is high (> 15) (gocyclo)
    • Line 501: warning: cyclomatic complexity 31 of function (*worker).Proceed() is high (> 15) (gocyclo)
    • Line 1284: warning: cyclomatic complexity 19 of function (*worker).identifyHosts() is high (> 15) (gocyclo)
    • lib/server/resources/operations/metadatacore.go
    • Line 734: warning: cyclomatic complexity 21 of function (*MetadataCore).Delete() is high (> 15) (gocyclo)
    • Line 627: warning: cyclomatic complexity 17 of function (*MetadataCore).reload() is high (> 15) (gocyclo)
    • Line 233: warning: cyclomatic complexity 16 of function (*MetadataCore).Alter() is high (> 15) (gocyclo)
    • lib/server/resources/operations/feature.go
    • Line 64: warning: cyclomatic complexity 21 of function ListFeatures() is high (> 15) (gocyclo)
    • Line 493: warning: cyclomatic complexity 17 of function (*Feature).Add() is high (> 15) (gocyclo)
    • Line 356: warning: cyclomatic complexity 16 of function (*Feature).Check() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!