ali2210/WizDwarf

View on GitHub

Showing 82 of 170 total issues

Function visualize has a Cognitive Complexity of 55 (exceeds 20 allowed). Consider refactoring.
Open

func visualize(w http.ResponseWriter, r *http.Request) {

    w.Header().Set("Access-Control-Allow-Origin", "*")
    w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
    w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length")
Severity: Minor
Found in main.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 FirestoreClient.SearchUser has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring.
Open

func (fire *FirestoreClient) SearchUser(client *firestore.Client, member user.New_User) (*Doc_Response, error) {

    var profile_search map[string]interface{}

    ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
Severity: Minor
Found in other/users/adduser.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 update has 164 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func update(w http.ResponseWriter, r *http.Request) {

    w.Header().Set("Access-Control-Allow-Origin", "*")
    w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
    w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length")
Severity: Major
Found in main.go - About 5 hrs to fix

    Function AvatarUpload has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring.
    Open

    func AvatarUpload(r *http.Request, user_id string) (string, error) {
    
        //  Set the buffer size for the picture file contents
        r.ParseMultipartForm(10 << 50)
    
    
    Severity: Minor
    Found in piplines/dep_functions.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

    Function ProteinsCryptoSignature has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring.
    Open

    func ProteinsCryptoSignature(value int64) (*DocumentCredentials, int64, error) {
    
        content, err := GetQProteins(value)
        if err != nil {
            log.Fatalln("Error:", error_codes.Operation_ERROR_CODE_UNEXPECTED_STATE)
    Severity: Minor
    Found in piplines/dep_functions.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

    Function Class has 133 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func Class(s string, i, j int) string {
        switch s[i:j] {
        case "TTT":
            aminochain.Symbol = "F"
    
    
    Severity: Major
    Found in other/proteins/proteins.go - About 4 hrs to fix

      Method FirestoreClient.SearchUser has 120 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (fire *FirestoreClient) SearchUser(client *firestore.Client, member user.New_User) (*Doc_Response, error) {
      
          var profile_search map[string]interface{}
      
          ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
      Severity: Major
      Found in other/users/adduser.go - About 3 hrs to fix

        Function dvault has 117 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func dvault(w http.ResponseWriter, r *http.Request) {
        
            // user request headers
            w.Header().Set("Access-Control-Allow-Origin", "*")
            w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
        Severity: Major
        Found in main.go - About 3 hrs to fix

          Updated_User has 29 methods (exceeds 20 allowed). Consider refactoring.
          Open

          type Updated_User struct {
              ID              string       `protobuf:"bytes,1,opt,name=ID,json=iD" json:"ID,omitempty"`
              Name            string       `protobuf:"bytes,2,opt,name=Name,json=name" json:"Name,omitempty"`
              Email           string       `protobuf:"bytes,3,opt,name=Email,json=email" json:"Email,omitempty"`
              Phone           string       `protobuf:"bytes,4,opt,name=Phone,json=phone" json:"Phone,omitempty"`
          Severity: Minor
          Found in other/users/register/register.pb.go - About 3 hrs to fix

            Function dvault has a Cognitive Complexity of 39 (exceeds 20 allowed). Consider refactoring.
            Open

            func dvault(w http.ResponseWriter, r *http.Request) {
            
                // user request headers
                w.Header().Set("Access-Control-Allow-Origin", "*")
                w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
            Severity: Minor
            Found in main.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 analysis has 108 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func analysis(w http.ResponseWriter, r *http.Request) {
            
                w.Header().Set("Access-Control-Allow-Origin", "*")
                w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
                w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length")
            Severity: Major
            Found in main.go - About 3 hrs to fix

              Function newUser has 95 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func newUser(w http.ResponseWriter, r *http.Request) {
              
                  // user request headers
                  w.Header().Set("Access-Control-Allow-Origin", "*")
                  w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
              Severity: Major
              Found in main.go - About 2 hrs to fix

                Function analysis has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring.
                Open

                func analysis(w http.ResponseWriter, r *http.Request) {
                
                    w.Header().Set("Access-Control-Allow-Origin", "*")
                    w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
                    w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length")
                Severity: Minor
                Found in main.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 ProteinsCryptoSignature has 89 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func ProteinsCryptoSignature(value int64) (*DocumentCredentials, int64, error) {
                
                    content, err := GetQProteins(value)
                    if err != nil {
                        log.Fatalln("Error:", error_codes.Operation_ERROR_CODE_UNEXPECTED_STATE)
                Severity: Major
                Found in piplines/dep_functions.go - About 2 hrs to fix

                  Function dashboard has 27 return statements (exceeds 4 allowed).
                  Open

                  func dashboard(w http.ResponseWriter, r *http.Request) {
                  
                      // user request headers
                      w.Header().Set("Access-Control-Allow-Origin", "*")
                      w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
                  Severity: Major
                  Found in main.go - About 2 hrs to fix

                    Function file_other_collection_gallery_proto_init has 83 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func file_other_collection_gallery_proto_init() {
                        if File_other_collection_gallery_proto != nil {
                            return
                        }
                        if !protoimpl.UnsafeEnabled {
                    Severity: Major
                    Found in other/collection/gallery.pb.go - About 2 hrs to fix

                      Function AvatarUpload has 25 return statements (exceeds 4 allowed).
                      Open

                      func AvatarUpload(r *http.Request, user_id string) (string, error) {
                      
                          //  Set the buffer size for the picture file contents
                          r.ParseMultipartForm(10 << 50)
                      
                      
                      Severity: Major
                      Found in piplines/dep_functions.go - About 2 hrs to fix

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

                        func main() {
                        
                            // Server
                        
                            host := os.Getenv("HOST")
                        Severity: Minor
                        Found in main.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 view has 23 return statements (exceeds 4 allowed).
                        Open

                        func view(w http.ResponseWriter, r *http.Request) {
                        
                            w.Header().Set("Access-Control-Allow-Origin", "*")
                            w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
                            w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length")
                        Severity: Major
                        Found in main.go - About 2 hrs to fix

                          Method Datecenter.GetAll has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring.
                          Open

                          func (c *Datecenter) GetAll(it int64) ([]map[string]interface{}, error) {
                          
                              var document []map[string]interface{}
                              query, err := c.Client.CollectionGroup("Proteins").GetPartitionedQueries(c.Ctx, 10)
                              if err != nil {
                          Severity: Minor
                          Found in other/cloudmedia/cloudmedia.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