Showing 65 of 81 total issues
Method parser.parseSubroutine
has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) parseSubroutine() (decl goast.Decl) {
Debugf("Parse subroutine")
defer func() {
p.init()
- 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 parser.parseStmt
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
func (p *parser) parseStmt() (stmts []goast.Stmt) {
onlyForRecover := p.ident
pos := p.ns[p.ident].pos
Method scanner.scanStrings
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
func (s *scanner) scanStrings() {
again:
for e := s.nodes.Front(); e != nil; e = e.Next() {
if e.Value.(*node).tok != ftUndefine {
continue
- 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 scanner.mergeLines
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
func (s *scanner) mergeLines() {
if s.nodes.Len() < 2 {
return
}
merge:
- 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 scanner.scanDoubleColon
has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring. Open
func (s *scanner) scanDoubleColon() {
for e := s.nodes.Front(); e != nil; e = e.Next() {
if !(e.Value.(*node).tok == ftDoubleColon) {
continue
}
- 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 intrinsicArgumentCorrection
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
func intrinsicArgumentCorrection(p *parser, f *goast.CallExpr, name string, typeNames []string) {
if _, ok := f.Fun.(*goast.Ident); !ok || len(f.Args) != len(typeNames) {
return
}
f.Fun.(*goast.Ident).Name = 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
Method scanner.scanEmpty
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
func (s *scanner) scanEmpty() {
empty:
var again bool
for e := s.nodes.Front(); e != nil; e = e.Next() {
if e.Value.(*node).tok != ftUndefine {
- 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 scanner.scanNextComments
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
func (s *scanner) scanNextComments() {
Op:
var again bool
for e := s.nodes.Front(); e != nil; e = e.Next() {
if e.Value.(*node).tok != ftUndefine {
- 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 parser.parseParameter
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) parseParameter() (stmts []goast.Stmt) {
start := p.ident
p.expect(ftParameter)
p.ident++
p.expect(token.LPAREN)
- 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 parser.isComplex
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) isComplex(e goast.Expr) (isComplex, ok bool) {
if par, ok := e.(*goast.ParenExpr); ok {
if st, ok := par.X.(*goast.StarExpr); ok {
if id, ok := st.X.(*goast.Ident); ok {
if v, ok := p.initVars.get(id.Name); ok {
- 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 parser.parseData
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
func (p *parser) parseData() (stmts []goast.Stmt) {
p.expect(ftData)
p.ident++
// parse names and values
Method parser.parseCall
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) parseCall() goast.Stmt {
{
begin := p.ident
p.expect(ftCall)
p.ident++
- 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 Parse
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
func Parse(b []byte, packageName string) (_ goast.File, errs []error) {
if packageName == "" {
packageName = "main"
}
- 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 parser.parseDo
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) parseDo() (sDo goast.ForStmt) {
p.expect(ftDo)
p.ident++
if p.ns[p.ident].tok == ftWhile {
p.ident--
- 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 scanner.postprocessor
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
func (s *scanner) postprocessor() {
// from:
// DIMENSION M(100), A(2)
// to:
// DIMENSION M(100)
Method parser.parseInit
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) parseInit() (stmts []goast.Stmt) {
// parse base type
var baseType []node
for ; p.ns[p.ident].tok != token.IDENT; p.ident++ {
- 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 explodeFor
has 8 return statements (exceeds 4 allowed). Open
func explodeFor(name []node) (out [][]node, ok bool) {
// have loop
if len(name) == 0 {
return
}
Avoid deeply nested control flow statements. Open
if rightSeparator+1 < len(rightPart) &&
rightPart[rightSeparator+1].tok == token.LPAREN {
rightSeparator++
counter := 0
for {
Avoid deeply nested control flow statements. Open
if counter == 0 {
break
}
Avoid deeply nested control flow statements. Open
if strings.Contains(v.typ.getBaseType(), "complex") {
return true, true
} else {
return false, true
}