cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 1,157 of 1,705 total issues

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

func (check *checker) declStmt(decl ast.Decl) {
    pkg := check.pkg

    switch d := decl.(type) {
    case *ast.BadDecl:
Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/go/types/resolver.go - About 6 hrs 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 builder.expr0 has 195 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (b *builder) expr0(fn *Function, e ast.Expr) Value {
    switch e := e.(type) {
    case *ast.BasicLit:
        panic("non-constant BasicLit") // unreachable

Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/ssa/builder.go - About 6 hrs to fix

    Function playground has 169 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function playground(opts) {
        var code = $(opts.codeEl);
        var transport = opts['transport'] || new HTTPTransport();
        var running;
      
    Severity: Major
    Found in go_agent/src/code.google.com/p/go.tools/godoc/static/playground.js - About 6 hrs to fix

      Method File.asmParseDecl has a Cognitive Complexity of 59 (exceeds 20 allowed). Consider refactoring.
      Open

      func (f *File) asmParseDecl(decl *ast.FuncDecl) map[string]*asmFunc {
          var (
              arch   *asmArch
              fn     *asmFunc
              offset int
      Severity: Minor
      Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go - About 6 hrs 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

      Function childrenOf has 193 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func childrenOf(n ast.Node) []ast.Node {
          var children []ast.Node
      
          // First add nodes for all true subtrees.
          ast.Inspect(n, func(node ast.Node) bool {
      Severity: Major
      Found in go_agent/src/code.google.com/p/go.tools/importer/source.go - About 6 hrs to fix

        Method handlerServer.GetPageInfo has a Cognitive Complexity of 58 (exceeds 20 allowed). Consider refactoring.
        Open

        func (h *handlerServer) GetPageInfo(abspath, relpath string, mode PageInfoMode) *PageInfo {
            info := &PageInfo{Dirname: abspath}
        
            // Restrict to the package files that would be used when building
            // the package on this system.  This makes sure that if there are
        Severity: Minor
        Found in go_agent/src/code.google.com/p/go.tools/godoc/server.go - About 6 hrs 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 end_namespaced_element has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
        Open

              def end_namespaced_element(name)
                if @stack.empty?
                  @delegated_document.__setobj__(@original_document)
                  @original_document.end_namespaced_element(name)
                  return
        Severity: Minor
        Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb - About 6 hrs 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

        Function asmCheckVar has a Cognitive Complexity of 57 (exceeds 20 allowed). Consider refactoring.
        Open

        func asmCheckVar(warnf func(string, ...interface{}), fn *asmFunc, line, expr string, off int, v *asmVar) {
            m := asmOpcode.FindStringSubmatch(line)
            if m == nil {
                warnf("cannot find assembly opcode")
            }
        Severity: Minor
        Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go - About 6 hrs 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

        Function visitInstr has 184 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func visitInstr(fr *frame, instr ssa.Instruction) continuation {
            switch instr := instr.(type) {
            case *ssa.DebugRef:
                // no-op
        
        
        Severity: Major
        Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.go - About 6 hrs to fix

          File describe.go has 677 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 oracle
          Severity: Minor
          Found in go_agent/src/code.google.com/p/go.tools/oracle/describe.go - About 6 hrs to fix

            File instance_manager.rb has 424 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'open3'
            require 'bosh/deployer/logger_renderer'
            require 'bosh/deployer/hash_fingerprinter'
            require 'bosh/deployer/director_gateway_error'
            require 'bosh/deployer/ui_messager'
            Severity: Minor
            Found in bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager.rb - About 6 hrs to fix

              Function testHandler has a Cognitive Complexity of 55 (exceeds 20 allowed). Consider refactoring.
              Open

              func testHandler(w http.ResponseWriter, r *http.Request) {
                  if !appengine.IsDevAppServer() {
                      fmt.Fprint(w, "These tests must be run under the dev_appserver.")
                      return
                  }
              Severity: Minor
              Found in go_agent/src/code.google.com/p/go.tools/dashboard/app/build/test.go - About 6 hrs 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

              Function conv has 173 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func conv(t_dst, t_src types.Type, x value) value {
                  ut_src := t_src.Underlying()
                  ut_dst := t_dst.Underlying()
              
                  // Destination type is not an "untyped" type.
              Severity: Major
              Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/ops.go - About 5 hrs to fix

                Function rename has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
                Open

                func rename(u *BasicBlock, renaming []Value, newPhis newPhiMap) {
                    // Each φ-node becomes the new name for its associated Alloc.
                    for _, np := range newPhis[u] {
                        phi := np.phi
                        alloc := np.alloc
                Severity: Minor
                Found in go_agent/src/code.google.com/p/go.tools/ssa/lift.go - About 5 hrs 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

                Function addrNumber has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
                Open

                func addrNumber(data []byte, lo, hi int, dir byte, n int, charOffset bool) (int, int, error) {
                    switch dir {
                    case 0:
                        lo = 0
                        hi = 0
                Severity: Minor
                Found in go_agent/src/code.google.com/p/go.tools/cmd/godoc/codewalk.go - About 5 hrs 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

                Function addrNumber has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
                Open

                func addrNumber(data []byte, lo, hi int, dir byte, n int, charOffset bool) (int, int, error) {
                    switch dir {
                    case 0:
                        lo = 0
                        hi = 0
                Severity: Minor
                Found in go_agent/src/code.google.com/p/go.tools/present/args.go - About 5 hrs 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 create_vm has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                Open

                    def create_vm(agent_id, stemcell_id, resource_pool,
                                  network_spec = nil, disk_locality = nil, environment = nil)
                      with_thread_name("create_vm(#{agent_id}, ...)") do
                        @logger.info("Creating new server...")
                        server_name = "vm-#{generate_unique_name}"
                Severity: Minor
                Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb - About 5 hrs 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 gcimporter.go has 654 lines of code (exceeds 500 allowed). Consider refactoring.
                Open

                // Copyright 2011 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 gcimporter implements Import for gc-generated object files.
                Severity: Minor
                Found in go_agent/src/code.google.com/p/go.tools/go/gcimporter/gcimporter.go - About 5 hrs to fix

                  analysis has 42 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  func (a *analysis) nextNode() nodeid {
                      return nodeid(len(a.nodes))
                  }
                  Severity: Minor
                  Found in go_agent/src/code.google.com/p/go.tools/pointer/gen.go - About 5 hrs to fix

                    Class InstanceManager has 42 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class InstanceManager
                        extend Forwardable
                    
                        CONNECTION_EXCEPTIONS = [
                          Bosh::Agent::Error,
                    Severity: Minor
                    Found in bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager.rb - About 5 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language