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
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'
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:
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
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).
- Read upRead up
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]
- Read upRead up
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
- Read upRead up
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
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
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"
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.
- Read upRead up
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
- Read upRead up
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
- Read upRead up
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?
- Read upRead up
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:
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
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
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
Class Release
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Release < Base
DEFAULT_RELEASE_NAME = 'bosh-release'
include Bosh::Cli::DependencyHelper
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