Konstantin8105/f4go

View on GitHub

Showing 63 of 79 total issues

File parser.go has 2252 lines of code (exceeds 1000 allowed). Consider refactoring.
Confirmed

package fortran

import (
    "bytes"
    "fmt"
Severity: Major
Found in fortran/parser.go - About 4 days to fix

    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:
    Severity: Minor
    Found in fortran/util.go - About 3 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 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)
    Severity: Minor
    Found in fortran/scan.go - About 2 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 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
    Severity: Minor
    Found in fortran/parser.go - About 2 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 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
    
    
    Severity: Minor
    Found in fortran/parser.go - About 1 day 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 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 {
    Severity: Minor
    Found in fortran/scan.go - About 1 day 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 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 {
    Severity: Minor
    Found in fortran/function_definition.go - About 1 day 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 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] == "&((*" {
    Severity: Minor
    Found in fortran/function_definition.go - About 6 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

    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\""
    Severity: Minor
    Found in fortran/io.go - About 6 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

    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
        }{
    Severity: Minor
    Found in fortran/scan.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

    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
    Severity: Minor
    Found in testdata/lapack/lapack_testing.py - About 4 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

    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 {
    Severity: Minor
    Found in fortran/expression.go - About 4 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

    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)
        }
    Severity: Minor
    Found in fortran/parser.go - About 4 hrs to fix

      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"
      Severity: Minor
      Found in fortran/parser.go - About 3 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

      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)
      Severity: Minor
      Found in fortran/parser.go - About 3 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

      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)) {
      Severity: Minor
      Found in fortran/expression.go - About 3 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

      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
          }
      Severity: Minor
      Found in fortran/parser.go - About 2 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

      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,
      Severity: Minor
      Found in fortran/parser.go - About 2 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

      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"
      Severity: Minor
      Found in fortran/type.go - About 2 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

      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()
      Severity: Minor
      Found in fortran/parser.go - About 2 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

      Severity
      Category
      Status
      Source
      Language