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
- 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 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
- 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 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}"
- 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 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.
analysis
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
func (a *analysis) nextNode() nodeid {
return nodeid(len(a.nodes))
}
Class InstanceManager
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class InstanceManager
extend Forwardable
CONNECTION_EXCEPTIONS = [
Bosh::Agent::Error,
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>")
- 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 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
File client.rb
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'ruby_vim_sdk'
module VSphereCloud
class Client
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)
- 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
Class Cloud
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class Cloud < Bosh::Cloud
include VimSdk
include RetryBlock
class TimeoutException < StandardError;
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
- 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 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:
//
- 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 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
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
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().
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
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
- 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 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
- 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
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