File systemd_properties.go
has 2973 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Copyright © 2017 Asteris, LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
Function newSocketTypePropertiesFromMap
has a Cognitive Complexity of 167 (exceeds 20 allowed). Consider refactoring. Open
func newSocketTypePropertiesFromMap(m map[string]interface{}) *SocketTypeProperties {
s := &SocketTypeProperties{}
if val, ok := m["Accept"]; ok {
s.Accept = val.(bool)
- 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 newServiceTypePropertiesFromMap
has a Cognitive Complexity of 156 (exceeds 20 allowed). Consider refactoring. Open
func newServiceTypePropertiesFromMap(m map[string]interface{}) *ServiceTypeProperties {
s := &ServiceTypeProperties{}
if val, ok := m["AmbientCapabilities"]; ok {
s.AmbientCapabilities = val.(uint64)
- 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 newSocketTypePropertiesFromMap
has 503 lines of code (exceeds 50 allowed). Consider refactoring. Open
func newSocketTypePropertiesFromMap(m map[string]interface{}) *SocketTypeProperties {
s := &SocketTypeProperties{}
if val, ok := m["Accept"]; ok {
s.Accept = val.(bool)
Function newMountTypePropertiesFromMap
has a Cognitive Complexity of 129 (exceeds 20 allowed). Consider refactoring. Open
func newMountTypePropertiesFromMap(m map[string]interface{}) *MountTypeProperties {
s := &MountTypeProperties{}
if val, ok := m["AmbientCapabilities"]; ok {
s.AmbientCapabilities = val.(uint64)
- 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 newServiceTypePropertiesFromMap
has 470 lines of code (exceeds 50 allowed). Consider refactoring. Open
func newServiceTypePropertiesFromMap(m map[string]interface{}) *ServiceTypeProperties {
s := &ServiceTypeProperties{}
if val, ok := m["AmbientCapabilities"]; ok {
s.AmbientCapabilities = val.(uint64)
Function newSwapTypePropertiesFromMap
has a Cognitive Complexity of 125 (exceeds 20 allowed). Consider refactoring. Open
func newSwapTypePropertiesFromMap(m map[string]interface{}) *SwapTypeProperties {
s := &SwapTypeProperties{}
if val, ok := m["AmbientCapabilities"]; ok {
s.AmbientCapabilities = val.(uint64)
- 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 newMountTypePropertiesFromMap
has 389 lines of code (exceeds 50 allowed). Consider refactoring. Open
func newMountTypePropertiesFromMap(m map[string]interface{}) *MountTypeProperties {
s := &MountTypeProperties{}
if val, ok := m["AmbientCapabilities"]; ok {
s.AmbientCapabilities = val.(uint64)
Function newSwapTypePropertiesFromMap
has 377 lines of code (exceeds 50 allowed). Consider refactoring. Open
func newSwapTypePropertiesFromMap(m map[string]interface{}) *SwapTypeProperties {
s := &SwapTypeProperties{}
if val, ok := m["AmbientCapabilities"]; ok {
s.AmbientCapabilities = val.(uint64)
Function newPropertiesFromMap
has a Cognitive Complexity of 74 (exceeds 20 allowed). Consider refactoring. Open
func newPropertiesFromMap(m map[string]interface{}) *Properties {
s := &Properties{}
if val, ok := m["ActiveEnterTimestamp"]; ok {
s.ActiveEnterTimestamp = val.(uint64)
- 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 newPropertiesFromMap
has 224 lines of code (exceeds 50 allowed). Consider refactoring. Open
func newPropertiesFromMap(m map[string]interface{}) *Properties {
s := &Properties{}
if val, ok := m["ActiveEnterTimestamp"]; ok {
s.ActiveEnterTimestamp = val.(uint64)
Function newScopeTypePropertiesFromMap
has 89 lines of code (exceeds 50 allowed). Consider refactoring. Open
func newScopeTypePropertiesFromMap(m map[string]interface{}) *ScopeTypeProperties {
s := &ScopeTypeProperties{}
if val, ok := m["BlockIOAccounting"]; ok {
s.BlockIOAccounting = val.(bool)
Function newScopeTypePropertiesFromMap
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
func newScopeTypePropertiesFromMap(m map[string]interface{}) *ScopeTypeProperties {
s := &ScopeTypeProperties{}
if val, ok := m["BlockIOAccounting"]; ok {
s.BlockIOAccounting = val.(bool)
- 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 newSliceTypePropertiesFromMap
has 68 lines of code (exceeds 50 allowed). Consider refactoring. Open
func newSliceTypePropertiesFromMap(m map[string]interface{}) *SliceTypeProperties {
s := &SliceTypeProperties{}
if val, ok := m["BlockIOAccounting"]; ok {
s.BlockIOAccounting = val.(bool)
Function newSliceTypePropertiesFromMap
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
func newSliceTypePropertiesFromMap(m map[string]interface{}) *SliceTypeProperties {
s := &SliceTypeProperties{}
if val, ok := m["BlockIOAccounting"]; ok {
s.BlockIOAccounting = val.(bool)
- 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"