cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub
go_agent/src/code.google.com/p/go.tools/go/types/stmt.go

Summary

Maintainability
F
6 days
Test Coverage

Method checker.stmt has a Cognitive Complexity of 214 (exceeds 20 allowed). Consider refactoring.
Open

func (check *checker) stmt(ctxt stmtContext, s ast.Stmt) {
    // statements cannot use iota in general
    // (constant declarations set it explicitly)
    assert(check.iota == nil)

Severity: Minor
Found in go_agent/src/code.google.com/p/go.tools/go/types/stmt.go - About 4 days 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 checker.stmt has 404 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (check *checker) stmt(ctxt stmtContext, s ast.Stmt) {
    // statements cannot use iota in general
    // (constant declarations set it explicitly)
    assert(check.iota == nil)

Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/go/types/stmt.go - About 1 day to fix

    File stmt.go has 525 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    // Copyright 2012 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.
    
    // This file implements typechecking of statements.
    Severity: Minor
    Found in go_agent/src/code.google.com/p/go.tools/go/types/stmt.go - About 2 hrs to fix

      Method checker.stmt has 18 return statements (exceeds 4 allowed).
      Open

      func (check *checker) stmt(ctxt stmtContext, s ast.Stmt) {
          // statements cannot use iota in general
          // (constant declarations set it explicitly)
          assert(check.iota == nil)
      
      
      Severity: Major
      Found in go_agent/src/code.google.com/p/go.tools/go/types/stmt.go - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status