go_agent/src/code.google.com/p/go.tools/go/types/call.go
Method checker.selector
has a Cognitive Complexity of 77 (exceeds 20 allowed). Consider refactoring. Open
Open
func (check *checker) selector(x *operand, e *ast.SelectorExpr) {
// these must be declared before the "goto Error" statements
var (
obj Object
index []int
- 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 checker.selector
has 126 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (check *checker) selector(x *operand, e *ast.SelectorExpr) {
// these must be declared before the "goto Error" statements
var (
obj Object
index []int
Method checker.call
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (check *checker) call(x *operand, e *ast.CallExpr) exprKind {
check.exprOrType(x, e.Fun)
switch x.mode {
case invalid:
Avoid deeply nested control flow statements. Open
Open
if _, ok := typ.(*Pointer); !ok && !isInterface(typ) {
typ = &Pointer{base: typ}
}
Method checker.arguments
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (check *checker) arguments(x *operand, call *ast.CallExpr, sig *Signature, arg getter, n int) {
Function unpack
has 5 return statements (exceeds 4 allowed). Open
Open
func unpack(get getter, n int, allowCommaOk bool) (getter, int, bool) {
if n == 1 {
// possibly result of an n-valued function call or comma,ok value
var x0 operand
get(&x0, 0)
Method checker.call
has 5 return statements (exceeds 4 allowed). Open
Open
func (check *checker) call(x *operand, e *ast.CallExpr) exprKind {
check.exprOrType(x, e.Fun)
switch x.mode {
case invalid: