Showing 247 of 615 total issues
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 TestContainerCheck
has 556 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestContainerCheck(t *testing.T) {
t.Parallel()
defer logging.HideLogs(t)()
t.Run("container not found", func(t *testing.T) {
File user_test.go
has 1224 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Copyright © 2016 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 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 TestCheck
has a Cognitive Complexity of 124 (exceeds 20 allowed). Consider refactoring. Open
func TestCheck(t *testing.T) {
t.Parallel()
t.Run("state=present", func(t *testing.T) {
g := group.NewGroup(new(group.System))
- 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
File unarchive_test.go
has 1127 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 TestApply
has 431 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestApply(t *testing.T) {
t.Parallel()
t.Run("state=present", func(t *testing.T) {
t.Run("gid not provided", func(t *testing.T) {
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 TestListUnits
has 383 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestListUnits(t *testing.T) {
t.Parallel()
t.Run("when-dbus-errors", func(t *testing.T) {
t.Run("list-units-returns-error", func(t *testing.T) {
Function TestCheck
has 381 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestCheck(t *testing.T) {
t.Parallel()
users := []*user.User{
fakeUser("1", "1", "user-1"),
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 TestCheck
has 322 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestCheck(t *testing.T) {
t.Parallel()
t.Run("state=present", func(t *testing.T) {
g := group.NewGroup(new(group.System))
Function TestPreparerPrepare
has 306 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestPreparerPrepare(t *testing.T) {
defer logging.HideLogs(t)()
// newWithField is a little utility. We have this pattern over and over
// where we need to set a target field and then check that we render without
Function TestDiffAdd
has 302 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestDiffAdd(t *testing.T) {
t.Parallel()
zone := time.FixedZone(time.Now().In(time.Local).Zone())
expiryString := "1996-12-12"
File group_test.go
has 874 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Copyright © 2016 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