cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub

Showing 1,157 of 1,705 total issues

parser has 36 methods (exceeds 20 allowed). Consider refactoring.
Open

type parser struct {
    scanner scanner.Scanner
    tok     rune                      // current token
    lit     string                    // literal string; only valid for Ident, Int, String tokens
    id      string                    // package id of imported package
Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/go/gcimporter/gcimporter.go - About 4 hrs to fix

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

      class Cloud < Bosh::Cloud
        include Helpers
    
        BOSH_APP_DIR = '/var/vcap/bosh'
        FIRST_DEVICE_NAME_LETTER = 'b'
    Severity: Minor
    Found in bosh_openstack_cpi/lib/cloud/openstack/cloud.rb - About 4 hrs to fix

      Function BinaryOp has 140 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func BinaryOp(x Value, op token.Token, y Value) Value {
          x, y = match(x, y)
      
          switch x := x.(type) {
          case unknownVal:
      Severity: Major
      Found in go_agent/src/code.google.com/p/go.tools/go/exact/exact.go - About 4 hrs to fix

        Function PrintfTests has 140 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func PrintfTests() {
            var b bool
            var i int
            var r rune
            var s string
        Severity: Major
        Found in go_agent/src/code.google.com/p/go.tools/cmd/vet/testdata/print.go - About 4 hrs to fix

          Function RenameTop has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring.
          Open

          func RenameTop(f *ast.File, old, new string) bool {
              var fixed bool
          
              // Rename any conflicting imports
              // (assuming package name is last element of path).
          Severity: Minor
          Found in go_agent/src/code.google.com/p/go.tools/astutil/imports.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 inspect_deployment_changes has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

              def inspect_deployment_changes(manifest, options = {})
                show_empty_changeset = true
          
                if options.has_key?(:show_empty_changeset)
                  show_empty_changeset = options[:show_empty_changeset]
          Severity: Minor
          Found in bosh_cli/lib/cli/deployment_helper.rb - 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 perform_validation has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
          Open

              def perform_validation(options = {})
                # CLEANUP this syntax
                allow_sparse = options.has_key?(:allow_sparse) ?
                    !!options[:allow_sparse] :
                    false
          Severity: Minor
          Found in bosh_cli/lib/cli/release_tarball.rb - 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

          File handler.rb has 355 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Bosh::Agent
          
            class Handler
              include Bosh::Exec
          
          
          Severity: Minor
          Found in bosh_agent/lib/bosh_agent/handler.rb - About 4 hrs to fix

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

              class Cloud < Bosh::Cloud
                include Helpers
            
                # default maximum number of times to retry an AWS API call
                DEFAULT_MAX_RETRIES = 2
            Severity: Minor
            Found in bosh_aws_cpi/lib/cloud/aws/cloud.rb - About 4 hrs to fix

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

                class Cloud < Bosh::Cloud
                  include Helpers
              
                  BOSH_APP_DIR = "/var/vcap/bosh"
                  FIRST_DEVICE_NAME_LETTER = "b"
              Severity: Minor
              Found in bosh_cloudstack_cpi/lib/cloud/cloudstack/cloud.rb - About 4 hrs to fix

                Function findInterestingNode has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring.
                Open

                func findInterestingNode(pkginfo *importer.PackageInfo, path []ast.Node) ([]ast.Node, action) {
                    // TODO(adonovan): integrate with go/types/stdlib_test.go and
                    // apply this to every AST node we can find to make sure it
                    // doesn't crash.
                
                
                Severity: Minor
                Found in go_agent/src/code.google.com/p/go.tools/oracle/describe.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 start_namespaced_element has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                Open

                      def start_namespaced_element(name, attrs = {})
                        @data = ""
                        deserialize_as_localized_method_fault = true
                        if @stack.empty?
                          if @is_fault
                Severity: Minor
                Found in bosh_vsphere_cpi/lib/ruby_vim_sdk/soap/deserializer.rb - 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 status has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                Open

                    def status
                      if options[:uuid]
                        begin
                          say(get_director_status["uuid"])
                        rescue => e
                Severity: Minor
                Found in bosh_cli/lib/cli/commands/misc.rb - 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 parse_networks has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                Open

                      def parse_networks
                        @job.default_network = {}
                
                        network_specs = safe_property(@job_spec, "networks", :class => Array)
                        if network_specs.empty?
                Severity: Minor
                Found in bosh-director/lib/bosh/director/deployment_plan/job_spec_parser.rb - 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

                Function NodeDescription has 134 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func NodeDescription(n ast.Node) string {
                    switch n := n.(type) {
                    case *ast.ArrayType:
                        return "array type"
                    case *ast.AssignStmt:
                Severity: Major
                Found in go_agent/src/code.google.com/p/go.tools/importer/source.go - About 4 hrs to fix

                  File ssa.go has 598 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: Minor
                  Found in go_agent/src/code.google.com/p/go.tools/ssa/ssa.go - About 4 hrs to fix

                    dummyPlatform has 34 methods (exceeds 20 allowed). Consider refactoring.
                    Open

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

                      FakePlatform has 34 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      type FakePlatform struct {
                          Fs                *fakesys.FakeFileSystem
                          Runner            *fakesys.FakeCmdRunner
                          FakeCompressor    *fakecmd.FakeCompressor
                          FakeCopier        *fakecmd.FakeCopier
                      Severity: Minor
                      Found in go_agent/src/bosh/platform/fakes/fake_platform.go - About 4 hrs to fix

                        Class Release has 34 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                          class Release < Base
                            DEFAULT_RELEASE_NAME = 'bosh-release'
                        
                            include Bosh::Cli::DependencyHelper
                        
                        
                        Severity: Minor
                        Found in bosh_cli/lib/cli/commands/release.rb - About 4 hrs to fix

                          Class EC2 has 34 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                              class EC2
                          
                                NAT_AMI_ID = {
                                  'us-east-1' => 'ami-f619c29f',      # ami-vpc-nat-1.1.0-beta
                                  'us-west-1' => 'ami-3bcc9e7e',      # ami-vpc-nat-1.0.0-beta
                          Severity: Minor
                          Found in bosh_cli_plugin_aws/lib/bosh_cli_plugin_aws/ec2.rb - About 4 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language