Konstantin8105/f4go

View on GitHub

Showing 81 of 81 total issues

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

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

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

                if (nb_test[2]>0):
                    print("Illegal Error: "+str(nb_test[2]))
    Severity: Major
    Found in testdata/lapack/lapack_testing.py and 2 other locations - About 1 hr to fix
    testdata/lapack/lapack_testing.py on lines 283..284
    testdata/lapack/lapack_testing.py on lines 287..288

    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 39.

    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 3 locations. Consider refactoring.
    Open

                if (nb_test[3]>0):
                    print("Info Error: "+str(nb_test[3]))
    Severity: Major
    Found in testdata/lapack/lapack_testing.py and 2 other locations - About 1 hr to fix
    testdata/lapack/lapack_testing.py on lines 283..284
    testdata/lapack/lapack_testing.py on lines 285..286

    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 39.

    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.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++ {
    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 3 locations. Consider refactoring.
    Open

                if (nb_test[1]>0):
                    print("failing to pass the threshold: "+str(nb_test[1]))
    Severity: Major
    Found in testdata/lapack/lapack_testing.py and 2 other locations - About 1 hr to fix
    testdata/lapack/lapack_testing.py on lines 285..286
    testdata/lapack/lapack_testing.py on lines 287..288

    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 39.

    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

    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
        }
    Severity: Major
    Found in fortran/parser.go - About 50 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if counter == 0 {
                              break
                          }
      Severity: Major
      Found in fortran/parser.go - About 45 mins to fix

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

                percent_error=float(list_results[2][4]+list_results[3][4])/float(list_results[0][4])*100
        Severity: Major
        Found in testdata/lapack/lapack_testing.py and 2 other locations - About 45 mins to fix
        testdata/lapack/lapack_testing.py on lines 311..311
        testdata/lapack/lapack_testing.py on lines 321..321

        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 35.

        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

        Avoid deeply nested control flow statements.
        Open

                            if rightSeparator+1 < len(rightPart) &&
                                rightPart[rightSeparator+1].tok == token.LPAREN {
                                rightSeparator++
                                counter := 0
                                for {
        Severity: Major
        Found in fortran/util.go - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if par2, ok := par.X.(*goast.ParenExpr); ok {
                                      if st, ok := par2.X.(*goast.StarExpr); ok {
                                          call.Args[i] = st.X
                                      }
                                  }
          Severity: Major
          Found in fortran/function_definition.go - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if strings.Contains(v.typ.getBaseType(), "complex") {
                                    return true, true
                                } else {
                                    return false, true
                                }
            Severity: Major
            Found in fortran/expression.go - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                  if rightPart[rightSeparator].tok == token.LPAREN {
                                      counter++
                                  }
              Severity: Major
              Found in fortran/util.go - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if i+1 < len(fs) && fs[i+1].tok == token.INT {
                                        s += string(fs[i+1].b)
                                        i += 1
                                    }
                Severity: Major
                Found in fortran/io.go - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if !isDigit(e.Value.(*node).b[en]) {
                                          break
                                      }
                  Severity: Major
                  Found in fortran/scan.go - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if e.Value.(*node).b[en] == '.' {
                                            for en = en + 1; en < len(e.Value.(*node).b); en++ {
                                                if !isDigit(e.Value.(*node).b[en]) {
                                                    break
                                                }
                    Severity: Major
                    Found in fortran/scan.go - About 45 mins to fix

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

                          summary+=name+"\t"+str(list_results[0][dtype])+"\t\t"+str(list_results[1][dtype])+"\t("+"%.3f" % percent_num_error+"%)\t"+str(list_results[2][dtype]+list_results[3][dtype])+"\t("+"%.3f" % percent_error+"%)\t""\n"
                      Severity: Minor
                      Found in testdata/lapack/lapack_testing.py and 1 other location - About 45 mins to fix
                      testdata/lapack/lapack_testing.py on lines 300..300

                      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 35.

                      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

                      Avoid deeply nested control flow statements.
                      Open

                                              if len(arg.Name) > 3 && arg.Name[:2] == "&(" {
                                                  arg.Name = arg.Name[2 : len(arg.Name)-1]
                                                  continue
                                              }
                      Severity: Major
                      Found in fortran/function_definition.go - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if i+1 < len(fs) && fs[i+1].tok == token.INT {
                                                s += string(fs[i+1].b)
                                                i += 1
                                            }
                        Severity: Major
                        Found in fortran/io.go - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language