cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 1,157 of 1,705 total issues

Method checker.resolveFiles has 270 lines of code (exceeds 50 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: Major
Found in go_agent/src/code.google.com/p/go.tools/go/types/resolver.go - About 1 day to fix

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

    func (check *checker) convertUntyped(x *operand, target Type) {
        if x.mode == invalid || isTyped(x.typ) {
            return
        }
    
    
    Severity: Minor
    Found in go_agent/src/code.google.com/p/go.tools/go/types/expr.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.selector has a Cognitive Complexity of 77 (exceeds 20 allowed). Consider refactoring.
    Open

    func (check *checker) selector(x *operand, e *ast.SelectorExpr) {
        // these must be declared before the "goto Error" statements
        var (
            obj      Object
            index    []int
    Severity: Minor
    Found in go_agent/src/code.google.com/p/go.tools/go/types/call.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

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

    module Bosh::CloudStackCloud
      ##
      # BOSH CloudStack CPI
      class Cloud < Bosh::Cloud
        include Helpers
    Severity: Major
    Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb - About 1 day to fix

      File release.rb has 563 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module Bosh::Cli::Command
        class Release < Base
          DEFAULT_RELEASE_NAME = 'bosh-release'
      
          include Bosh::Cli::DependencyHelper
      Severity: Major
      Found in bosh_cli/lib/cli/commands/release.rb - About 1 day to fix

        File director.rb has 561 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'cli/core_ext'
        require 'cli/errors'
        
        require 'json'
        require 'httpclient'
        Severity: Major
        Found in bosh_cli/lib/cli/client/director.rb - About 1 day to fix

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

          func (check *checker) blockBranches(all *Scope, parent *block, lstmt *ast.LabeledStmt, list []ast.Stmt) []*ast.BranchStmt {
              b := &block{parent: parent, lstmt: lstmt}
          
              var (
                  varDeclPos         token.Pos
          Severity: Minor
          Found in go_agent/src/code.google.com/p/go.tools/go/types/labels.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

          Function parseSections has a Cognitive Complexity of 75 (exceeds 20 allowed). Consider refactoring.
          Open

          func parseSections(ctx *Context, name string, lines *Lines, number []int, doc *Doc) ([]Section, error) {
              var sections []Section
              for i := 1; ; i++ {
                  // Next non-empty line is title.
                  text, ok := lines.nextNonEmpty()
          Severity: Minor
          Found in go_agent/src/code.google.com/p/go.tools/present/parse.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

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

          module Bosh::OpenStackCloud
            ##
            # BOSH OpenStack CPI
            class Cloud < Bosh::Cloud
              include Helpers
          Severity: Major
          Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb - About 1 day to fix

            Function lookupFieldOrMethod has a Cognitive Complexity of 74 (exceeds 20 allowed). Consider refactoring.
            Open

            func lookupFieldOrMethod(T Type, pkg *Package, name string) (obj Object, index []int, indirect bool) {
                // WARNING: The code in this function is extremely subtle - do not modify casually!
                //          This function and NewMethodSet should be kept in sync.
            
                if name == "_" {
            Severity: Minor
            Found in go_agent/src/code.google.com/p/go.tools/go/types/lookup.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

            File gen.go has 799 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 pointer
            Severity: Major
            Found in go_agent/src/code.google.com/p/go.tools/pointer/gen.go - About 1 day to fix

              Function conv has a Cognitive Complexity of 73 (exceeds 20 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: Minor
              Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/ops.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 sanity.checkBlock has a Cognitive Complexity of 73 (exceeds 20 allowed). Consider refactoring.
              Open

              func (s *sanity) checkBlock(b *BasicBlock, index int) {
                  s.block = b
              
                  if b.Index != index {
                      s.errorf("block has incorrect Index %d", b.Index)
              Severity: Minor
              Found in go_agent/src/code.google.com/p/go.tools/ssa/sanity.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 builder.stmt has a Cognitive Complexity of 73 (exceeds 20 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: Minor
              Found in go_agent/src/code.google.com/p/go.tools/ssa/builder.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 validate_options has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
              Open

                    def validate_options(options)
                      raise "Invalid options format, Hash expected, #{options.class} given" unless options.is_a?(Hash)
                      raise 'Swift container name is missing' unless options.has_key?(:container_name)
                      raise 'Swift provider is missing' unless options.has_key?(:swift_provider)
                      case options[:swift_provider]
              Severity: Minor
              Found in blobstore_client/lib/blobstore_client/swift_blobstore_client.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

              Function NewMethodSet has a Cognitive Complexity of 69 (exceeds 20 allowed). Consider refactoring.
              Open

              func NewMethodSet(T Type) *MethodSet {
                  // WARNING: The code in this function is extremely subtle - do not modify casually!
                  //          This function and lookupFieldOrMethod should be kept in sync.
              
                  // method set up to the current depth, allocated lazily
              Severity: Minor
              Found in go_agent/src/code.google.com/p/go.tools/go/types/methodset.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

              Function isRepresentableConst has a Cognitive Complexity of 68 (exceeds 20 allowed). Consider refactoring.
              Open

              func isRepresentableConst(x exact.Value, conf *Config, as BasicKind, rounded *exact.Value) bool {
                  switch x.Kind() {
                  case exact.Unknown:
                      return true
              
              
              Severity: Minor
              Found in go_agent/src/code.google.com/p/go.tools/go/types/expr.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

              Function init has 229 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func init() {
                  // Key strings are from Function.String().
                  // That little dot ۰ is an Arabic zero numeral (U+06F0),
                  // categories [Nd].
                  intrinsicsByName = map[string]intrinsic{
              Severity: Major
              Found in go_agent/src/code.google.com/p/go.tools/pointer/intrinsics.go - About 1 day to fix

                Method show_deployment has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
                Open

                    def show_deployment(name, options={})
                      say("Deployment `#{name.make_green}'")
                
                      vms = director.fetch_vm_state(name)
                
                
                Severity: Minor
                Found in bosh_cli/lib/cli/commands/vms.rb - About 7 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 File.asmParseDecl has 206 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (f *File) asmParseDecl(decl *ast.FuncDecl) map[string]*asmFunc {
                    var (
                        arch   *asmArch
                        fn     *asmFunc
                        offset int
                Severity: Major
                Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/asmdecl.go - About 7 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language