Showing 65 of 81 total issues
File parser.go
has 2252 lines of code (exceeds 1000 allowed). Consider refactoring. Confirmed
package fortran
import (
"bytes"
"fmt"
Method parser.split
has a Cognitive Complexity of 166 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) split(nodes *[]node, pos int) (
leftOther, leftVariable []node,
rightVariable, rightOther []node) {
// Example of possible variables:
- 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 a Cognitive Complexity of 145 (exceeds 20 allowed). Consider refactoring. Open
func (s *scanner) postprocessor() {
// from:
// DIMENSION M(100), A(2)
// to:
// DIMENSION M(100)
- 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 a Cognitive Complexity of 129 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) parseData() (stmts []goast.Stmt) {
p.expect(ftData)
p.ident++
// parse names and values
- 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 a Cognitive Complexity of 103 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) parseStmt() (stmts []goast.Stmt) {
onlyForRecover := p.ident
pos := p.ns[p.ident].pos
- 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.scanNumbers
has a Cognitive Complexity of 84 (exceeds 20 allowed). Consider refactoring. Open
func (s *scanner) scanNumbers() {
numb:
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 intrinsic.Visit
has a Cognitive Complexity of 78 (exceeds 20 allowed). Consider refactoring. Open
func (in intrinsic) Visit(node goast.Node) (w goast.Visitor) {
if call, ok := node.(*goast.CallExpr); ok {
if n, ok := call.Fun.(*goast.Ident); ok {
if f, ok := intrinsicFunction[strings.ToUpper(n.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 callArgumentSimplification.Visit
has a Cognitive Complexity of 60 (exceeds 20 allowed). Consider refactoring. Open
func (c callArgumentSimplification) Visit(node goast.Node) (w goast.Visitor) {
// from : &((*a))
// to : a
if id, ok := node.(*goast.Ident); ok {
if len(id.Name) > 6 && id.Name[:4] == "&((*" {
- 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.parseFormat
has a Cognitive Complexity of 59 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) parseFormat(in []node) (s string) {
var fs []node
fs = append(fs, in...)
if len(fs) == 0 {
s = "\"\\n\""
- 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.scanTokens
has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring. Open
func (s *scanner) scanTokens() {
entities := []struct {
tok token.Token
pattern []string
}{
- 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 run_summary_test
has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring. Open
def run_summary_test( f, cmdline, short_summary):
nb_test_run=0
nb_test_fail=0
nb_test_illegal=0
nb_test_info=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 parser.fixComplexValue
has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) fixComplexValue(nodes *[]node) {
var start, comma, end int
var find bool
for i := range *nodes {
if i != 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
parser
has 34 methods (exceeds 20 allowed). Consider refactoring. Confirmed
func (p parser) getSize(name string, col int) (size int, ok bool) {
v, ok := p.initVars.get(name)
if !ok {
panic("Cannot find variable : " + name)
}
Method parser.parseCommon
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) parseCommon() (stmts []goast.Stmt) {
p.expect(ftCommon)
p.ident++
var blockName string = "ALL"
- 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.initializeVars
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) initializeVars() (vars []goast.Stmt) {
defer func() {
if r := recover(); r != nil {
err := fmt.Sprintf("Recover initializeVars : %v", r)
Debugf("%s", err)
- 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.fixArrayVariables
has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) fixArrayVariables(nodes *[]node) {
var positions []int
// find all arrays
for i, n := range *nodes {
if n.tok == token.IDENT && p.isArrayVariable(string(n.b)) {
- 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 scan.go
has 1045 lines of code (exceeds 1000 allowed). Consider refactoring. Confirmed
package fortran
import (
"bytes"
"container/list"
Function explodeFor
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
func explodeFor(name []node) (out [][]node, ok bool) {
// have loop
if len(name) == 0 {
return
}
- 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.parseNodes
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
func (p *parser) parseNodes() (decls []goast.Decl) {
Debugf("Parse nodes")
if p.ident < 0 || p.ident >= len(p.ns) {
p.errs = append(p.errs,
- 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 parseType
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
func parseType(nodes []node) (typ goType) {
fixType(&nodes)
typ.baseType = "undefined type"
- 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"