ali2210/WizDwarf

View on GitHub

Showing 170 of 170 total issues

Function GetCarbon has 197 lines of code (exceeds 50 allowed). Consider refactoring.
Open

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

    Function GetSulphur has 197 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

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

      Function GetHydrogen has 197 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func GetHydrogen(str string, i, j int) (int64, string) {
          switch str[i:j] {
          case "TTT":
              aminochain.Symbol = "F"
              aminochain.Hydrogen = 11
      Severity: Major
      Found in other/proteins/proteins.go - About 6 hrs to fix

        Function GetNitrogen has 197 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

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

          Function GetMagnetism has 195 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

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

            Function GetOxgygen has 195 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

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

              Function main has 193 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func main() {
              
                  // Server
              
                  host := os.Getenv("HOST")
              Severity: Major
              Found in main.go - About 6 hrs to fix

                Function GetMolarMass has 191 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

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

                  Function visualize has 189 lines of code (exceeds 50 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: Major
                  Found in main.go - About 6 hrs 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 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

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

                              if !protoimpl.UnsafeEnabled {
                                  file_other_proteins_binary_binary_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
                                      switch v := v.(*Element); i {
                                      case 0:
                                          return &v.state
                          Severity: Major
                          Found in other/proteins/binary/binary.pb.go and 1 other location - About 4 hrs to fix
                          other/genetic/binary/codebank.pb.go on lines 299..336

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

                          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

                              if !protoimpl.UnsafeEnabled {
                                  file_other_genetic_binary_codebank_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
                                      switch v := v.(*Lifecode); i {
                                      case 0:
                                          return &v.state
                          Severity: Major
                          Found in other/genetic/binary/codebank.pb.go and 1 other location - About 4 hrs to fix
                          other/proteins/binary/binary.pb.go on lines 325..362

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

                          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 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
                              Severity
                              Category
                              Status
                              Source
                              Language