Showing 44 of 54 total issues
Method IoTSiteWiseAccessPolicyLister.List
has a Cognitive Complexity of 60 (exceeds 20 allowed). Consider refactoring. Open
func (l *IoTSiteWiseAccessPolicyLister) List(_ context.Context, o interface{}) ([]resource.Resource, error) { //nolint:gocyclo
opts := o.(*nuke.ListerOpts)
svc := iotsitewise.New(opts.Session)
resources := make([]resource.Resource, 0)
- 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 IoTSiteWiseDashboardLister.List
has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring. Open
func (l *IoTSiteWiseDashboardLister) List(_ context.Context, o interface{}) ([]resource.Resource, error) {
opts := o.(*nuke.ListerOpts)
svc := iotsitewise.New(opts.Session)
resources := make([]resource.Resource, 0)
- 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 execute
has 124 lines of code (exceeds 50 allowed). Consider refactoring. Open
func execute(c *cli.Context) error { //nolint:funlen,gocyclo
ctx, cancel := context.WithCancel(c.Context)
defer cancel()
defaultRegion := c.String("default-region")
Function init
has 111 lines of code (exceeds 50 allowed). Consider refactoring. Open
func init() { //nolint:funlen
flags := []cli.Flag{
&cli.PathFlag{
Name: "config",
Aliases: []string{"c"},
Function execute
has 107 lines of code (exceeds 50 allowed). Consider refactoring. Open
func execute(c *cli.Context) error { //nolint:funlen,gocyclo
var regs registry.Registrations
if c.String("resource") == "all" {
regs = registry.GetRegistrations()
Function execute
has 96 lines of code (exceeds 50 allowed). Consider refactoring. Open
func execute(c *cli.Context) error { //nolint:funlen,gocyclo
accountID := c.String("account-id")
parsedConfig, err := config.New(libconfig.Options{
Path: c.Path("config"),
Function main
has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring. Open
func main() { //nolint:funlen,gocyclo
args := os.Args[1:]
if len(args) == 0 {
panic("no arguments given")
- 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 GlobalAcceleratorEndpointGroupLister.List
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
func (l *GlobalAcceleratorEndpointGroupLister) List(_ context.Context, o interface{}) ([]resource.Resource, error) {
opts := o.(*nuke.ListerOpts)
svc := globalaccelerator.New(opts.Session)
var acceleratorARNs []*string
- 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 IoTSiteWiseAccessPolicyLister.List
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (l *IoTSiteWiseAccessPolicyLister) List(_ context.Context, o interface{}) ([]resource.Resource, error) { //nolint:gocyclo
opts := o.(*nuke.ListerOpts)
svc := iotsitewise.New(opts.Session)
resources := make([]resource.Resource, 0)
Function init
has 76 lines of code (exceeds 50 allowed). Consider refactoring. Open
func init() {
flags := []cli.Flag{
&cli.PathFlag{
Name: "config",
Aliases: []string{"c"},
Method CloudFormationStack.doRemove
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
func (cfs *CloudFormationStack) doRemove() error { //nolint:gocyclo
if cfs.stack.ParentId != nil {
p, err := GetParentStack(cfs.svc, *cfs.stack.ParentId)
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 ELBv2ListenerRuleLister.List
has 72 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (l *ELBv2ListenerRuleLister) List(_ context.Context, o interface{}) ([]resource.Resource, error) {
opts := o.(*nuke.ListerOpts)
svc := elbv2.New(opts.Session)
Method KMSKeyLister.List
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (l *KMSKeyLister) List(_ context.Context, o interface{}) ([]resource.Resource, error) {
opts := o.(*nuke.ListerOpts)
resources := make([]resource.Resource, 0)
var svc kmsiface.KMSAPI
Method CloudFormationStack.doRemove
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (cfs *CloudFormationStack) doRemove() error { //nolint:gocyclo
if cfs.stack.ParentId != nil {
p, err := GetParentStack(cfs.svc, *cfs.stack.ParentId)
if err != nil {
return err
Function execute
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
func execute(c *cli.Context) error { //nolint:funlen,gocyclo
ctx, cancel := context.WithCancel(c.Context)
defer cancel()
defaultRegion := c.String("default-region")
- 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 ELBv2ListenerRuleLister.List
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
func (l *ELBv2ListenerRuleLister) List(_ context.Context, o interface{}) ([]resource.Resource, error) {
opts := o.(*nuke.ListerOpts)
svc := elbv2.New(opts.Session)
- 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 GlobalAcceleratorEndpointGroupLister.List
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (l *GlobalAcceleratorEndpointGroupLister) List(_ context.Context, o interface{}) ([]resource.Resource, error) {
opts := o.(*nuke.ListerOpts)
svc := globalaccelerator.New(opts.Session)
var acceleratorARNs []*string
Function NewAccount
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
func NewAccount(creds *Credentials, endpoints config.CustomEndpoints) (*Account, error) {
creds.CustomEndpoints = endpoints
account := Account{
Credentials: creds,
}
Function execute
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func execute(c *cli.Context) error { //nolint:funlen,gocyclo
accountID := c.String("account-id")
parsedConfig, err := config.New(libconfig.Options{
Path: c.Path("config"),
- 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 TransferServerUserLister.List
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (l *TransferServerUserLister) List(_ context.Context, o interface{}) ([]resource.Resource, error) {
opts := o.(*nuke.ListerOpts)
svc := transfer.New(opts.Session)
resources := make([]resource.Resource, 0)
- 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"