Konstantin8105/f4go

View on GitHub

Showing 79 of 79 total issues

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

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

Severity: Major
Found in fortran/parser.go - About 2 hrs to fix

    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
    Severity: Minor
    Found in fortran/scan.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 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:
    Severity: Minor
    Found in fortran/scan.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 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 {
    Severity: Minor
    Found in fortran/scan.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 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 {
    Severity: Minor
    Found in fortran/scan.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 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
    Severity: Minor
    Found in fortran/function_definition.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.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)
    Severity: Minor
    Found in fortran/parser.go - About 1 hr 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.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 {
    Severity: Minor
    Found in fortran/expression.go - About 1 hr 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 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
    Severity: Major
    Found in fortran/parser.go - About 1 hr to fix

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          case ftComplex:
              // COMPLEX or COMPLEX * 8
              typ.baseType = "complex128" // TODO: for minimaze type convection "complex64"
              nodes = nodes[1:]
              if len(nodes) > 1 &&
      Severity: Major
      Found in fortran/type.go and 1 other location - About 1 hr to fix
      fortran/type.go on lines 185..203

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 159.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          case ftReal:
              // REAL or REAL * 4
              typ.baseType = "float64" // TODO : correct type "float32"
              nodes = nodes[1:]
              if len(nodes) > 1 &&
      Severity: Major
      Found in fortran/type.go and 1 other location - About 1 hr to fix
      fortran/type.go on lines 152..170

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 159.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                  print("Testing "+name+" "+dtests[1][dtest]+"-"+cmdbase, end=' ')
      Severity: Major
      Found in testdata/lapack/lapack_testing.py and 1 other location - About 1 hr to fix
      testdata/lapack/lapack_testing.py on lines 290..290

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 43.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                      print("ERROR IS LOCATED IN "+name+" "+dtests[1][dtest]+" [ "+cmdbase+" ]")
      Severity: Major
      Found in testdata/lapack/lapack_testing.py and 1 other location - About 1 hr to fix
      testdata/lapack/lapack_testing.py on lines 271..271

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 43.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                  case 'E', 'D':
                      s += "%" + string(f.b[1:])
                      if i+1 < len(fs) && fs[i+1].tok == token.PERIOD {
                          i += 1
                          s += "."
      Severity: Major
      Found in fortran/io.go and 1 other location - About 1 hr to fix
      fortran/io.go on lines 206..216

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 147.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                  case 'F', 'G', 'P':
                      s += "%" + string(f.b[1:])
                      if i+1 < len(fs) && fs[i+1].tok == token.PERIOD {
                          i += 1
                          s += "."
      Severity: Major
      Found in fortran/io.go and 1 other location - About 1 hr to fix
      fortran/io.go on lines 217..227

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 147.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Severity
      Category
      Status
      Source
      Language