nlpodyssey/spago

View on GitHub

Showing 23 of 23 total issues

Function processOptions has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
Open

func processOptions() {
    env := os.Getenv("GODEBUG")
field:
    for env != "" {
        field := ""
Severity: Minor
Found in mat/internal/matfuncs/cpu/cpu.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 parseARM64SystemRegisters has 80 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {
    // ID_AA64ISAR0_EL1
    switch extractBits(isar0, 4, 7) {
    case 1:
        ARM64.HasAES = true
Severity: Major
Found in mat/internal/matfuncs/cpu/cpu_arm64.go - About 2 hrs to fix

    Function archInit has 62 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func archInit() {
    
        Initialized = true
    
        maxID, _, _, _ := cpuid(0, 0)
    Severity: Minor
    Found in mat/internal/matfuncs/cpu/cpu_x86.go - About 1 hr to fix

      Function processOptions has 59 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func processOptions() {
          env := os.Getenv("GODEBUG")
      field:
          for env != "" {
              field := ""
      Severity: Minor
      Found in mat/internal/matfuncs/cpu/cpu.go - About 1 hr to fix

        Function GemvN has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func GemvN(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) {
        Severity: Major
        Found in mat/internal/f64/asm64/ge_noasm.go - About 1 hr to fix

          Function GemvT has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func GemvT(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr)
          Severity: Major
          Found in mat/internal/f64/asm64/ge_amd64.go - About 1 hr to fix

            Function GemvN has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func GemvN(m, n uintptr, alpha float32, a []float32, lda uintptr, x []float32, incX uintptr, beta float32, y []float32, incY uintptr) {
            Severity: Major
            Found in mat/internal/f32/asm32/gemv.go - About 1 hr to fix

              Function GemvT has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func GemvT(m, n uintptr, alpha float32, a []float32, lda uintptr, x []float32, incX uintptr, beta float32, y []float32, incY uintptr) {
              Severity: Major
              Found in mat/internal/f32/asm32/gemv.go - About 1 hr to fix

                Function GemvT has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func GemvT(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) {
                Severity: Major
                Found in mat/internal/f64/asm64/ge_noasm.go - About 1 hr to fix

                  Function GemvN has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  func GemvN(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr)
                  Severity: Major
                  Found in mat/internal/f64/asm64/ge_amd64.go - About 1 hr to fix

                    Function Ger has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    func Ger(m, n uintptr, alpha float32,
                        x []float32, incX uintptr,
                        y []float32, incY uintptr,
                        a []float32, lda uintptr)
                    Severity: Major
                    Found in mat/internal/f32/asm32/ge_amd64.go - About 1 hr to fix

                      Function Ger has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      func Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, incY uintptr, a []float64, lda uintptr)
                      Severity: Major
                      Found in mat/internal/f64/asm64/ge_amd64.go - About 1 hr to fix

                        Function Ger has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        func Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, incY uintptr, a []float64, lda uintptr) {
                        Severity: Major
                        Found in mat/internal/f64/asm64/ge_noasm.go - About 1 hr to fix

                          Function Ger has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          func Ger(m, n uintptr, alpha float32, x []float32, incX uintptr, y []float32, incY uintptr, a []float32, lda uintptr) {
                          Severity: Major
                          Found in mat/internal/f32/asm32/ge_noasm.go - About 1 hr to fix

                            Function Log32 has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
                            Open

                            func Log32(x, y []float32) {
                                if len(x) == 0 {
                                    return
                                }
                            
                            
                            Severity: Minor
                            Found in mat/internal/matfuncs/log_amd64.go - About 45 mins 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 AxpyIncTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            func AxpyIncTo(dst []float32, incDst, idst uintptr, alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) {
                            Severity: Minor
                            Found in mat/internal/f32/asm32/stubs_noasm.go - About 35 mins to fix

                              Function ScalIncTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              func ScalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr) {
                              Severity: Minor
                              Found in mat/internal/f64/asm64/scal.go - About 35 mins to fix

                                Function ScalIncTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                func ScalIncTo(dst []float32, incDst uintptr, alpha float32, x []float32, n, incX uintptr) {
                                Severity: Minor
                                Found in mat/internal/f32/asm32/scal.go - About 35 mins to fix

                                  Function ScalIncTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  func ScalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr)
                                  Severity: Minor
                                  Found in mat/internal/f64/asm64/stubs_amd64.go - About 35 mins to fix

                                    Function AxpyIncTo has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                    func AxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) {
                                    Severity: Minor
                                    Found in mat/internal/f64/asm64/axpy.go - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language