thestrukture/IDE

View on GitHub

Showing 44 of 1,416 total issues

Function fApiGet has a Cognitive Complexity of 222 (exceeds 20 allowed). Consider refactoring.
Open

func fApiGet(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {

    me := types.SoftUser{Email: "Strukture user", Username: "Strukture user"}
    if r.FormValue("type") == "0" {

Severity: Minor
Found in api/handlers/middleware_fApiGet.go - About 4 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

Function fApiGet has 359 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func fApiGet(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {

    me := types.SoftUser{Email: "Strukture user", Username: "Strukture user"}
    if r.FormValue("type") == "0" {

Severity: Major
Found in api/handlers/middleware_fApiGet.go - About 1 day to fix

    Function GETApiBuild has a Cognitive Complexity of 97 (exceeds 20 allowed). Consider refactoring.
    Open

    func GETApiBuild(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {
    
        gp := os.ExpandEnv("$GOPATH")
    
        os.Chdir(gp + "/src/" + r.FormValue("pkg"))
    Severity: Minor
    Found in api/handlers/rest_GETApiBuild.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

    Function POSTApiAct has a Cognitive Complexity of 75 (exceeds 20 allowed). Consider refactoring.
    Open

    func POSTApiAct(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {
    
        if r.FormValue("type") == "0" {
            apps := methods.GetApps()
            app := types.App{Type: "webapp", Name: r.FormValue("name")}
    Severity: Minor
    Found in api/handlers/rest_POSTApiAct.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

    Function POSTApiDelete has a Cognitive Complexity of 70 (exceeds 20 allowed). Consider refactoring.
    Open

    func POSTApiDelete(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {
    
        if r.FormValue("type") == "0" {
    
            //type pkg id
    Severity: Minor
    Found in api/handlers/rest_POSTApiDelete.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

    Function ApiAttempt has a Cognitive Complexity of 59 (exceeds 20 allowed). Consider refactoring.
    Open

    func ApiAttempt(w http.ResponseWriter, r *http.Request) (callmet bool) {
        var response string
        var session *sessions.Session
    
        var er error
    Severity: Minor
    Found in api/handlers/endpoints.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

    Function DebugTemplate has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
    Open

    func DebugTemplate(w http.ResponseWriter, r *http.Request, tmpl string) {
        lastline := 0
        linestring := ""
        defer func() {
            if n := recover(); n != nil {
    Severity: Minor
    Found in api/templates/logger.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 DebugTemplatePath has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring.
    Open

    func DebugTemplatePath(tmpl string, intrf interface{}) {
        lastline := 0
        linestring := ""
        defer func() {
            if n := recover(); n != nil {
    Severity: Minor
    Found in api/templates/logger.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 POSTApiAct has 158 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func POSTApiAct(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {
    
        if r.FormValue("type") == "0" {
            apps := methods.GetApps()
            app := types.App{Type: "webapp", Name: r.FormValue("name")}
    Severity: Major
    Found in api/handlers/rest_POSTApiAct.go - About 5 hrs to fix

      Function POSTApiDelete has 130 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func POSTApiDelete(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {
      
          if r.FormValue("type") == "0" {
      
              //type pkg id
      Severity: Major
      Found in api/handlers/rest_POSTApiDelete.go - About 4 hrs to fix

        Function GETApiBuild has 121 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func GETApiBuild(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {
        
            gp := os.ExpandEnv("$GOPATH")
        
            os.Chdir(gp + "/src/" + r.FormValue("pkg"))
        Severity: Major
        Found in api/handlers/rest_GETApiBuild.go - About 3 hrs to fix

          Function POSTApiPut has 100 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func POSTApiPut(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {
          
              me := types.SoftUser{Email: "Strukture user", Username: "Strukture user"}
          
              if r.FormValue("type") == "0" {
          Severity: Major
          Found in api/handlers/rest_POSTApiPut.go - About 3 hrs to fix

            Function DebugTemplate has 85 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func DebugTemplate(w http.ResponseWriter, r *http.Request, tmpl string) {
                lastline := 0
                linestring := ""
                defer func() {
                    if n := recover(); n != nil {
            Severity: Major
            Found in api/templates/logger.go - About 2 hrs to fix

              Function fApiSearch_project has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring.
              Open

              func fApiSearch_project(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {
              
                  path := filepath.Join(os.ExpandEnv("$GOPATH"), "src", r.FormValue("pkg"), r.FormValue("path"))
                  search := r.FormValue("text")
              
              
              Severity: Minor
              Found in api/handlers/middleware_fApiSearch_project.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 LaunchServer has 81 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func LaunchServer() {
              
                  globals.Dfd = os.ExpandEnv("$GOPATH")
                  globals.Windows = strings.Contains(runtime.GOOS, "windows")
                  trailerEx := ""
              Severity: Major
              Found in launcher.go - About 2 hrs to fix

                Function ApiAttempt has 78 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func ApiAttempt(w http.ResponseWriter, r *http.Request) (callmet bool) {
                    var response string
                    var session *sessions.Session
                
                    var er error
                Severity: Major
                Found in api/handlers/endpoints.go - About 2 hrs to fix

                  Function DebugTemplatePath has 78 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func DebugTemplatePath(tmpl string, intrf interface{}) {
                      lastline := 0
                      linestring := ""
                      defer func() {
                          if n := recover(); n != nil {
                  Severity: Major
                  Found in api/templates/logger.go - About 2 hrs to fix

                    Function fApiSearch_project has 76 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func fApiSearch_project(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {
                    
                        path := filepath.Join(os.ExpandEnv("$GOPATH"), "src", r.FormValue("pkg"), r.FormValue("path"))
                        search := r.FormValue("text")
                    
                    
                    Severity: Major
                    Found in api/handlers/middleware_fApiSearch_project.go - About 2 hrs to fix

                      Function LaunchServer has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
                      Open

                      func LaunchServer() {
                      
                          globals.Dfd = os.ExpandEnv("$GOPATH")
                          globals.Windows = strings.Contains(runtime.GOOS, "windows")
                          trailerEx := ""
                      Severity: Minor
                      Found in launcher.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

                      Function ApiTerminal_realtime has 58 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func ApiTerminal_realtime(w http.ResponseWriter, r *http.Request, session *sessions.Session) (response string, callmet bool) {
                      
                          c, err := globals.Upgrader.Upgrade(w, r, nil)
                          if err != nil {
                              log.Print("upgrade:", err)
                      Severity: Minor
                      Found in api/handlers/rest_ApiTerminal_realtime.go - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language