ali2210/WizDwarf

View on GitHub
piplines/dep_functions.go

Summary

Maintainability
F
4 days
Test Coverage

File dep_functions.go has 868 lines of code (exceeds 500 allowed). Consider refactoring.
Open

/* This codebase desgin according to mozilla open source license.
Redistribution , contribution and improve codebase under license
convensions. @contact Ali Hassan AliMatrixCode@protonmail.com */

// Package or module
Severity: Major
Found in piplines/dep_functions.go - About 1 day to fix

    Function AvatarUpload has 179 lines of code (exceeds 50 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: Major
    Found in piplines/dep_functions.go - About 6 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 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 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 Mounted has 10 return statements (exceeds 4 allowed).
          Open

          func Mounted(w http.ResponseWriter, r *http.Request) (string, error) {
              r.ParseMultipartForm(10 << 50)
          
              var upldFile *os.File = nil
              file, handler, err := r.FormFile("fileSeq")
          Severity: Major
          Found in piplines/dep_functions.go - About 1 hr to fix

            Function ProteinsCryptoSignature has 7 return statements (exceeds 4 allowed).
            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 45 mins to fix

              Function TrustRequest has 6 return statements (exceeds 4 allowed).
              Open

              func TrustRequest(message, verifier, request string) (bool, *ed25519.PrivateKey, error) {
              
                  // contain check whether request have pass-key ,
                  // address contain address of trusted user wallet
                  //  & message must not be empty
              Severity: Major
              Found in piplines/dep_functions.go - About 40 mins to fix

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

                func Data_Predicition(w http.ResponseWriter, r *http.Request, fname, choose string, file *os.File, algo info.Levenshtein) error {
                Severity: Minor
                Found in piplines/dep_functions.go - About 35 mins to fix

                  Function AddNewProfile has 5 return statements (exceeds 4 allowed).
                  Open

                  func AddNewProfile(response http.ResponseWriter, request *http.Request, add user.New_User) (*firestore.DocumentRef, bool, error) {
                  
                      // var member user.New_User
                      var document *firestore.DocumentRef
                      var err error
                  Severity: Major
                  Found in piplines/dep_functions.go - About 35 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status