Preparing report...

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

(v22.0.0-20220801093626-73854513e6b5)

A+    Excellent!    Found 90 issues across 687 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!


gocyclo86%

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/listeners/feature.go
    • Line 276: warning: cyclomatic complexity 19 of function (*FeatureListener).Check() is high (> 15) (gocyclo)
    • Line 199: warning: cyclomatic complexity 16 of function (*FeatureListener).Export() is high (> 15) (gocyclo)
    • Line 46: warning: cyclomatic complexity 16 of function (*FeatureListener).List() is high (> 15) (gocyclo)
    • lib/server/handlers/tenant.go
    • Line 308: warning: cyclomatic complexity 28 of function (*tenantHandler).Scan() is high (> 15) (gocyclo)
    • Line 165: warning: cyclomatic complexity 24 of function (*tenantHandler).Inspect() 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/resources/operations/metadatacore.go
    • Line 826: warning: cyclomatic complexity 20 of function (*MetadataCore).Delete() is high (> 15) (gocyclo)
    • Line 710: warning: cyclomatic complexity 20 of function (*MetadataCore).unsafeReload() is high (> 15) (gocyclo)
    • Line 242: warning: cyclomatic complexity 17 of function (*MetadataCore).Alter() is high (> 15) (gocyclo)
    • Line 404: warning: cyclomatic complexity 17 of function (*MetadataCore).Read() is high (> 15) (gocyclo)
    • lib/server/listeners/network.go
    • Line 49: warning: cyclomatic complexity 23 of function (*NetworkListener).Create() is high (> 15) (gocyclo)
    • Line 252: warning: cyclomatic complexity 18 of function (*NetworkListener).Delete() is high (> 15) (gocyclo)
    • lib/server/iaas/factory.go
    • Line 542: warning: cyclomatic complexity 50 of function initMetadataLocationConfig() is high (> 15) (gocyclo)
    • Line 72: warning: cyclomatic complexity 40 of function UseService() is high (> 15) (gocyclo)
    • Line 385: warning: cyclomatic complexity 39 of function initObjectStorageLocationConfig() is high (> 15) (gocyclo)
    • lib/server/handlers/ssh.go
    • Line 80: warning: cyclomatic complexity 40 of function (*sshHandler).GetConfig() is high (> 15) (gocyclo)
    • Line 502: warning: cyclomatic complexity 31 of function (*sshHandler).Copy() is high (> 15) (gocyclo)
    • lib/server/resources/operations/converters/others.go
    • Line 315: warning: cyclomatic complexity 41 of function (*sizingToken).Validate() is high (> 15) (gocyclo)
    • Line 83: warning: cyclomatic complexity 33 of function HostSizingRequirementsFromStringToAbstract() is high (> 15) (gocyclo)
    • Line 503: warning: cyclomatic complexity 22 of function newParseSizingString() is high (> 15) (gocyclo)
    • lib/utils/fail/events.go
    • Line 159: warning: cyclomatic complexity 29 of function OnPanic() is high (> 15) (gocyclo)
    • Line 230: warning: cyclomatic complexity 29 of function SilentOnPanic() 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 1019: warning: cyclomatic complexity 33 of function (*Subnet).Delete() is high (> 15) (gocyclo)
    • Line 134: warning: cyclomatic complexity 26 of function LoadSubnet() is high (> 15) (gocyclo)
    • Line 738: warning: cyclomatic complexity 22 of function (*Subnet).AttachHost() is high (> 15) (gocyclo)
    • Line 1688: warning: cyclomatic complexity 19 of function (*Subnet).EnableSecurityGroup() is high (> 15) (gocyclo)
    • Line 1275: warning: cyclomatic complexity 18 of function (*Subnet).deleteGateways() is high (> 15) (gocyclo)
    • Line 1791: warning: cyclomatic complexity 17 of function (*Subnet).DisableSecurityGroup() is high (> 15) (gocyclo)
    • lib/utils/net/retry.go
    • Line 131: warning: cyclomatic complexity 23 of function normalizeErrorAndCheckIfRetriable() is high (> 15) (gocyclo)
    • Line 218: warning: cyclomatic complexity 16 of function oldNormalizeErrorAndCheckIfRetriable() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/huaweicloud/compute.go
    • Line 418: warning: cyclomatic complexity 57 of function (stack).CreateHost() is high (> 15) (gocyclo)
    • Line 1249: warning: cyclomatic complexity 25 of function (stack).DeleteHost() is high (> 15) (gocyclo)
    • Line 1039: warning: cyclomatic complexity 20 of function (stack).complementHost() is high (> 15) (gocyclo)
    • lib/server/resources/operations/metadatamaintenance/upgrade/tov21_05_0.go
    • Line 157: warning: cyclomatic complexity 57 of function (toV21_05_0).upgradeNetworkMetadataIfNeeded() is high (> 15) (gocyclo)
    • Line 506: warning: cyclomatic complexity 37 of function (toV21_05_0).upgradeHostMetadataIfNeeded() is high (> 15) (gocyclo)
    • Line 773: warning: cyclomatic complexity 26 of function (toV21_05_0).upgradeClusterMetadataIfNeeded() is high (> 15) (gocyclo)
    • Line 1412: warning: cyclomatic complexity 18 of function (toV21_05_0).cleanupDeprecatedClusterMetadata() is high (> 15) (gocyclo)
    • Line 1507: warning: cyclomatic complexity 16 of function (toV21_05_0).updateSecurityGroupBonds() is high (> 15) (gocyclo)
    • Line 1113: warning: cyclomatic complexity 16 of function (toV21_05_0).upgradeClusterNetworkPropertyIfNeeded() is high (> 15) (gocyclo)
    • lib/server/resources/operations/installworker.go
    • Line 763: warning: cyclomatic complexity 43 of function (*worker).taskLaunchStep() is high (> 15) (gocyclo)
    • Line 1120: warning: cyclomatic complexity 39 of function (*worker).setReverseProxy() is high (> 15) (gocyclo)
    • Line 1534: warning: cyclomatic complexity 30 of function (*worker).setNetworkingSecurity() is high (> 15) (gocyclo)
    • Line 556: warning: cyclomatic complexity 29 of function (*worker).Proceed() is high (> 15) (gocyclo)
    • Line 1374: warning: cyclomatic complexity 19 of function (*worker).identifyHosts() is high (> 15) (gocyclo)
    • Line 381: warning: cyclomatic complexity 18 of function (*worker).identifyAvailableGateway() is high (> 15) (gocyclo)
    • lib/system/ssh/bycli/command_line_based_ssh.go
    • Line 675: warning: cyclomatic complexity 31 of function (*CliCommand).taskExecute() is high (> 15) (gocyclo)
    • Line 1127: warning: cyclomatic complexity 19 of function (*Profile).WaitServerReady() is high (> 15) (gocyclo)
    • Line 846: warning: cyclomatic complexity 19 of function createConsecutiveTunnels() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/aws/rpc.go
    • Line 1619: warning: cyclomatic complexity 26 of function (stack).rpcRunInstance() is high (> 15) (gocyclo)
    • Line 1817: warning: cyclomatic complexity 24 of function (stack).rpcTerminateInstance() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/openstack/compute.go
    • Line 663: warning: cyclomatic complexity 57 of function (stack).CreateHost() is high (> 15) (gocyclo)
    • Line 1376: warning: cyclomatic complexity 33 of function (stack).DeleteHost() is high (> 15) (gocyclo)
    • Line 1177: warning: cyclomatic complexity 21 of function (stack).WaitHostState() is high (> 15) (gocyclo)
    • Line 506: warning: cyclomatic complexity 20 of function (stack).complementHost() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/gcp/rpc.go
    • Line 1453: warning: cyclomatic complexity 23 of function (stack).rpcCreateExternalAddress() is high (> 15) (gocyclo)
    • Line 1204: warning: cyclomatic complexity 21 of function (stack).rpcCreateInstance() is high (> 15) (gocyclo)
    • Line 1996: warning: cyclomatic complexity 20 of function (stack).rpcRemoveTagsFromInstance() is high (> 15) (gocyclo)
    • Line 1914: warning: cyclomatic complexity 19 of function (stack).rpcAddTagsToInstance() is high (> 15) (gocyclo)
    • Line 447: warning: cyclomatic complexity 18 of function (stack).rpcCreateFirewallRule() is high (> 15) (gocyclo)
    • Line 527: warning: cyclomatic complexity 16 of function (stack).rpcListFirewallRules() is high (> 15) (gocyclo)
    • lib/server/resources/operations/clusterinstall.go
    • Line 458: warning: cyclomatic complexity 24 of function (*Cluster).ExecuteScript() is high (> 15) (gocyclo)
    • Line 106: warning: cyclomatic complexity 22 of function (*Cluster).ComplementFeatureParameters() is high (> 15) (gocyclo)
    • Line 575: warning: cyclomatic complexity 18 of function (*Cluster).installNodeRequirements() is high (> 15) (gocyclo)
    • lib/utils/concurrency/taskgroup.go
    • Line 359: warning: cyclomatic complexity 23 of function (*taskGroup).WaitGroup() is high (> 15) (gocyclo)
    • Line 239: warning: cyclomatic complexity 21 of function (*taskGroup).StartWithTimeout() is high (> 15) (gocyclo)
    • Line 663: warning: cyclomatic complexity 20 of function (*taskGroup).WaitGroupFor() is high (> 15) (gocyclo)
    • Line 101: warning: cyclomatic complexity 19 of function newTaskGroup() is high (> 15) (gocyclo)
    • Line 563: warning: cyclomatic complexity 18 of function (*taskGroup).TryWaitGroup() is high (> 15) (gocyclo)
    • lib/server/resources/operations/share.go
    • Line 572: warning: cyclomatic complexity 45 of function (*Share).Mount() is high (> 15) (gocyclo)
    • Line 254: warning: cyclomatic complexity 41 of function (*Share).Create() is high (> 15) (gocyclo)
    • Line 846: warning: cyclomatic complexity 21 of function (*Share).Unmount() is high (> 15) (gocyclo)
    • Line 992: warning: cyclomatic complexity 18 of function (*Share).Delete() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/aws/compute.go
    • Line 497: warning: cyclomatic complexity 41 of function (stack).CreateHost() is high (> 15) (gocyclo)
    • Line 1037: warning: cyclomatic complexity 27 of function (stack).DeleteHost() is high (> 15) (gocyclo)
    • Line 839: warning: cyclomatic complexity 20 of function (stack).inspectInstance() is high (> 15) (gocyclo)
    • Line 1390: warning: cyclomatic complexity 16 of function (stack).UnbindSecurityGroupFromHost() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/aws/network.go
    • Line 63: warning: cyclomatic complexity 28 of function (stack).CreateNetwork() is high (> 15) (gocyclo)
    • Line 280: warning: cyclomatic complexity 20 of function (stack).DeleteNetwork() is high (> 15) (gocyclo)
    • Line 388: warning: cyclomatic complexity 18 of function (stack).CreateSubnet() is high (> 15) (gocyclo)
    • lib/client/ssh.go
    • Line 201: warning: cyclomatic complexity 48 of function (sshConsumer).Copy() is high (> 15) (gocyclo)
    • Line 56: warning: cyclomatic complexity 16 of function (sshConsumer).Run() is high (> 15) (gocyclo)
    • lib/system/ssh/bylib/library_based_ssh.go
    • Line 297: warning: cyclomatic complexity 33 of function (*LibCommand).NewRunWithTimeout() is high (> 15) (gocyclo)
    • Line 823: warning: cyclomatic complexity 25 of function (*Profile).copy() is high (> 15) (gocyclo)
    • Line 959: warning: cyclomatic complexity 21 of function (*Profile).Enter() is high (> 15) (gocyclo)
    • Line 532: warning: cyclomatic complexity 18 of function (*Profile).CreateTunneling() is high (> 15) (gocyclo)
    • lib/utils/concurrency/task.go
    • Line 1020: warning: cyclomatic complexity 24 of function (*task).Wait() is high (> 15) (gocyclo)
    • Line 1202: warning: cyclomatic complexity 21 of function (*task).WaitFor() is high (> 15) (gocyclo)
    • Line 270: warning: cyclomatic complexity 17 of function newTask() is high (> 15) (gocyclo)
    • lib/server/iaas/stacks/huaweicloud/error.go
    • Line 39: warning: cyclomatic complexity 36 of function NormalizeError() is high (> 15) (gocyclo)
    • Line 208: warning: cyclomatic complexity 16 of function reduceOpenstackError() is high (> 15) (gocyclo)
    • Line 297: warning: cyclomatic complexity 16 of function reduceHuaweiAPIErrors() is high (> 15) (gocyclo)
    • lib/utils/retry/action.go
    • Line 614: warning: cyclomatic complexity 28 of function (action).loopWithHardTimeout() is high (> 15) (gocyclo)
    • Line 516: warning: cyclomatic complexity 20 of function (action).loopWithSoftTimeout() is high (> 15) (gocyclo)
    • Line 390: warning: cyclomatic complexity 16 of function DefaultNotifierWithContext() is high (> 15) (gocyclo)
    • lib/utils/fail/funcs.go
    • Line 140: warning: cyclomatic complexity 27 of function Wrap() is high (> 15) (gocyclo)
    • Line 80: warning: cyclomatic complexity 16 of function FromGRPCStatus() is high (> 15) (gocyclo)
    • lib/server/resources/operations/host.go
    • Line 663: warning: cyclomatic complexity 80 of function (*Host).implCreate() is high (> 15) (gocyclo)
    • Line 2283: warning: cyclomatic complexity 78 of function (*Host).RelaxedDeleteHost() is high (> 15) (gocyclo)
    • Line 1230: warning: cyclomatic complexity 43 of function (*Host).setSecurityGroups() is high (> 15) (gocyclo)
    • Line 187: warning: cyclomatic complexity 33 of function (*Host).updateCachedInformation() is high (> 15) (gocyclo)
    • Line 2069: warning: cyclomatic complexity 31 of function createSingleHostNetworking() is high (> 15) (gocyclo)
    • Line 1900: warning: cyclomatic complexity 28 of function (*Host).finalizeProvisioning() is high (> 15) (gocyclo)
    • Line 1686: warning: cyclomatic complexity 22 of function (*Host).waitInstallPhase() is high (> 15) (gocyclo)
    • Line 1578: warning: cyclomatic complexity 22 of function (*Host).runInstallPhase() is high (> 15) (gocyclo)
    • Line 494: warning: cyclomatic complexity 18 of function (*Host).unsafeReload() is high (> 15) (gocyclo)
    • lib/server/resources/operations/cluster.go
    • Line 1921: warning: cyclomatic complexity 53 of function (*Cluster).delete() is high (> 15) (gocyclo)
    • Line 2407: warning: cyclomatic complexity 46 of function (*Cluster).unsafeUpdateClusterInventory() is high (> 15) (gocyclo)
    • Line 508: warning: cyclomatic complexity 45 of function (*Cluster).Start() is high (> 15) (gocyclo)
    • Line 765: warning: cyclomatic complexity 41 of function (*Cluster).Stop() is high (> 15) (gocyclo)
    • Line 993: warning: cyclomatic complexity 39 of function (*Cluster).AddNodes() is high (> 15) (gocyclo)
    • Line 2966: warning: cyclomatic complexity 23 of function (*Cluster).Shrink() is high (> 15) (gocyclo)
    • Line 2822: warning: cyclomatic complexity 22 of function (*Cluster).ToProtocol() is high (> 15) (gocyclo)
    • Line 1782: warning: cyclomatic complexity 20 of function (*Cluster).deleteNode() is high (> 15) (gocyclo)
    • Line 1206: warning: cyclomatic complexity 20 of function complementHostDefinition() is high (> 15) (gocyclo)
    • lib/server/resources/operations/clustertasks.go
    • Line 851: warning: cyclomatic complexity 76 of function (*Cluster).createHostResources() is high (> 15) (gocyclo)
    • Line 56: warning: cyclomatic complexity 45 of function (*Cluster).taskCreateCluster() is high (> 15) (gocyclo)
    • Line 608: warning: cyclomatic complexity 44 of function (*Cluster).createNetworkingResources() is high (> 15) (gocyclo)
    • Line 2308: warning: cyclomatic complexity 39 of function (*Cluster).taskCreateNode() is high (> 15) (gocyclo)
    • Line 1726: warning: cyclomatic complexity 35 of function (*Cluster).taskCreateMaster() is high (> 15) (gocyclo)
    • Line 444: warning: cyclomatic complexity 29 of function (*Cluster).determineSizingRequirements() is high (> 15) (gocyclo)
    • Line 1996: warning: cyclomatic complexity 24 of function (*Cluster).taskConfigureMasters() is high (> 15) (gocyclo)
    • Line 1327: warning: cyclomatic complexity 21 of function complementSizingRequirements() is high (> 15) (gocyclo)
    • Line 2586: warning: cyclomatic complexity 20 of function (*Cluster).taskConfigureNodes() is high (> 15) (gocyclo)
    • Line 1618: warning: cyclomatic complexity 17 of function (*Cluster).taskCreateMasters() 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!