Showing 207 of 546 total issues
Method IO.readBGDT
has 5 return statements (exceeds 4 allowed). Open
func (iio *IO) readBGDT(index int) ([]*ext.BlockGroupDescriptorTableEntry, error) {
sb, err := iio.Superblock(0)
if err != nil {
return nil, err
Function GenerateVMX
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func GenerateVMX(cores, memory, disk, name, dir string, numberOfNetworkCards int, networkType string, id string) string {
replace := func(in, replace, with string) string {
return strings.Replace(in, replace, with, -1)
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function findBinary
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func findBinary(name string, env []string, cwd string, targetDir string, log elog.View) (string, error) {
log.Debugf("finding %s in %s (cwd: %s, env %v)", name, targetDir, cwd, env)
if strings.HasPrefix(name, "./") {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method allocator.ValidateArgs
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (a *allocator) ValidateArgs(data []byte) error {
c := new(Config)
err := c.Unmarshal(data)
if err != nil {
return err
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method Virtualizer.Stop
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (v *Virtualizer) Stop() error {
v.logger.Debugf("Stopping VM")
if v.state != virtualizers.Ready {
v.state = virtualizers.Changing
err := v.execute(exec.Command("VBoxManage", "controlvm", v.name, "acpipowerbutton"))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method Provisioner.Provision
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (p *Provisioner) Provision(args *provisioners.ProvisionArgs) error {
authHeader := fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", p.cfg.Username, p.cfg.Password))))
if args.Description != "" {
p.log.Warnf(`The 'description' field is ignored by Nutanix provision operation`)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method importSharedObjectsOperation.copyLib
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (isoOp *importSharedObjectsOperation) copyLib(libPath, destPath string) (bool, error) {
destPath = isoOp.adjustPath(destPath)
isoOp.logger.Infof("copying '%s' > '%s", libPath, destPath)
// evaluate libPath so see if its a symlink
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"