cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 1,705 of 1,705 total issues

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

        Function WriteType has a Cognitive Complexity of 52 (exceeds 20 allowed). Consider refactoring.
        Open

        func WriteType(buf *bytes.Buffer, this *Package, typ Type) {
            switch t := typ.(type) {
            case nil:
                buf.WriteString("<nil>")
        
        
        Severity: Minor
        Found in go_agent/src/code.google.com/p/go.tools/go/types/typestring.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

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

        require 'cloud/aws/stemcell_finder'
        
        module Bosh::AwsCloud
        
          class Cloud < Bosh::Cloud
        Severity: Minor
        Found in bosh_aws_cpi/lib/cloud/aws/cloud.rb - About 5 hrs to fix

          File client.rb has 397 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'ruby_vim_sdk'
          
          module VSphereCloud
          
            class Client
          Severity: Minor
          Found in bosh_vsphere_cpi/lib/cloud/vsphere/client.rb - About 5 hrs to fix

            Function checkBuildTag has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
            Open

            func checkBuildTag(name string, data []byte) {
                if !vet("buildtags") {
                    return
                }
                lines := bytes.SplitAfter(data, nl)
            Severity: Minor
            Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/buildtag.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

            Class Cloud has 40 methods (exceeds 20 allowed). Consider refactoring.
            Open

              class Cloud < Bosh::Cloud
                include VimSdk
                include RetryBlock
            
                class TimeoutException < StandardError;
            Severity: Minor
            Found in bosh_vsphere_cpi/lib/cloud/vsphere/cloud.rb - About 5 hrs to fix

              Function visitInstr has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring.
              Open

              func visitInstr(fr *frame, instr ssa.Instruction) continuation {
                  switch instr := instr.(type) {
                  case *ssa.DebugRef:
                      // no-op
              
              
              Severity: Minor
              Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.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 lift has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring.
              Open

              func lift(fn *Function) {
                  // TODO(adonovan): opt: lots of little optimizations may be
                  // worthwhile here, especially if they cause us to avoid
                  // buildDomTree.  For example:
                  //
              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

              File resolver.go has 635 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 types
              Severity: Minor
              Found in go_agent/src/code.google.com/p/go.tools/go/types/resolver.go - About 5 hrs to fix

                linux has 38 methods (exceeds 20 allowed). Consider refactoring.
                Open

                type linux struct {
                    fs                 boshsys.FileSystem
                    cmdRunner          boshsys.CmdRunner
                    collector          boshstats.StatsCollector
                    compressor         boshcmd.Compressor
                Severity: Minor
                Found in go_agent/src/bosh/platform/linux_platform.go - About 5 hrs to fix

                  Method builder.stmt has 149 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (b *builder) stmt(fn *Function, _s ast.Stmt) {
                      // The label of the current statement.  If non-nil, its _goto
                      // target is always set; its _break and _continue are set only
                      // within the body of switch/typeswitch/select/for/range.
                      // It is effectively an additional default-nil parameter of stmt().
                  Severity: Major
                  Found in go_agent/src/code.google.com/p/go.tools/ssa/builder.go - About 4 hrs to fix

                    Method perform_validation has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def perform_validation(options = {})
                          # CLEANUP this syntax
                          allow_sparse = options.has_key?(:allow_sparse) ?
                              !!options[:allow_sparse] :
                              false
                    Severity: Major
                    Found in bosh_cli/lib/cli/release_tarball.rb - About 4 hrs to fix

                      Method builder.expr0 has a Cognitive Complexity of 48 (exceeds 20 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: Minor
                      Found in go_agent/src/code.google.com/p/go.tools/ssa/builder.go - About 4 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 deadState.findDead has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func (d *deadState) findDead(stmt ast.Stmt) {
                          // Is this a labeled goto target?
                          // If so, assume it is reachable due to the goto.
                          // This is slightly conservative, in that we don't
                          // check that the goto is reachable, so
                      Severity: Minor
                      Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/deadcode.go - About 4 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

                      Class Monit has 37 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                        class Monit
                          BUFSIZE = (32 * 1024)
                          NUM_RETRY_MONIT_INCARNATION = 60
                          NUM_RETRY_MONIT_WAIT_INCARNATION = 15
                      
                      
                      Severity: Minor
                      Found in bosh_agent/lib/bosh_agent/monit.rb - About 4 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language