cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 1,157 of 1,705 total issues

Method checker.exprInternal has a Cognitive Complexity of 322 (exceeds 20 allowed). Consider refactoring.
Open

func (check *checker) exprInternal(x *operand, e ast.Expr, hint Type) exprKind {
    // make sure x has a valid state in case of bailout
    // (was issue 5770)
    x.mode = invalid
    x.typ = Typ[Invalid]
Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/go/types/expr.go - About 6 days to fix

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 checker.resolveFiles has a Cognitive Complexity of 278 (exceeds 20 allowed). Consider refactoring.
Open

func (check *checker) resolveFiles(files []*ast.File) {
    pkg := check.pkg

    // Phase 1: Pre-declare all package-level objects so that they can be found
    //          independent of source order. Associate methods with receiver
Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/go/types/resolver.go - About 5 days to fix

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 deadcode.go has 1877 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build ignore
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/testdata/deadcode.go - About 4 days to fix

    File static.go has 1824 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    // DO NOT EDIT ** This file was generated with the bake tool ** DO NOT EDIT //
    
    package static
    
    var Files = map[string]string{
    Severity: Major
    Found in go_agent/src/code.google.com/p/go.tools/godoc/static/static.go - About 4 days to fix

      Method checker.stmt has a Cognitive Complexity of 214 (exceeds 20 allowed). Consider refactoring.
      Open

      func (check *checker) stmt(ctxt stmtContext, s ast.Stmt) {
          // statements cannot use iota in general
          // (constant declarations set it explicitly)
          assert(check.iota == nil)
      
      
      Severity: Minor
      Found in go_agent/src/code.google.com/p/go.tools/go/types/stmt.go - About 4 days to fix

      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 builder.go has 1652 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      // Copyright 2013 The Go Authors. All rights reserved.
      // Use of this source code is governed by a BSD-style
      // license that can be found in the LICENSE file.
      
      package ssa
      Severity: Major
      Found in go_agent/src/code.google.com/p/go.tools/ssa/builder.go - About 3 days to fix

        Method checker.builtin has a Cognitive Complexity of 193 (exceeds 20 allowed). Consider refactoring.
        Open

        func (check *checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ bool) {
            // append is the only built-in that permits the use of ... for the last argument
            bin := predeclaredFuncs[id]
            if call.Ellipsis.IsValid() && id != _Append {
                check.invalidOp(call.Ellipsis, "invalid use of ... with built-in %s", bin.name)
        Severity: Minor
        Found in go_agent/src/code.google.com/p/go.tools/go/types/builtins.go - About 3 days to fix

        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 ops.go has 1194 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        // Copyright 2013 The Go Authors. All rights reserved.
        // Use of this source code is governed by a BSD-style
        // license that can be found in the LICENSE file.
        
        package interp
        Severity: Major
        Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/ops.go - About 2 days to fix

          File reflect.go has 1178 lines of code (exceeds 500 allowed). Consider refactoring.
          Open

          package pointer
          
          // This file implements the generation and resolution rules for
          // constraints arising from the use of reflection in the target
          // program.  See doc.go for explanation of the representation.
          Severity: Major
          Found in go_agent/src/code.google.com/p/go.tools/pointer/reflect.go - About 2 days to fix

            Function binop has 442 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func binop(op token.Token, t types.Type, x, y value) value {
                switch op {
                case token.ADD:
                    switch x.(type) {
                    case int:
            Severity: Major
            Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/ops.go - About 2 days to fix

              File index.go has 1081 lines of code (exceeds 500 allowed). Consider refactoring.
              Open

              // Copyright 2009 The Go Authors. All rights reserved.
              // Use of this source code is governed by a BSD-style
              // license that can be found in the LICENSE file.
              
              // This file contains the infrastructure to create an
              Severity: Major
              Found in go_agent/src/code.google.com/p/go.tools/godoc/index.go - About 1 day to fix

                File expr.go has 1072 lines of code (exceeds 500 allowed). Consider refactoring.
                Open

                // Copyright 2012 The Go Authors. All rights reserved.
                // Use of this source code is governed by a BSD-style
                // license that can be found in the LICENSE file.
                
                // This file implements typechecking of expressions.
                Severity: Major
                Found in go_agent/src/code.google.com/p/go.tools/go/types/expr.go - About 1 day to fix

                  Method checker.builtin has 417 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (check *checker) builtin(x *operand, call *ast.CallExpr, id builtinId) (_ bool) {
                      // append is the only built-in that permits the use of ... for the last argument
                      bin := predeclaredFuncs[id]
                      if call.Ellipsis.IsValid() && id != _Append {
                          check.invalidOp(call.Ellipsis, "invalid use of ... with built-in %s", bin.name)
                  Severity: Major
                  Found in go_agent/src/code.google.com/p/go.tools/go/types/builtins.go - About 1 day to fix

                    Method checker.stmt has 404 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (check *checker) stmt(ctxt stmtContext, s ast.Stmt) {
                        // statements cannot use iota in general
                        // (constant declarations set it explicitly)
                        assert(check.iota == nil)
                    
                    
                    Severity: Major
                    Found in go_agent/src/code.google.com/p/go.tools/go/types/stmt.go - About 1 day to fix

                      File cloud.rb has 797 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require 'json'
                      require 'membrane'
                      require 'ruby_vim_sdk'
                      require 'cloud'
                      require 'cloud/vsphere/retry_block'
                      Severity: Major
                      Found in bosh_vsphere_cpi/lib/cloud/vsphere/cloud.rb - About 1 day to fix

                        Function asmCheck has a Cognitive Complexity of 102 (exceeds 20 allowed). Consider refactoring.
                        Open

                        func asmCheck(pkg *Package) {
                            if !vet("asmdecl") {
                                return
                            }
                        
                        
                        Severity: Minor
                        Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go - About 1 day to fix

                        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 checker.exprInternal has 370 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (check *checker) exprInternal(x *operand, e ast.Expr, hint Type) exprKind {
                            // make sure x has a valid state in case of bailout
                            // (was issue 5770)
                            x.mode = invalid
                            x.typ = Typ[Invalid]
                        Severity: Major
                        Found in go_agent/src/code.google.com/p/go.tools/go/types/expr.go - About 1 day to fix

                          Function isIdenticalInternal has a Cognitive Complexity of 96 (exceeds 20 allowed). Consider refactoring.
                          Open

                          func isIdenticalInternal(x, y Type, p *ifacePair) bool {
                              if x == y {
                                  return true
                              }
                          
                          
                          Severity: Minor
                          Found in go_agent/src/code.google.com/p/go.tools/go/types/predicates.go - About 1 day to fix

                          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 serialize has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def serialize(value, info, default_namespace = @default_namespace)
                                  return unless VmomiSupport.is_child_version(@version, info.version)
                          
                                  if value.nil?
                                    return if info.optional?
                          Severity: Minor
                          Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/serializer.rb - About 1 day to fix

                          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

                          Class Director has 70 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                                class Director
                          
                                  DIRECTOR_HTTP_ERROR_CODES = [400, 403, 404, 500]
                          
                                  API_TIMEOUT     = 86400 * 3
                          Severity: Major
                          Found in bosh_cli/lib/cli/client/director.rb - About 1 day to fix
                            Severity
                            Category
                            Status
                            Source
                            Language