Preparing report...

Report for github.com/lxc/lxd

(v0.0.0-20211209183150-04c5aff89148)

A+    Excellent!    Found 217 issues across 912 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!


gocyclo78%

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.

    • lxc/monitor.go
    • Line 58: warning: cyclomatic complexity 24 of function (*cmdMonitor).Run() is high (> 15) (gocyclo)
    • lxd/db/images.go
    • Line 1005: warning: cyclomatic complexity 19 of function (*Cluster).CreateImage() is high (> 15) (gocyclo)
    • Line 916: warning: cyclomatic complexity 19 of function (*Cluster).UpdateImage() is high (> 15) (gocyclo)
    • lxd/network/driver_bridge.go
    • Line 584: warning: cyclomatic complexity 212 of function (*bridge).setup() is high (> 15) (gocyclo)
    • Line 201: warning: cyclomatic complexity 70 of function (*bridge).Validate() is high (> 15) (gocyclo)
    • Line 2851: warning: cyclomatic complexity 49 of function (*bridge).Leases() is high (> 15) (gocyclo)
    • Line 2527: warning: cyclomatic complexity 32 of function (*bridge).ForwardCreate() is high (> 15) (gocyclo)
    • Line 1773: warning: cyclomatic complexity 21 of function (*bridge).Update() is high (> 15) (gocyclo)
    • Line 1687: warning: cyclomatic complexity 17 of function (*bridge).Stop() is high (> 15) (gocyclo)
    • lxd/operations.go
    • Line 424: warning: cyclomatic complexity 30 of function operationsGet() is high (> 15) (gocyclo)
    • Line 596: warning: cyclomatic complexity 24 of function operationsGetByType() is high (> 15) (gocyclo)
    • lxd/storage/drivers/driver_zfs_volumes.go
    • Line 436: warning: cyclomatic complexity 45 of function (*zfs).CreateVolumeFromCopy() is high (> 15) (gocyclo)
    • Line 36: warning: cyclomatic complexity 41 of function (*zfs).CreateVolume() is high (> 15) (gocyclo)
    • Line 254: warning: cyclomatic complexity 35 of function (*zfs).CreateVolumeFromBackup() is high (> 15) (gocyclo)
    • Line 1472: warning: cyclomatic complexity 29 of function (*zfs).BackupVolume() is high (> 15) (gocyclo)
    • Line 651: warning: cyclomatic complexity 23 of function (*zfs).CreateVolumeFromMigration() is high (> 15) (gocyclo)
    • Line 1060: warning: cyclomatic complexity 20 of function (*zfs).ListVolumes() is high (> 15) (gocyclo)
    • Line 915: warning: cyclomatic complexity 20 of function (*zfs).SetVolumeQuota() is high (> 15) (gocyclo)
    • Line 1382: warning: cyclomatic complexity 19 of function (*zfs).MigrateVolume() is high (> 15) (gocyclo)
    • Line 1229: warning: cyclomatic complexity 18 of function (*zfs).UnmountVolume() is high (> 15) (gocyclo)
    • client/lxd_instances.go
    • Line 1247: warning: cyclomatic complexity 39 of function (*ProtocolLXD).CopyInstanceSnapshot() is high (> 15) (gocyclo)
    • Line 457: warning: cyclomatic complexity 38 of function (*ProtocolLXD).CopyInstance() is high (> 15) (gocyclo)
    • Line 817: warning: cyclomatic complexity 34 of function (*ProtocolLXD).ExecInstance() is high (> 15) (gocyclo)
    • Line 1057: warning: cyclomatic complexity 18 of function (*ProtocolLXD).CreateInstanceFile() is high (> 15) (gocyclo)
    • Line 229: warning: cyclomatic complexity 17 of function (*ProtocolLXD).CreateInstanceFromBackup() is high (> 15) (gocyclo)
    • lxd/storage_pools_config.go
    • Line 94: warning: cyclomatic complexity 23 of function storagePoolValidateConfig() is high (> 15) (gocyclo)
    • Line 161: warning: cyclomatic complexity 16 of function storagePoolFillDefault() is high (> 15) (gocyclo)
    • lxd/logging.go
    • Line 48: warning: cyclomatic complexity 22 of function expireLogs() is high (> 15) (gocyclo)
    • lxd/instance/drivers/driver_lxc.go
    • Line 3929: warning: cyclomatic complexity 162 of function (*lxc).Update() is high (> 15) (gocyclo)
    • Line 670: warning: cyclomatic complexity 154 of function (*lxc).initLXC() is high (> 15) (gocyclo)
    • Line 1986: warning: cyclomatic complexity 79 of function (*lxc).startCommon() is high (> 15) (gocyclo)
    • Line 147: warning: cyclomatic complexity 37 of function lxcCreate() is high (> 15) (gocyclo)
    • Line 502: warning: cyclomatic complexity 36 of function findIdmap() is high (> 15) (gocyclo)
    • Line 4711: warning: cyclomatic complexity 34 of function (*lxc).Export() is high (> 15) (gocyclo)
    • Line 4965: warning: cyclomatic complexity 32 of function (*lxc).Migrate() is high (> 15) (gocyclo)
    • Line 6901: warning: cyclomatic complexity 31 of function (*lxc).Metrics() is high (> 15) (gocyclo)
    • Line 6440: warning: cyclomatic complexity 30 of function (*lxc).FillNetworkDevice() is high (> 15) (gocyclo)
    • Line 2356: warning: cyclomatic complexity 28 of function (*lxc).Start() is high (> 15) (gocyclo)
    • Line 7048: warning: cyclomatic complexity 27 of function (*lxc).getFSStats() is high (> 15) (gocyclo)
    • Line 66: warning: cyclomatic complexity 26 of function lxcSetConfigItem() is high (> 15) (gocyclo)
    • Line 2615: warning: cyclomatic complexity 26 of function (*lxc).Stop() is high (> 15) (gocyclo)
    • Line 3637: warning: cyclomatic complexity 25 of function (*lxc).Delete() is high (> 15) (gocyclo)
    • Line 3752: warning: cyclomatic complexity 24 of function (*lxc).Rename() is high (> 15) (gocyclo)
    • Line 3433: warning: cyclomatic complexity 22 of function (*lxc).Restore() is high (> 15) (gocyclo)
    • Line 5170: warning: cyclomatic complexity 22 of function (*lxc).templateApplyNow() is high (> 15) (gocyclo)
    • Line 5385: warning: cyclomatic complexity 21 of function (*lxc).FilePull() is high (> 15) (gocyclo)
    • Line 2780: warning: cyclomatic complexity 20 of function (*lxc).Shutdown() is high (> 15) (gocyclo)
    • Line 1901: warning: cyclomatic complexity 19 of function (*lxc).handleIdmappedStorage() is high (> 15) (gocyclo)
    • Line 4641: warning: cyclomatic complexity 18 of function (*lxc).updateDevices() is high (> 15) (gocyclo)
    • Line 1616: warning: cyclomatic complexity 17 of function (*lxc).deviceStop() is high (> 15) (gocyclo)
    • Line 1440: warning: cyclomatic complexity 17 of function (*lxc).deviceStart() is high (> 15) (gocyclo)
    • lxd/main_forkproxy.go
    • Line 409: warning: cyclomatic complexity 72 of function (*cmdForkproxy).Run() is high (> 15) (gocyclo)
    • Line 696: warning: cyclomatic complexity 21 of function proxyCopy() is high (> 15) (gocyclo)
    • Line 314: warning: cyclomatic complexity 18 of function listenerInstance() is high (> 15) (gocyclo)
    • Line 855: warning: cyclomatic complexity 17 of function unixRelayer() is high (> 15) (gocyclo)
    • lxd/storage_volumes.go
    • Line 870: warning: cyclomatic complexity 28 of function storagePoolVolumePost() is high (> 15) (gocyclo)
    • Line 1301: warning: cyclomatic complexity 24 of function storagePoolVolumePut() is high (> 15) (gocyclo)
    • Line 1658: warning: cyclomatic complexity 21 of function createStoragePoolVolumeFromBackup() is high (> 15) (gocyclo)
    • Line 164: warning: cyclomatic complexity 20 of function storagePoolVolumesGet() is high (> 15) (gocyclo)
    • Line 464: warning: cyclomatic complexity 19 of function storagePoolVolumesTypePost() is high (> 15) (gocyclo)
    • Line 1574: warning: cyclomatic complexity 19 of function storagePoolVolumeDelete() is high (> 15) (gocyclo)
    • lxc/config.go
    • Line 125: warning: cyclomatic complexity 41 of function (*cmdConfigEdit).Run() is high (> 15) (gocyclo)
    • Line 476: warning: cyclomatic complexity 26 of function (*cmdConfigSet).Run() is high (> 15) (gocyclo)
    • Line 623: warning: cyclomatic complexity 17 of function (*cmdConfigShow).Run() is high (> 15) (gocyclo)
    • lxd/cgroup/abstraction.go
    • Line 742: warning: cyclomatic complexity 25 of function (*CGroup).GetIOStats() is high (> 15) (gocyclo)
    • Line 206: warning: cyclomatic complexity 16 of function (*CGroup).GetCPUAcctUsageAll() is high (> 15) (gocyclo)
    • Line 686: warning: cyclomatic complexity 16 of function (*CGroup).GetMemoryStats() is high (> 15) (gocyclo)
    • lxc/list_test.go
    • Line 159: warning: cyclomatic complexity 25 of function TestColumns() is high (> 15) (gocyclo)
    • Line 26: warning: cyclomatic complexity 22 of function TestShouldShow() is high (> 15) (gocyclo)
    • lxd/instance_snapshot.go
    • Line 593: warning: cyclomatic complexity 21 of function snapshotPost() is high (> 15) (gocyclo)
    • Line 221: warning: cyclomatic complexity 16 of function instanceSnapshotsPost() is high (> 15) (gocyclo)
    • lxd/seccomp/seccomp.go
    • Line 1666: warning: cyclomatic complexity 21 of function (*Server).HandleMountSyscall() is high (> 15) (gocyclo)
    • Line 710: warning: cyclomatic complexity 21 of function seccompGetPolicyContent() is high (> 15) (gocyclo)
    • Line 1070: warning: cyclomatic complexity 19 of function TaskIDs() is high (> 15) (gocyclo)
    • Line 1384: warning: cyclomatic complexity 18 of function (*Server).HandleSetxattrSyscall() is high (> 15) (gocyclo)
    • lxc/remote.go
    • Line 153: warning: cyclomatic complexity 70 of function (*cmdRemoteAdd).Run() is high (> 15) (gocyclo)
    • lxd/api_1.0.go
    • Line 681: warning: cyclomatic complexity 54 of function doApi10UpdateTriggers() is high (> 15) (gocyclo)
    • Line 525: warning: cyclomatic complexity 35 of function doApi10Update() is high (> 15) (gocyclo)
    • Line 190: warning: cyclomatic complexity 30 of function api10Get() is high (> 15) (gocyclo)
    • lxd/storage_volumes_snapshot.go
    • Line 1044: warning: cyclomatic complexity 28 of function autoCreateCustomVolumeSnapshotsTask() is high (> 15) (gocyclo)
    • Line 86: warning: cyclomatic complexity 22 of function storagePoolVolumeSnapshotsTypePost() is high (> 15) (gocyclo)
    • lxd/device/gpu_physical.go
    • Line 105: warning: cyclomatic complexity 40 of function (*gpuPhysical).startContainer() is high (> 15) (gocyclo)
    • Line 216: warning: cyclomatic complexity 18 of function (*gpuPhysical).startVM() is high (> 15) (gocyclo)
    • lxd/cgroup/init.go
    • Line 337: warning: cyclomatic complexity 39 of function Init() is high (> 15) (gocyclo)
    • Line 123: warning: cyclomatic complexity 30 of function (*Info).SupportsVersion() is high (> 15) (gocyclo)
    • client/lxd_containers.go
    • Line 283: warning: cyclomatic complexity 38 of function (*ProtocolLXD).CopyContainer() is high (> 15) (gocyclo)
    • Line 963: warning: cyclomatic complexity 37 of function (*ProtocolLXD).CopyContainerSnapshot() is high (> 15) (gocyclo)
    • Line 612: warning: cyclomatic complexity 32 of function (*ProtocolLXD).ExecContainer() is high (> 15) (gocyclo)
    • Line 823: warning: cyclomatic complexity 16 of function (*ProtocolLXD).CreateContainerFile() is high (> 15) (gocyclo)
    • lxc/network.go
    • Line 503: warning: cyclomatic complexity 18 of function (*cmdNetworkDetachProfile).Run() is high (> 15) (gocyclo)
    • Line 418: warning: cyclomatic complexity 18 of function (*cmdNetworkDetach).Run() is high (> 15) (gocyclo)
    • Line 608: warning: cyclomatic complexity 16 of function (*cmdNetworkEdit).Run() is high (> 15) (gocyclo)
    • lxc/network_forward.go
    • Line 517: warning: cyclomatic complexity 17 of function (*cmdNetworkForwardEdit).Run() is high (> 15) (gocyclo)
    • Line 779: warning: cyclomatic complexity 17 of function (*cmdNetworkForwardPort).RunRemove() is high (> 15) (gocyclo)
    • lxd/util/net.go
    • Line 163: warning: cyclomatic complexity 25 of function IsAddressCovered() is high (> 15) (gocyclo)
    • lxd/instance_console.go
    • Line 401: warning: cyclomatic complexity 19 of function instanceConsolePost() is high (> 15) (gocyclo)
    • Line 190: warning: cyclomatic complexity 16 of function (*consoleWs).doConsole() is high (> 15) (gocyclo)
    • lxc/exec_unix.go
    • Line 21: warning: cyclomatic complexity 29 of function (*cmdExec).controlSocketHandler() is high (> 15) (gocyclo)
    • lxd/device/nic_ovn.go
    • Line 73: warning: cyclomatic complexity 28 of function (*nicOVN).validateConfig() is high (> 15) (gocyclo)
    • Line 244: warning: cyclomatic complexity 22 of function (*nicOVN).Start() is high (> 15) (gocyclo)
    • Line 594: warning: cyclomatic complexity 18 of function (*nicOVN).State() is high (> 15) (gocyclo)
    • Line 392: warning: cyclomatic complexity 17 of function (*nicOVN).Update() is high (> 15) (gocyclo)
    • lxc/network_acl.go
    • Line 806: warning: cyclomatic complexity 20 of function (*cmdNetworkACLRule).RunRemove() is high (> 15) (gocyclo)
    • lxd/instance/drivers/driver_qemu.go
    • Line 971: warning: cyclomatic complexity 85 of function (*qemu).Start() is high (> 15) (gocyclo)
    • Line 3801: warning: cyclomatic complexity 66 of function (*qemu).Update() is high (> 15) (gocyclo)
    • Line 2331: warning: cyclomatic complexity 40 of function (*qemu).generateQemuConfigFile() is high (> 15) (gocyclo)
    • Line 4572: warning: cyclomatic complexity 37 of function (*qemu).Export() is high (> 15) (gocyclo)
    • Line 2969: warning: cyclomatic complexity 32 of function (*qemu).addNetDevConfig() is high (> 15) (gocyclo)
    • Line 1912: warning: cyclomatic complexity 32 of function (*qemu).generateConfigShare() is high (> 15) (gocyclo)
    • Line 172: warning: cyclomatic complexity 29 of function qemuCreate() is high (> 15) (gocyclo)
    • Line 4414: warning: cyclomatic complexity 25 of function (*qemu).Delete() is high (> 15) (gocyclo)
    • Line 3649: warning: cyclomatic complexity 24 of function (*qemu).Rename() is high (> 15) (gocyclo)
    • Line 5526: warning: cyclomatic complexity 22 of function (*qemu).cpuTopology() is high (> 15) (gocyclo)
    • Line 709: warning: cyclomatic complexity 21 of function (*qemu).Shutdown() is high (> 15) (gocyclo)
    • Line 3352: warning: cyclomatic complexity 19 of function (*qemu).Stop() is high (> 15) (gocyclo)
    • Line 2631: warning: cyclomatic complexity 19 of function (*qemu).addCPUMemoryConfig() is high (> 15) (gocyclo)
    • Line 5215: warning: cyclomatic complexity 18 of function (*qemu).renderState() is high (> 15) (gocyclo)
    • Line 4212: warning: cyclomatic complexity 18 of function (*qemu).updateDevices() is high (> 15) (gocyclo)
    • Line 3147: warning: cyclomatic complexity 16 of function (*qemu).addGPUDevConfig() is high (> 15) (gocyclo)
    • Line 2175: warning: cyclomatic complexity 16 of function (*qemu).templateApplyNow() is high (> 15) (gocyclo)
    • lxd/network/acl/driver_common.go
    • Line 289: warning: cyclomatic complexity 49 of function (*common).validateRule() is high (> 15) (gocyclo)
    • Line 443: warning: cyclomatic complexity 24 of function (*common).validateRuleSubjects() is high (> 15) (gocyclo)
    • Line 574: warning: cyclomatic complexity 20 of function (*common).Update() is high (> 15) (gocyclo)
    • lxd/instance_post.go
    • Line 71: warning: cyclomatic complexity 42 of function instancePost() is high (> 15) (gocyclo)
    • Line 520: warning: cyclomatic complexity 28 of function instancePostClusteringMigrate() is high (> 15) (gocyclo)
    • Line 710: warning: cyclomatic complexity 27 of function instancePostClusteringMigrateWithCeph() is high (> 15) (gocyclo)
    • lxc/storage_volume.go
    • Line 865: warning: cyclomatic complexity 30 of function (*cmdStorageVolumeEdit).Run() is high (> 15) (gocyclo)
    • Line 346: warning: cyclomatic complexity 26 of function (*cmdStorageVolumeCopy).Run() is high (> 15) (gocyclo)
    • Line 1440: warning: cyclomatic complexity 16 of function (*cmdStorageVolumeRename).Run() is high (> 15) (gocyclo)
    • lxc/init.go
    • Line 79: warning: cyclomatic complexity 55 of function (*cmdInit).create() is high (> 15) (gocyclo)
    • lxd/networks.go
    • Line 258: warning: cyclomatic complexity 46 of function networksPost() is high (> 15) (gocyclo)
    • Line 483: warning: cyclomatic complexity 24 of function networksPostCluster() is high (> 15) (gocyclo)
    • Line 1083: warning: cyclomatic complexity 19 of function networkPut() is high (> 15) (gocyclo)
    • Line 756: warning: cyclomatic complexity 17 of function doNetworkGet() is high (> 15) (gocyclo)
    • lxd/events.go
    • Line 39: warning: cyclomatic complexity 19 of function eventsSocket() is high (> 15) (gocyclo)
    • lxd/migrate_storage_volumes.go
    • Line 214: warning: cyclomatic complexity 36 of function (*migrationSink).DoStorage() is high (> 15) (gocyclo)
    • Line 40: warning: cyclomatic complexity 19 of function (*migrationSourceWs).DoStorage() is high (> 15) (gocyclo)
    • lxd/db/cluster/update.go
    • Line 753: warning: cyclomatic complexity 33 of function updateFromV34() is high (> 15) (gocyclo)
    • Line 1676: warning: cyclomatic complexity 33 of function updateFromV15() is high (> 15) (gocyclo)
    • Line 2179: warning: cyclomatic complexity 19 of function updateFromV11() is high (> 15) (gocyclo)
    • lxd/firewall/drivers/drivers_xtables.go
    • Line 1392: warning: cyclomatic complexity 30 of function (Xtables).NetworkApplyForwards() is high (> 15) (gocyclo)
    • Line 203: warning: cyclomatic complexity 24 of function (Xtables).networkSetupACLFilteringChains() is high (> 15) (gocyclo)
    • Line 584: warning: cyclomatic complexity 24 of function (Xtables).aclRuleCriteriaToArgs() is high (> 15) (gocyclo)
    • Line 444: warning: cyclomatic complexity 18 of function (Xtables).NetworkSetup() is high (> 15) (gocyclo)
    • Line 1193: warning: cyclomatic complexity 16 of function (Xtables).iptablesClear() is high (> 15) (gocyclo)
    • lxc/action.go
    • Line 289: warning: cyclomatic complexity 23 of function (*cmdAction).Run() is high (> 15) (gocyclo)
    • Line 192: warning: cyclomatic complexity 22 of function (*cmdAction).doAction() is high (> 15) (gocyclo)
    • lxc/network_peer.go
    • Line 222: warning: cyclomatic complexity 18 of function (*cmdNetworkPeerCreate).Run() is high (> 15) (gocyclo)
    • Line 503: warning: cyclomatic complexity 16 of function (*cmdNetworkPeerEdit).Run() is high (> 15) (gocyclo)
    • lxd/devlxd.go
    • Line 291: warning: cyclomatic complexity 19 of function findContainerForPid() is high (> 15) (gocyclo)
    • lxc/copy.go
    • Line 60: warning: cyclomatic complexity 83 of function (*cmdCopy).copyInstance() is high (> 15) (gocyclo)
    • lxd/instance.go
    • Line 194: warning: cyclomatic complexity 32 of function instanceCreateAsCopy() is high (> 15) (gocyclo)
    • Line 413: warning: cyclomatic complexity 16 of function autoCreateContainerSnapshotsTask() is high (> 15) (gocyclo)
    • Line 83: warning: cyclomatic complexity 16 of function instanceCreateFromImage() is high (> 15) (gocyclo)
    • lxd/patches.go
    • Line 1601: warning: cyclomatic complexity 108 of function upgradeFromStorageTypeLvm() is high (> 15) (gocyclo)
    • Line 1049: warning: cyclomatic complexity 61 of function upgradeFromStorageTypeBtrfs() is high (> 15) (gocyclo)
    • Line 2149: warning: cyclomatic complexity 56 of function upgradeFromStorageTypeZfs() is high (> 15) (gocyclo)
    • Line 1350: warning: cyclomatic complexity 48 of function upgradeFromStorageTypeDir() is high (> 15) (gocyclo)
    • Line 2806: warning: cyclomatic complexity 40 of function patchStorageApiUpdateStorageConfigs() is high (> 15) (gocyclo)
    • Line 3548: warning: cyclomatic complexity 37 of function patchStorageApiPermissions() is high (> 15) (gocyclo)
    • Line 3834: warning: cyclomatic complexity 30 of function patchStorageApiRenameContainerSnapshotsDir() is high (> 15) (gocyclo)
    • Line 3715: warning: cyclomatic complexity 24 of function patchMoveBackups() is high (> 15) (gocyclo)
    • Line 3397: warning: cyclomatic complexity 24 of function patchDevicesNewNamingScheme() is high (> 15) (gocyclo)
    • Line 914: warning: cyclomatic complexity 22 of function patchStorageApi() is high (> 15) (gocyclo)
    • Line 3011: warning: cyclomatic complexity 21 of function patchStorageApiDetectLVSize() is high (> 15) (gocyclo)
    • Line 2473: warning: cyclomatic complexity 21 of function updatePoolPropertyForAllObjects() is high (> 15) (gocyclo)
    • lxd/init.go
    • Line 41: warning: cyclomatic complexity 63 of function initDataNodeApply() is high (> 15) (gocyclo)
    • lxd/network/network_utils.go
    • Line 326: warning: cyclomatic complexity 41 of function UpdateDNSMasqStatic() is high (> 15) (gocyclo)
    • Line 97: warning: cyclomatic complexity 24 of function UsedBy() is high (> 15) (gocyclo)
    • Line 893: warning: cyclomatic complexity 20 of function parseIPRange() is high (> 15) (gocyclo)
    • lxd/network/network_utils_sriov.go
    • Line 325: warning: cyclomatic complexity 17 of function SRIOVFindFreeVFAndRepresentor() is high (> 15) (gocyclo)
    • Line 120: warning: cyclomatic complexity 16 of function SRIOVFindFreeVirtualFunction() is high (> 15) (gocyclo)
    • lxd/resources/storage.go
    • Line 119: warning: cyclomatic complexity 52 of function GetStorage() is high (> 15) (gocyclo)
    • Line 24: warning: cyclomatic complexity 21 of function storageAddDriveInfo() is high (> 15) (gocyclo)
    • lxd/backup.go
    • Line 38: warning: cyclomatic complexity 24 of function backupCreate() is high (> 15) (gocyclo)
    • Line 314: warning: cyclomatic complexity 21 of function volumeBackupCreate() is high (> 15) (gocyclo)
    • lxd-agent/exec.go
    • Line 224: warning: cyclomatic complexity 38 of function (*execWs).Do() is high (> 15) (gocyclo)
    • Line 43: warning: cyclomatic complexity 18 of function execPost() is high (> 15) (gocyclo)
    • lxc/main.go
    • Line 299: warning: cyclomatic complexity 21 of function (*cmdGlobal).PreRun() is high (> 15) (gocyclo)
    • lxc/config/remote.go
    • Line 191: warning: cyclomatic complexity 27 of function (*Config).getConnectionArgs() is high (> 15) (gocyclo)
    • Line 55: warning: cyclomatic complexity 19 of function (*Config).GetInstanceServer() is high (> 15) (gocyclo)
    • Line 118: warning: cyclomatic complexity 18 of function (*Config).GetImageServer() is high (> 15) (gocyclo)
    • lxd/storage/drivers/generic_vfs.go
    • Line 267: warning: cyclomatic complexity 39 of function genericVFSCreateVolumeFromMigration() is high (> 15) (gocyclo)
    • Line 630: warning: cyclomatic complexity 36 of function genericVFSBackupUnpack() is high (> 15) (gocyclo)
    • Line 448: warning: cyclomatic complexity 31 of function genericVFSBackupVolume() is high (> 15) (gocyclo)
    • Line 147: warning: cyclomatic complexity 30 of function genericVFSMigrateVolume() is high (> 15) (gocyclo)
    • Line 859: warning: cyclomatic complexity 24 of function genericVFSCopyVolume() is high (> 15) (gocyclo)
    • lxd/network/openvswitch/ovn.go
    • Line 1040: warning: cyclomatic complexity 28 of function (*OVN).LogicalSwitchPortSetDNS() is high (> 15) (gocyclo)
    • Line 1613: warning: cyclomatic complexity 19 of function (*OVN).LoadBalancerApply() is high (> 15) (gocyclo)
    • Line 1913: warning: cyclomatic complexity 18 of function (*OVN).LogicalRouterPeeringApply() is high (> 15) (gocyclo)
    • lxc/query.go
    • Line 61: warning: cyclomatic complexity 25 of function (*cmdQuery).Run() is high (> 15) (gocyclo)
    • shared/units/units.go
    • Line 91: warning: cyclomatic complexity 19 of function ParseBitSizeString() is high (> 15) (gocyclo)
    • Line 23: warning: cyclomatic complexity 19 of function ParseByteSizeString() is high (> 15) (gocyclo)
    • lxd/migrate_instance.go
    • Line 797: warning: cyclomatic complexity 73 of function (*migrationSink).Do() is high (> 15) (gocyclo)
    • Line 341: warning: cyclomatic complexity 58 of function (*migrationSourceWs).Do() is high (> 15) (gocyclo)
    • Line 736: warning: cyclomatic complexity 16 of function newMigrationSink() is high (> 15) (gocyclo)
    • lxd/cluster/gateway.go
    • Line 158: warning: cyclomatic complexity 44 of function (*Gateway).HandlerFuncs() is high (> 15) (gocyclo)
    • Line 660: warning: cyclomatic complexity 23 of function (*Gateway).LeaderAddress() is high (> 15) (gocyclo)
    • lxd/storage/drivers/driver_btrfs_volumes.go
    • Line 1018: warning: cyclomatic complexity 44 of function (*btrfs).BackupVolume() is high (> 15) (gocyclo)
    • Line 134: warning: cyclomatic complexity 37 of function (*btrfs).CreateVolumeFromBackup() is high (> 15) (gocyclo)
    • Line 858: warning: cyclomatic complexity 34 of function (*btrfs).MigrateVolume() is high (> 15) (gocyclo)
    • Line 664: warning: cyclomatic complexity 31 of function (*btrfs).SetVolumeQuota() is high (> 15) (gocyclo)
    • Line 441: warning: cyclomatic complexity 25 of function (*btrfs).CreateVolumeFromMigration() is high (> 15) (gocyclo)
    • Line 30: warning: cyclomatic complexity 19 of function (*btrfs).CreateVolume() is high (> 15) (gocyclo)
    • Line 351: warning: cyclomatic complexity 17 of function (*btrfs).CreateVolumeFromCopy() is high (> 15) (gocyclo)
    • lxc/console.go
    • Line 221: warning: cyclomatic complexity 18 of function (*cmdConsole).vga() is high (> 15) (gocyclo)
    • shared/util_linux.go
    • Line 449: warning: cyclomatic complexity 24 of function ExecReaderToChannel() is high (> 15) (gocyclo)
    • Line 327: warning: cyclomatic complexity 17 of function OpenPtyInDevpts() is high (> 15) (gocyclo)
    • Line 94: warning: cyclomatic complexity 16 of function GetAllXattr() is high (> 15) (gocyclo)
    • lxd/device/nic_routed.go
    • Line 209: warning: cyclomatic complexity 38 of function (*nicRouted).Start() is high (> 15) (gocyclo)
    • Line 117: warning: cyclomatic complexity 27 of function (*nicRouted).validateEnvironment() is high (> 15) (gocyclo)
    • lxd/daemon.go
    • Line 756: warning: cyclomatic complexity 98 of function (*Daemon).init() is high (> 15) (gocyclo)
    • Line 471: warning: cyclomatic complexity 55 of function (*Daemon).createCmd() is high (> 15) (gocyclo)
    • Line 1548: warning: cyclomatic complexity 33 of function (*Daemon).Stop() is high (> 15) (gocyclo)
    • Line 1967: warning: cyclomatic complexity 30 of function (*Daemon).NodeRefreshTask() is high (> 15) (gocyclo)
    • Line 303: warning: cyclomatic complexity 22 of function (*Daemon).Authenticate() is high (> 15) (gocyclo)
    • lxd/api_cluster.go
    • Line 392: warning: cyclomatic complexity 55 of function clusterPutJoin() is high (> 15) (gocyclo)
    • Line 1659: warning: cyclomatic complexity 44 of function clusterNodeDelete() is high (> 15) (gocyclo)
    • Line 2743: warning: cyclomatic complexity 37 of function restoreClusterMember() is high (> 15) (gocyclo)
    • Line 840: warning: cyclomatic complexity 27 of function clusterInitMember() is high (> 15) (gocyclo)
    • Line 2560: warning: cyclomatic complexity 26 of function evacuateClusterMember() is high (> 15) (gocyclo)
    • Line 1436: warning: cyclomatic complexity 26 of function updateClusterNode() is high (> 15) (gocyclo)
    • Line 1171: warning: cyclomatic complexity 20 of function clusterNodesPost() is high (> 15) (gocyclo)
    • Line 3486: warning: cyclomatic complexity 20 of function clusterGroupPatch() is high (> 15) (gocyclo)
    • Line 3366: warning: cyclomatic complexity 16 of function clusterGroupPut() is high (> 15) (gocyclo)
    • lxc/move.go
    • Line 64: warning: cyclomatic complexity 45 of function (*cmdMove).Run() is high (> 15) (gocyclo)
    • lxd/storage/backend_lxd.go
    • Line 2879: warning: cyclomatic complexity 35 of function (*lxdBackend).CreateCustomVolumeFromCopy() is high (> 15) (gocyclo)
    • Line 4251: warning: cyclomatic complexity 34 of function (*lxdBackend).detectUnknownInstanceVolume() is high (> 15) (gocyclo)
    • Line 984: warning: cyclomatic complexity 34 of function (*lxdBackend).RefreshCustomVolume() is high (> 15) (gocyclo)
    • Line 798: warning: cyclomatic complexity 29 of function (*lxdBackend).CreateInstanceFromCopy() is high (> 15) (gocyclo)
    • Line 1505: warning: cyclomatic complexity 24 of function (*lxdBackend).CreateInstanceFromMigration() is high (> 15) (gocyclo)
    • Line 625: warning: cyclomatic complexity 23 of function (*lxdBackend).CreateInstanceFromBackup() is high (> 15) (gocyclo)
    • Line 3367: warning: cyclomatic complexity 22 of function (*lxdBackend).UpdateCustomVolume() is high (> 15) (gocyclo)
    • Line 2565: warning: cyclomatic complexity 22 of function (*lxdBackend).EnsureImage() is high (> 15) (gocyclo)
    • Line 4113: warning: cyclomatic complexity 18 of function (*lxdBackend).CheckInstanceBackupFileSnapshots() is high (> 15) (gocyclo)
    • Line 1225: warning: cyclomatic complexity 17 of function (*lxdBackend).RefreshInstance() is high (> 15) (gocyclo)
    • Line 3906: warning: cyclomatic complexity 17 of function (*lxdBackend).RestoreCustomVolume() is high (> 15) (gocyclo)
    • Line 4517: warning: cyclomatic complexity 16 of function (*lxdBackend).ImportInstance() is high (> 15) (gocyclo)
    • Line 4408: warning: cyclomatic complexity 16 of function (*lxdBackend).detectUnknownCustomVolume() is high (> 15) (gocyclo)
    • Line 1632: warning: cyclomatic complexity 16 of function (*lxdBackend).RenameInstance() is high (> 15) (gocyclo)
    • Line 1822: warning: cyclomatic complexity 16 of function (*lxdBackend).UpdateInstance() is high (> 15) (gocyclo)
    • lxd/network/acl/acl_ovn.go
    • Line 744: warning: cyclomatic complexity 52 of function OVNPortGroupDeleteIfUnused() is high (> 15) (gocyclo)
    • Line 83: warning: cyclomatic complexity 35 of function OVNEnsureACLs() is high (> 15) (gocyclo)
    • Line 417: warning: cyclomatic complexity 18 of function ovnRuleCriteriaToOVNACLRule() is high (> 15) (gocyclo)
    • Line 526: warning: cyclomatic complexity 16 of function ovnRuleSubjectToOVNACLMatch() is high (> 15) (gocyclo)
    • lxc/publish.go
    • Line 47: warning: cyclomatic complexity 44 of function (*cmdPublish).Run() is high (> 15) (gocyclo)
    • lxd/storage/drivers/driver_ceph_volumes.go
    • Line 33: warning: cyclomatic complexity 41 of function (*ceph).CreateVolume() is high (> 15) (gocyclo)
    • Line 299: warning: cyclomatic complexity 33 of function (*ceph).CreateVolumeFromCopy() is high (> 15) (gocyclo)
    • Line 1233: warning: cyclomatic complexity 26 of function (*ceph).MigrateVolume() is high (> 15) (gocyclo)
    • Line 857: warning: cyclomatic complexity 26 of function (*ceph).SetVolumeQuota() is high (> 15) (gocyclo)
    • Line 495: warning: cyclomatic complexity 23 of function (*ceph).CreateVolumeFromMigration() is high (> 15) (gocyclo)
    • Line 608: warning: cyclomatic complexity 22 of function (*ceph).DeleteVolume() is high (> 15) (gocyclo)
    • Line 978: warning: cyclomatic complexity 19 of function (*ceph).ListVolumes() is high (> 15) (gocyclo)
    • Line 1488: warning: cyclomatic complexity 16 of function (*ceph).MountVolumeSnapshot() is high (> 15) (gocyclo)
    • lxc/image.go
    • Line 667: warning: cyclomatic complexity 31 of function (*cmdImageImport).Run() is high (> 15) (gocyclo)
    • Line 487: warning: cyclomatic complexity 25 of function (*cmdImageExport).Run() is high (> 15) (gocyclo)
    • Line 161: warning: cyclomatic complexity 24 of function (*cmdImageCopy).Run() is high (> 15) (gocyclo)
    • Line 864: warning: cyclomatic complexity 19 of function (*cmdImageInfo).Run() is high (> 15) (gocyclo)
    • Line 375: warning: cyclomatic complexity 16 of function (*cmdImageEdit).Run() is high (> 15) (gocyclo)
    • Line 1197: warning: cyclomatic complexity 16 of function (*cmdImageList).Run() is high (> 15) (gocyclo)
    • Line 1137: warning: cyclomatic complexity 16 of function (*cmdImageList).imageShouldShow() is high (> 15) (gocyclo)
    • lxd/device/disk.go
    • Line 129: warning: cyclomatic complexity 57 of function (*disk).validateConfig() is high (> 15) (gocyclo)
    • Line 1773: warning: cyclomatic complexity 34 of function (*disk).getParentBlocks() is high (> 15) (gocyclo)
    • Line 1583: warning: cyclomatic complexity 33 of function (*disk).getDiskLimits() is high (> 15) (gocyclo)
    • Line 1334: warning: cyclomatic complexity 32 of function (*disk).storagePoolVolumeAttachShift() is high (> 15) (gocyclo)
    • Line 615: warning: cyclomatic complexity 23 of function (*disk).startVM() is high (> 15) (gocyclo)
    • Line 1154: warning: cyclomatic complexity 21 of function (*disk).createDevice() is high (> 15) (gocyclo)
    • Line 458: warning: cyclomatic complexity 20 of function (*disk).startContainer() is high (> 15) (gocyclo)
    • Line 979: warning: cyclomatic complexity 19 of function (*disk).generateLimits() is high (> 15) (gocyclo)
    • Line 841: warning: cyclomatic complexity 19 of function (*disk).Update() is high (> 15) (gocyclo)
    • Line 1060: warning: cyclomatic complexity 17 of function (*disk).mountPoolVolume() is high (> 15) (gocyclo)
    • lxd/instances_post.go
    • Line 810: warning: cyclomatic complexity 56 of function instancesPost() is high (> 15) (gocyclo)
    • Line 198: warning: cyclomatic complexity 41 of function createFromMigration() is high (> 15) (gocyclo)
    • Line 412: warning: cyclomatic complexity 34 of function createFromCopy() is high (> 15) (gocyclo)
    • Line 593: warning: cyclomatic complexity 25 of function createFromBackup() is high (> 15) (gocyclo)
    • Line 38: warning: cyclomatic complexity 16 of function createFromImage() is high (> 15) (gocyclo)
    • lxd/devices.go
    • Line 71: warning: cyclomatic complexity 44 of function deviceNetlinkListener() is high (> 15) (gocyclo)
    • Line 319: warning: cyclomatic complexity 34 of function deviceTaskBalance() is high (> 15) (gocyclo)
    • lxd/project/permissions.go
    • Line 441: warning: cyclomatic complexity 81 of function checkRestrictions() is high (> 15) (gocyclo)
    • Line 916: warning: cyclomatic complexity 19 of function AllowProjectUpdate() is high (> 15) (gocyclo)
    • Line 1230: warning: cyclomatic complexity 18 of function getInstanceLimits() is high (> 15) (gocyclo)
    • lxd/device/device_utils_disk.go
    • Line 312: warning: cyclomatic complexity 18 of function DiskVMVirtfsProxyStart() is high (> 15) (gocyclo)
    • Line 53: warning: cyclomatic complexity 18 of function DiskMount() is high (> 15) (gocyclo)
    • Line 451: warning: cyclomatic complexity 16 of function DiskVMVirtiofsdStart() is high (> 15) (gocyclo)
    • lxd/device/proxy.go
    • Line 56: warning: cyclomatic complexity 35 of function (*proxy).validateConfig() is high (> 15) (gocyclo)
    • Line 351: warning: cyclomatic complexity 26 of function (*proxy).setupNAT() is high (> 15) (gocyclo)
    • lxd/db/generate/db/method.go
    • Line 815: warning: cyclomatic complexity 33 of function (*Method).signature() is high (> 15) (gocyclo)
    • Line 149: warning: cyclomatic complexity 26 of function (*Method).getMany() is high (> 15) (gocyclo)
    • Line 467: warning: cyclomatic complexity 23 of function (*Method).create() is high (> 15) (gocyclo)
    • Line 963: warning: cyclomatic complexity 19 of function (*Method).begin() is high (> 15) (gocyclo)
    • Line 42: warning: cyclomatic complexity 18 of function (*Method).Generate() is high (> 15) (gocyclo)
    • Line 639: warning: cyclomatic complexity 17 of function (*Method).update() is high (> 15) (gocyclo)
    • lxc/exec.go
    • Line 82: warning: cyclomatic complexity 26 of function (*cmdExec).Run() is high (> 15) (gocyclo)
    • shared/cert.go
    • Line 267: warning: cyclomatic complexity 16 of function GenerateMemCert() is high (> 15) (gocyclo)
    • lxd/api_internal.go
    • Line 564: warning: cyclomatic complexity 66 of function internalImportFromBackup() is high (> 15) (gocyclo)
    • Line 885: warning: cyclomatic complexity 17 of function internalImportRootDevicePopulate() is high (> 15) (gocyclo)
    • lxd/storage/drivers/driver_ceph_utils.go
    • Line 632: warning: cyclomatic complexity 23 of function (*ceph).deleteVolume() is high (> 15) (gocyclo)
    • Line 742: warning: cyclomatic complexity 22 of function (*ceph).deleteVolumeSnapshot() is high (> 15) (gocyclo)
    • Line 952: warning: cyclomatic complexity 20 of function (*ceph).getRBDMappedDevPath() is high (> 15) (gocyclo)
    • lxd/db/generate/db/stmt.go
    • Line 73: warning: cyclomatic complexity 23 of function (*Stmt).objects() is high (> 15) (gocyclo)
    • Line 236: warning: cyclomatic complexity 16 of function (*Stmt).create() is high (> 15) (gocyclo)
    • lxd/ip/link.go
    • Line 156: warning: cyclomatic complexity 22 of function (*Link).GetVFInfo() is high (> 15) (gocyclo)
    • lxc/info.go
    • Line 443: warning: cyclomatic complexity 52 of function (*cmdInfo).instanceInfo() is high (> 15) (gocyclo)
    • Line 328: warning: cyclomatic complexity 24 of function (*cmdInfo).remoteInfo() is high (> 15) (gocyclo)
    • Line 170: warning: cyclomatic complexity 21 of function (*cmdInfo).renderNIC() is high (> 15) (gocyclo)
    • Line 87: warning: cyclomatic complexity 19 of function (*cmdInfo).renderGPU() is high (> 15) (gocyclo)
    • lxd/images.go
    • Line 817: warning: cyclomatic complexity 44 of function imagesPost() is high (> 15) (gocyclo)
    • Line 501: warning: cyclomatic complexity 33 of function getImgPostInfo() is high (> 15) (gocyclo)
    • Line 1768: warning: cyclomatic complexity 31 of function autoUpdateImage() is high (> 15) (gocyclo)
    • Line 1573: warning: cyclomatic complexity 30 of function distributeImage() is high (> 15) (gocyclo)
    • Line 182: warning: cyclomatic complexity 28 of function imgPostInstanceInfo() is high (> 15) (gocyclo)
    • Line 1442: warning: cyclomatic complexity 25 of function autoUpdateImages() is high (> 15) (gocyclo)
    • Line 1048: warning: cyclomatic complexity 23 of function getImageMetadata() is high (> 15) (gocyclo)
    • Line 2189: warning: cyclomatic complexity 21 of function imageDelete() is high (> 15) (gocyclo)
    • Line 2065: warning: cyclomatic complexity 20 of function pruneExpiredImagesInProject() is high (> 15) (gocyclo)
    • Line 3286: warning: cyclomatic complexity 18 of function imageExport() is high (> 15) (gocyclo)
    • Line 422: warning: cyclomatic complexity 17 of function imgPostURLInfo() is high (> 15) (gocyclo)
    • Line 3739: warning: cyclomatic complexity 16 of function imageSyncBetweenNodes() is high (> 15) (gocyclo)
    • lxc/config_device.go
    • Line 446: warning: cyclomatic complexity 16 of function (*cmdConfigDeviceRemove).Run() is high (> 15) (gocyclo)
    • Line 554: warning: cyclomatic complexity 16 of function (*cmdConfigDeviceSet).Run() is high (> 15) (gocyclo)
    • Line 97: warning: cyclomatic complexity 16 of function (*cmdConfigDeviceAdd).Run() is high (> 15) (gocyclo)
    • lxc/list.go
    • Line 500: warning: cyclomatic complexity 40 of function (*cmdList).parseColumns() is high (> 15) (gocyclo)
    • Line 389: warning: cyclomatic complexity 25 of function (*cmdList).Run() is high (> 15) (gocyclo)
    • Line 163: warning: cyclomatic complexity 20 of function (*cmdList).shouldShow() is high (> 15) (gocyclo)
    • Line 257: warning: cyclomatic complexity 17 of function (*cmdList).listInstances() is high (> 15) (gocyclo)
    • lxd/device/nic_ipvlan.go
    • Line 213: warning: cyclomatic complexity 27 of function (*nicIPVLAN).Start() is high (> 15) (gocyclo)
    • Line 32: warning: cyclomatic complexity 21 of function (*nicIPVLAN).validateConfig() is high (> 15) (gocyclo)
    • Line 141: warning: cyclomatic complexity 20 of function (*nicIPVLAN).validateEnvironment() is high (> 15) (gocyclo)
    • lxd/device/nic_bridged.go
    • Line 58: warning: cyclomatic complexity 78 of function (*nicBridged).validateConfig() is high (> 15) (gocyclo)
    • Line 450: warning: cyclomatic complexity 29 of function (*nicBridged).Start() is high (> 15) (gocyclo)
    • Line 944: warning: cyclomatic complexity 28 of function (*nicBridged).setFilters() is high (> 15) (gocyclo)
    • Line 1044: warning: cyclomatic complexity 28 of function (*nicBridged).networkClearLease() is high (> 15) (gocyclo)
    • Line 1395: warning: cyclomatic complexity 26 of function (*nicBridged).State() is high (> 15) (gocyclo)
    • Line 622: warning: cyclomatic complexity 18 of function (*nicBridged).Update() is high (> 15) (gocyclo)
    • Line 1286: warning: cyclomatic complexity 17 of function (*nicBridged).setupNativeBridgePortVLANs() is high (> 15) (gocyclo)
    • lxc/file.go
    • Line 434: warning: cyclomatic complexity 46 of function (*cmdFilePush).Run() is high (> 15) (gocyclo)
    • Line 236: warning: cyclomatic complexity 36 of function (*cmdFilePull).Run() is high (> 15) (gocyclo)
    • lxd/instance_exec.go
    • Line 128: warning: cyclomatic complexity 45 of function (*execWs).Do() is high (> 15) (gocyclo)
    • Line 483: warning: cyclomatic complexity 37 of function instanceExecPost() is high (> 15) (gocyclo)
    • lxd/main_sql.go
    • Line 60: warning: cyclomatic complexity 18 of function (*cmdSql).Run() is high (> 15) (gocyclo)
    • lxd/util/sys.go
    • Line 93: warning: cyclomatic complexity 16 of function RuntimeLiblxcVersionAtLeast() is high (> 15) (gocyclo)
    • lxd/storage_pools.go
    • Line 367: warning: cyclomatic complexity 25 of function storagePoolsPostCluster() is high (> 15) (gocyclo)
    • Line 220: warning: cyclomatic complexity 24 of function storagePoolsPost() is high (> 15) (gocyclo)
    • Line 774: warning: cyclomatic complexity 19 of function doStoragePoolUpdate() is high (> 15) (gocyclo)
    • Line 638: warning: cyclomatic complexity 19 of function storagePoolPut() is high (> 15) (gocyclo)
    • Line 865: warning: cyclomatic complexity 18 of function storagePoolDelete() is high (> 15) (gocyclo)
    • lxd/network/driver_ovn.go
    • Line 1650: warning: cyclomatic complexity 101 of function (*ovn).setup() is high (> 15) (gocyclo)
    • Line 3005: warning: cyclomatic complexity 77 of function (*ovn).InstanceDevicePortSetup() is high (> 15) (gocyclo)
    • Line 2579: warning: cyclomatic complexity 58 of function (*ovn).Update() is high (> 15) (gocyclo)
    • Line 267: warning: cyclomatic complexity 56 of function (*ovn).Validate() is high (> 15) (gocyclo)
    • Line 801: warning: cyclomatic complexity 30 of function (*ovn).allocateUplinkPortIPs() is high (> 15) (gocyclo)
    • Line 2907: warning: cyclomatic complexity 27 of function (*ovn).InstanceDevicePortValidateExternalRoutes() is high (> 15) (gocyclo)
    • Line 3888: warning: cyclomatic complexity 26 of function (*ovn).ForwardCreate() is high (> 15) (gocyclo)
    • Line 4198: warning: cyclomatic complexity 23 of function (*ovn).PeerCreate() is high (> 15) (gocyclo)
    • Line 3461: warning: cyclomatic complexity 21 of function (*ovn).InstanceDevicePortDelete() is high (> 15) (gocyclo)
    • Line 2366: warning: cyclomatic complexity 19 of function (*ovn).Delete() is high (> 15) (gocyclo)
    • Line 3749: warning: cyclomatic complexity 17 of function (*ovn).handleDependencyChange() is high (> 15) (gocyclo)
    • lxd/db/entity.go
    • Line 19: warning: cyclomatic complexity 66 of function (*Cluster).GetURIFromEntity() is high (> 15) (gocyclo)
    • lxd/firewall/drivers/drivers_nftables.go
    • Line 905: warning: cyclomatic complexity 27 of function (Nftables).NetworkApplyForwards() is high (> 15) (gocyclo)
    • Line 706: warning: cyclomatic complexity 26 of function (Nftables).aclRuleCriteriaToRules() is high (> 15) (gocyclo)
    • Line 43: warning: cyclomatic complexity 17 of function (Nftables).Compat() is high (> 15) (gocyclo)
    • lxd/maas/controller.go
    • Line 274: warning: cyclomatic complexity 27 of function (*Controller).UpdateContainer() is high (> 15) (gocyclo)
    • Line 160: warning: cyclomatic complexity 17 of function (*Controller).CreateContainer() is high (> 15) (gocyclo)
    • lxd/instance/instance_utils.go
    • Line 873: warning: cyclomatic complexity 38 of function CreateInternal() is high (> 15) (gocyclo)
    • Line 133: warning: cyclomatic complexity 32 of function ValidConfig() is high (> 15) (gocyclo)
    • Line 259: warning: cyclomatic complexity 28 of function lxcValidConfig() is high (> 15) (gocyclo)
    • Line 703: warning: cyclomatic complexity 27 of function SuitableArchitectures() is high (> 15) (gocyclo)
    • Line 635: warning: cyclomatic complexity 16 of function ResolveImage() is high (> 15) (gocyclo)
    • lxd/certificates.go
    • Line 417: warning: cyclomatic complexity 24 of function certificatesPost() is high (> 15) (gocyclo)
    • Line 713: warning: cyclomatic complexity 22 of function doCertificateUpdate() is high (> 15) (gocyclo)
    • lxd/main_init.go
    • Line 79: warning: cyclomatic complexity 60 of function (*cmdInit).Run() is high (> 15) (gocyclo)
    • lxd/resources/network.go
    • Line 28: warning: cyclomatic complexity 49 of function networkAddDeviceInfo() is high (> 15) (gocyclo)
    • Line 434: warning: cyclomatic complexity 38 of function GetNetworkState() is high (> 15) (gocyclo)
    • Line 273: warning: cyclomatic complexity 27 of function GetNetwork() is high (> 15) (gocyclo)
    • lxd/cluster/membership.go
    • Line 314: warning: cyclomatic complexity 38 of function Join() is high (> 15) (gocyclo)
    • Line 637: warning: cyclomatic complexity 32 of function Assign() is high (> 15) (gocyclo)
    • Line 34: warning: cyclomatic complexity 20 of function Bootstrap() is high (> 15) (gocyclo)
    • lxd/db/db.go
    • Line 162: warning: cyclomatic complexity 28 of function OpenCluster() is high (> 15) (gocyclo)
    • Line 529: warning: cyclomatic complexity 16 of function doDbQueryScan() is high (> 15) (gocyclo)
    • lxd/db/node.go
    • Line 1110: warning: cyclomatic complexity 27 of function (*ClusterTx).GetNodeWithLeastInstances() is high (> 15) (gocyclo)
    • Line 431: warning: cyclomatic complexity 24 of function (*ClusterTx).nodes() is high (> 15) (gocyclo)
    • Line 73: warning: cyclomatic complexity 20 of function (NodeInfo).ToAPI() is high (> 15) (gocyclo)
    • lxd/db/storage_pools.go
    • Line 46: warning: cyclomatic complexity 26 of function (*ClusterTx).GetStoragePoolUsedBy() is high (> 15) (gocyclo)
    • Line 271: warning: cyclomatic complexity 17 of function (*ClusterTx).UpdateCephStoragePoolAfterNodeJoin() is high (> 15) (gocyclo)
    • lxd/main_init_interactive.go
    • Line 689: warning: cyclomatic complexity 56 of function (*cmdInit).askStoragePool() is high (> 15) (gocyclo)
    • Line 111: warning: cyclomatic complexity 46 of function (*cmdInit).askClustering() is high (> 15) (gocyclo)
    • Line 424: warning: cyclomatic complexity 43 of function (*cmdInit).askNetworking() is high (> 15) (gocyclo)
    • Line 958: warning: cyclomatic complexity 23 of function (*cmdInit).askDaemon() is high (> 15) (gocyclo)
    • lxd/db/operations_types.go
    • Line 71: warning: cyclomatic complexity 55 of function (OperationType).Description() is high (> 15) (gocyclo)
    • Line 187: warning: cyclomatic complexity 35 of function (OperationType).Permission() is high (> 15) (gocyclo)
    • lxc/delete.go
    • Line 73: warning: cyclomatic complexity 20 of function (*cmdDelete).Run() is high (> 15) (gocyclo)
    • lxd/resources/gpu.go
    • Line 150: warning: cyclomatic complexity 49 of function gpuAddDeviceInfo() is high (> 15) (gocyclo)
    • Line 408: warning: cyclomatic complexity 30 of function GetGPU() is high (> 15) (gocyclo)
    • client/lxd_images.go
    • Line 614: warning: cyclomatic complexity 29 of function (*ProtocolLXD).CopyImage() is high (> 15) (gocyclo)
    • Line 356: warning: cyclomatic complexity 29 of function (*ProtocolLXD).CreateImage() is high (> 15) (gocyclo)
    • Line 140: warning: cyclomatic complexity 23 of function lxdDownloadImage() is high (> 15) (gocyclo)

golint97%

Golint is a linter for Go source code.

    • shared/util.go
    • Line 35: warning: exported const SnapshotDelimiter should have comment or be unexported (golint)
    • Line 36: warning: exported const HTTPSDefaultPort should have comment or be unexported (golint)
    • Line 37: warning: exported const HTTPDefaultPort should have comment or be unexported (golint)
    • Line 38: warning: exported const HTTPSMetricsDefaultPort should have comment or be unexported (golint)
    • Line 66: warning: exported function PathExists should have comment or be unexported (golint)
    • Line 246: warning: exported function ParseLXDFileHeaders should have comment or be unexported (golint)
    • Line 246: warning: don't use underscores in Go names; func result type_ should be type (golint)
    • Line 286: warning: exported function ReaderToChannel should have comment or be unexported (golint)
    • Line 318: warning: comment on exported function RandomCryptoString should be of the form "RandomCryptoString ..." (golint)
    • Line 333: warning: exported function SplitExt should have comment or be unexported (golint)
    • Line 339: warning: exported function AtoiEmptyDefault should have comment or be unexported (golint)
    • Line 347: warning: exported function ReadStdin should have comment or be unexported (golint)
    • Line 356: warning: exported function WriteAll should have comment or be unexported (golint)
    • Line 539: warning: exported type BytesReadCloser should have comment or be unexported (golint)
    • Line 547: warning: exported method BytesReadCloser.Close should have comment or be unexported (golint)
    • Line 552: warning: exported function IsSnapshot should have comment or be unexported (golint)
    • Line 556: warning: exported function MkdirAllOwner should have comment or be unexported (golint)
    • Line 591: warning: don't use underscores in Go names; var err_chown should be errChown (golint)
    • Line 608: warning: exported function StringInSlice should have comment or be unexported (golint)
    • Line 627: warning: exported function IntInSlice should have comment or be unexported (golint)
    • Line 636: warning: exported function Int64InSlice should have comment or be unexported (golint)
    • Line 645: warning: exported function Uint64InSlice should have comment or be unexported (golint)
    • Line 654: warning: exported function IsTrue should have comment or be unexported (golint)
    • Line 658: warning: exported function IsUserConfig should have comment or be unexported (golint)
    • Line 673: warning: exported function IsBlockdev should have comment or be unexported (golint)
    • Line 677: warning: exported function IsBlockdevPath should have comment or be unexported (golint)
    • Line 703: warning: exported function RunningInUserNS should have comment or be unexported (golint)
    • Line 755: warning: comment on exported function TextEditor should be of the form "TextEditor ..." (golint)
    • Line 821: warning: exported function ParseMetadata should have comment or be unexported (golint)
    • Line 856: warning: exported type RunError should have comment or be unexported (golint)
    • Line 925: warning: exported function RunCommandWithFds should have comment or be unexported (golint)
    • Line 972: warning: exported function TimeIsSet should have comment or be unexported (golint)
    • Line 996: warning: exported function SetProgressMetadata should have comment or be unexported (golint)
    • Line 1021: warning: exported function DownloadFileHash should have comment or be unexported (golint)
    • Line 1094: warning: exported function ParseNumberFromFile should have comment or be unexported (golint)
    • Line 1116: warning: exported type ReadSeeker should have comment or be unexported (golint)
    • Line 1121: warning: exported function NewReadSeeker should have comment or be unexported (golint)
    • Line 1129: warning: exported method ReadSeeker.Seek should have comment or be unexported (golint)
    • Line 1155: warning: exported function GetSnapshotExpiry should have comment or be unexported (golint)
    • Line 1216: warning: comment on exported function JoinUrls should be of the form "JoinUrls ..." (golint)
    • shared/util_linux.go
    • Line 28: warning: exported function GetFileStat should have comment or be unexported (golint)
    • Line 57: warning: exported function SetSize should have comment or be unexported (golint)
    • Line 166: warning: error var ObjectFound should have name of the form ErrFoo (golint)
    • Line 166: warning: exported var ObjectFound should have comment or be unexported (golint)
    • Line 168: warning: exported function LookupUUIDByBlockDevPath should have comment or be unexported (golint)
    • Line 208: warning: comment on exported function GetErrno should be of the form "GetErrno ..." (golint)
    • Line 209: warning: error should be the last type when returning multiple items (golint)
    • Line 292: warning: exported function DeviceTotalMemory should have comment or be unexported (golint)
    • Line 327: warning: don't use underscores in Go names; func parameter devpts_fd should be devptsFd (golint)
    • Line 446: warning: comment on exported function ExecReaderToChannel should be of the form "ExecReaderToChannel ..." (golint)
    • shared/util_linux_cgo.go
    • Line 58: warning: exported const ABSTRACT_UNIX_SOCK_LEN should have comment or be unexported (golint)
    • Line 60: warning: exported function ReadPid should have comment or be unexported (golint)
    • Line 80: warning: exported function PidFdOpen should have comment or be unexported (golint)
    • Line 94: warning: exported function PidfdSendSignal should have comment or be unexported (golint)
    • lxd/images.go
    • Line 828: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • shared/log15/logger.go
    • Line 14: warning: exported type Lvl should have comment or be unexported (golint)
    • Line 17: warning: exported const LvlCrit should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: comment on exported function LvlFromString should be of the form "LvlFromString ..." (golint)
    • Line 71: warning: exported type RecordKeyNames should have comment or be unexported (golint)
    • shared/json.go
    • Line 7: warning: exported type Jmap should have comment or be unexported (golint)
    • Line 9: warning: exported method Jmap.GetString should have comment or be unexported (golint)
    • Line 19: warning: exported method Jmap.GetMap should have comment or be unexported (golint)
    • Line 29: warning: exported method Jmap.GetInt should have comment or be unexported (golint)
    • Line 39: warning: exported method Jmap.GetBool should have comment or be unexported (golint)
    • lxd/instance_file.go
    • Line 136: warning: don't use underscores in Go names; var type_ should be type (golint)
    • Line 234: warning: don't use underscores in Go names; var type_ should be type (golint)
    • lxd/migrate.go
    • Line 272: warning: exported type MigrationSinkArgs should have comment or be unexported (golint)
    • Line 309: warning: receiver name s should be consistent with previous receiver name c for migrationSink (golint)
    • Line 322: warning: receiver name s should be consistent with previous receiver name c for migrationSink (golint)
    • shared/proxy.go
    • Line 45: warning: comment on exported function ProxyFromEnvironment should be of the form "ProxyFromEnvironment ..." (golint)
    • Line 52: warning: exported function ProxyFromConfig should have comment or be unexported (golint)
    • lxd/devlxd.go
    • Line 247: warning: exported type ConnPidMapper should have comment or be unexported (golint)
    • Line 252: warning: exported method ConnPidMapper.ConnStateHandler should have comment or be unexported (golint)
    • Line 289: warning: error var pidNotInContainerErr should have name of the form errFoo (golint)
    • shared/idmap/shift_linux.go
    • Line 476: warning: exported function SupportsVFS3Fscaps should have comment or be unexported (golint)
    • Line 511: warning: exported function UnshiftACL should have comment or be unexported (golint)
    • Line 538: warning: don't use underscores in Go names; var entry_ptr should be entryPtr (golint)
    • Line 539: warning: don't use underscores in Go names; var end_entry_ptr should be endEntryPtr (golint)
    • Line 577: warning: exported function UnshiftCaps should have comment or be unexported (golint)
    • Line 603: warning: exported type IdmapStorageType should have comment or be unexported (golint)
    • Line 606: warning: exported const IdmapStorageNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 611: warning: exported function CanIdmapMount should have comment or be unexported (golint)
    • shared/log15/handler.go
    • Line 15: warning: comment on exported type Handler should be of the form "Handler ..." (with optional leading article) (golint)
    • Line 195: warning: comment on exported function MultiHandler should be of the form "MultiHandler ..." (golint)
    • Line 214: warning: comment on exported function FailoverHandler should be of the form "FailoverHandler ..." (golint)
    • Line 236: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 323: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 341: warning: comment on exported var Must should be of the form "Must ..." (golint)
    • shared/cert.go
    • Line 352: warning: exported function ReadCert should have comment or be unexported (golint)
    • Line 366: warning: exported function CertFingerprint should have comment or be unexported (golint)
    • Line 370: warning: exported function CertFingerprintStr should have comment or be unexported (golint)
    • Line 384: warning: exported function GetRemoteCertificate should have comment or be unexported (golint)
    • shared/network.go
    • Line 110: warning: exported function GetTLSConfig should have comment or be unexported (golint)
    • Line 139: warning: exported function GetTLSConfigMem should have comment or be unexported (golint)
    • Line 179: warning: exported function IsLoopback should have comment or be unexported (golint)
    • Line 183: warning: exported function WebsocketSendStream should have comment or be unexported (golint)
    • Line 212: warning: exported function WebsocketRecvStream should have comment or be unexported (golint)
    • Line 259: warning: exported function WebsocketProxy should have comment or be unexported (golint)
    • Line 335: warning: exported function DefaultWriter should have comment or be unexported (golint)
    • Line 441: warning: comment on exported type WebSocketMirrorReader should be of the form "WebSocketMirrorReader ..." (with optional leading article) (golint)
    • Line 447: warning: exported type WebSocketMirrorWriter should have comment or be unexported (golint)
    • Line 449: warning: exported function WebsocketMirror should have comment or be unexported (golint)
    • Line 469: warning: exported function WebsocketConsoleMirror should have comment or be unexported (golint)
    • Line 504: warning: exported var WebsocketUpgrader should have comment or be unexported (golint)
    • shared/idmap/idmapset_linux.go
    • Line 25: warning: exported const VFS3FscapsUnsupported should have comment or be unexported (golint)
    • Line 26: warning: exported const VFS3FscapsSupported should have comment or be unexported (golint)
    • Line 27: warning: exported const VFS3FscapsUnknown should have comment or be unexported (golint)
    • Line 29: warning: exported var VFS3Fscaps should have comment or be unexported (golint)
    • Line 30: warning: exported var ErrNoUserMap should have comment or be unexported (golint)
    • Line 32: warning: exported type IdRange should have comment or be unexported (golint)
    • Line 39: warning: exported method IdRange.Contains should have comment or be unexported (golint)
    • Line 43: warning: comment on exported type IdmapEntry should be of the form "IdmapEntry ..." (with optional leading article) (golint)
    • Line 55: warning: exported method IdmapEntry.ToLxcString should have comment or be unexported (golint)
    • Line 70: warning: don't use underscores in Go names; func is_between should be isBetween (golint)
    • Line 74: warning: exported method IdmapEntry.HostidsIntersect should have comment or be unexported (golint)
    • Line 91: warning: exported method IdmapEntry.Intersects should have comment or be unexported (golint)
    • Line 156: warning: exported method IdmapEntry.Usable should have comment or be unexported (golint)
    • Line 258: warning: don't use underscores in Go names; method shift_into_ns should be shiftIntoNs (golint)
    • Line 271: warning: don't use underscores in Go names; method shift_from_ns should be shiftFromNs (golint)
    • Line 280: warning: exported type ByHostid should have comment or be unexported (golint)
    • Line 294: warning: comment on exported function Extend should be of the form "Extend ..." (golint)
    • Line 309: warning: exported type IdmapSet should have comment or be unexported (golint)
    • Line 313: warning: exported method IdmapSet.Equals should have comment or be unexported (golint)
    • Line 361: warning: exported method IdmapSet.Intersects should have comment or be unexported (golint)
    • Line 370: warning: exported method IdmapSet.HostidsIntersect should have comment or be unexported (golint)
    • Line 379: warning: exported method IdmapSet.Usable should have comment or be unexported (golint)
    • Line 390: warning: exported method IdmapSet.ValidRanges should have comment or be unexported (golint)
    • Line 430: warning: exported var ErrHostIdIsSubId should have comment or be unexported (golint)
    • Line 432: warning: comment on exported method IdmapSet.AddSafe should be of the form "AddSafe ..." (golint)
    • Line 483: warning: exported method IdmapSet.ToLxcString should have comment or be unexported (golint)
    • Line 495: warning: exported method IdmapSet.Append should have comment or be unexported (golint)
    • Line 545: warning: exported method IdmapSet.ShiftIntoNs should have comment or be unexported (golint)
    • Line 549: warning: exported method IdmapSet.ShiftFromNs should have comment or be unexported (golint)
    • Line 553: warning: receiver name set should be consistent with previous receiver name m for IdmapSet (golint)
    • Line 660: warning: exported method IdmapSet.UidshiftIntoContainer should have comment or be unexported (golint)
    • Line 660: warning: receiver name set should be consistent with previous receiver name m for IdmapSet (golint)
    • Line 664: warning: exported method IdmapSet.UidshiftFromContainer should have comment or be unexported (golint)
    • Line 664: warning: receiver name set should be consistent with previous receiver name m for IdmapSet (golint)
    • Line 668: warning: exported method IdmapSet.ShiftRootfs should have comment or be unexported (golint)
    • Line 668: warning: receiver name set should be consistent with previous receiver name m for IdmapSet (golint)
    • Line 672: warning: exported method IdmapSet.UnshiftRootfs should have comment or be unexported (golint)
    • Line 672: warning: receiver name set should be consistent with previous receiver name m for IdmapSet (golint)
    • Line 676: warning: exported method IdmapSet.ShiftFile should have comment or be unexported (golint)
    • Line 676: warning: receiver name set should be consistent with previous receiver name m for IdmapSet (golint)
    • Line 784: warning: comment on exported function DefaultIdmapSet should be of the form "DefaultIdmapSet ..." (golint)
    • Line 956: warning: comment on exported function CurrentIdmapSet should be of the form "CurrentIdmapSet ..." (golint)
    • shared/archive_linux.go
    • Line 15: warning: exported function Unpack should have comment or be unexported (golint)
    • Line 125: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • lxd/daemon.go
    • Line 158: warning: exported method IdentityClientWrapper.IdentityFromContext should have comment or be unexported (golint)
    • Line 162: warning: exported method IdentityClientWrapper.DeclaredIdentity should have comment or be unexported (golint)
    • Line 1461: warning: exported method Daemon.Ready should have comment or be unexported (golint)
    • shared/osarch/architectures.go
    • Line 8: warning: exported const ARCH_UNKNOWN should have comment (or a comment on this block) or be unexported (golint)
    • Line 82: warning: exported const ArchitectureDefault should have comment or be unexported (golint)
    • Line 84: warning: exported function ArchitectureName should have comment or be unexported (golint)
    • Line 85: warning: don't use underscores in Go names; var arch_name should be archName (golint)
    • Line 93: warning: exported function ArchitectureId should have comment or be unexported (golint)
    • Line 94: warning: don't use underscores in Go names; range var arch_id should be archID (golint)
    • Line 94: warning: don't use underscores in Go names; range var arch_name should be archName (golint)
    • Line 100: warning: don't use underscores in Go names; range var arch_id should be archID (golint)
    • Line 100: warning: don't use underscores in Go names; range var arch_aliases should be archAliases (golint)
    • Line 101: warning: don't use underscores in Go names; range var arch_name should be archName (golint)
    • Line 111: warning: exported function ArchitecturePersonality should have comment or be unexported (golint)
    • Line 112: warning: don't use underscores in Go names; var arch_personality should be archPersonality (golint)
    • Line 120: warning: exported function ArchitecturePersonalities 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!