cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub
go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.go

Summary

Maintainability
D
2 days
Test Coverage

Function visitInstr has 184 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func visitInstr(fr *frame, instr ssa.Instruction) continuation {
    switch instr := instr.(type) {
    case *ssa.DebugRef:
        // no-op

Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.go - About 6 hrs to fix

    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
    
    
    Severity: Minor
    Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.go - About 5 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 interp.go has 518 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/interp defines an interpreter for the SSA
    Severity: Minor
    Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.go - About 2 hrs to fix

      Function Interpret has 67 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func Interpret(mainpkg *ssa.Package, mode Mode, filename string, args []string) (exitCode int) {
          i := &interpreter{
              prog:    mainpkg.Prog,
              globals: make(map[ssa.Value]*value),
              mode:    mode,
      Severity: Minor
      Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.go - About 1 hr to fix

        Function runFrame has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
        Open

        func runFrame(fr *frame) {
            defer func() {
                if fr.block == nil {
                    return // normal return
                }
        Severity: Minor
        Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.go - About 45 mins 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 callSSA has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func callSSA(i *interpreter, caller *frame, callpos token.Pos, fn *ssa.Function, args []value, env []value) value {
        Severity: Minor
        Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.go - About 45 mins to fix

          Function call has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func call(i *interpreter, caller *frame, callpos token.Pos, fn value, args []value) value {
          Severity: Minor
          Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.go - About 35 mins to fix

            Function Interpret has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
            Open

            func Interpret(mainpkg *ssa.Package, mode Mode, filename string, args []string) (exitCode int) {
                i := &interpreter{
                    prog:    mainpkg.Prog,
                    globals: make(map[ssa.Value]*value),
                    mode:    mode,
            Severity: Minor
            Found in go_agent/src/code.google.com/p/go.tools/ssa/interp/interp.go - About 35 mins 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

            There are no issues that match your filters.

            Category
            Status