ali2210/WizDwarf

View on GitHub

Showing 170 of 170 total issues

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

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

        func messages(w http.ResponseWriter, r *http.Request) {
        
            temp := template.Must(template.ParseFiles("messages.html"))
            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 and 1 other location - About 2 hrs to fix
        main.go on lines 1710..1733

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

        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

        func terms(w http.ResponseWriter, r *http.Request) {
        
            temp := template.Must(template.ParseFiles("terms.html"))
        
            // user request headers
        Severity: Major
        Found in main.go and 1 other location - About 2 hrs to fix
        main.go on lines 805..825

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

        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

        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

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

          func Date(s string) (int, error) {
          
              if ok, err := regexp.MatchString("[0-9]+", s[8:9]); err == nil && !ok {
          
                  log.Fatalln(" Error date is not a valid", s[8:9])
          Severity: Major
          Found in other/date_time/date_time.go and 1 other location - About 2 hrs to fix
          other/date_time/date_time.go on lines 92..112

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

          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

          func Month(s string) (int, error) {
          
              if ok, err := regexp.MatchString("[0-9]+", s[5:7]); err == nil && !ok {
                  log.Fatalln(" Error month is not a valid", s[5:7])
                  return -1, err
          Severity: Major
          Found in other/date_time/date_time.go and 1 other location - About 2 hrs to fix
          other/date_time/date_time.go on lines 69..89

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

          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

          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

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

                func serine(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 and 20 other locations - About 2 hrs to fix
                main.go on lines 2459..2481
                main.go on lines 2483..2503
                main.go on lines 2505..2525
                main.go on lines 2527..2547
                main.go on lines 2549..2569
                main.go on lines 2571..2591
                main.go on lines 2615..2635
                main.go on lines 2637..2657
                main.go on lines 2659..2679
                main.go on lines 2681..2701
                main.go on lines 2703..2723
                main.go on lines 2724..2744
                main.go on lines 2746..2766
                main.go on lines 2768..2788
                main.go on lines 2790..2810
                main.go on lines 2812..2832
                main.go on lines 2834..2854
                main.go on lines 2856..2876
                main.go on lines 2878..2898
                main.go on lines 2900..2923

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

                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 21 locations. Consider refactoring.
                Open

                func cysteine(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 and 20 other locations - About 2 hrs to fix
                main.go on lines 2459..2481
                main.go on lines 2483..2503
                main.go on lines 2505..2525
                main.go on lines 2527..2547
                main.go on lines 2549..2569
                main.go on lines 2571..2591
                main.go on lines 2593..2613
                main.go on lines 2615..2635
                main.go on lines 2637..2657
                main.go on lines 2659..2679
                main.go on lines 2681..2701
                main.go on lines 2703..2723
                main.go on lines 2724..2744
                main.go on lines 2746..2766
                main.go on lines 2768..2788
                main.go on lines 2790..2810
                main.go on lines 2812..2832
                main.go on lines 2856..2876
                main.go on lines 2878..2898
                main.go on lines 2900..2923

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

                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 21 locations. Consider refactoring.
                Open

                func glutamine(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 and 20 other locations - About 2 hrs to fix
                main.go on lines 2459..2481
                main.go on lines 2483..2503
                main.go on lines 2505..2525
                main.go on lines 2527..2547
                main.go on lines 2549..2569
                main.go on lines 2571..2591
                main.go on lines 2593..2613
                main.go on lines 2615..2635
                main.go on lines 2637..2657
                main.go on lines 2659..2679
                main.go on lines 2681..2701
                main.go on lines 2703..2723
                main.go on lines 2746..2766
                main.go on lines 2768..2788
                main.go on lines 2790..2810
                main.go on lines 2812..2832
                main.go on lines 2834..2854
                main.go on lines 2856..2876
                main.go on lines 2878..2898
                main.go on lines 2900..2923

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

                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 21 locations. Consider refactoring.
                Open

                func arginine(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 and 20 other locations - About 2 hrs to fix
                main.go on lines 2459..2481
                main.go on lines 2483..2503
                main.go on lines 2505..2525
                main.go on lines 2527..2547
                main.go on lines 2549..2569
                main.go on lines 2571..2591
                main.go on lines 2593..2613
                main.go on lines 2615..2635
                main.go on lines 2637..2657
                main.go on lines 2659..2679
                main.go on lines 2681..2701
                main.go on lines 2703..2723
                main.go on lines 2724..2744
                main.go on lines 2746..2766
                main.go on lines 2768..2788
                main.go on lines 2790..2810
                main.go on lines 2812..2832
                main.go on lines 2834..2854
                main.go on lines 2856..2876
                main.go on lines 2900..2923

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

                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 21 locations. Consider refactoring.
                Open

                func methionine(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 and 20 other locations - About 2 hrs to fix
                main.go on lines 2459..2481
                main.go on lines 2483..2503
                main.go on lines 2505..2525
                main.go on lines 2527..2547
                main.go on lines 2571..2591
                main.go on lines 2593..2613
                main.go on lines 2615..2635
                main.go on lines 2637..2657
                main.go on lines 2659..2679
                main.go on lines 2681..2701
                main.go on lines 2703..2723
                main.go on lines 2724..2744
                main.go on lines 2746..2766
                main.go on lines 2768..2788
                main.go on lines 2790..2810
                main.go on lines 2812..2832
                main.go on lines 2834..2854
                main.go on lines 2856..2876
                main.go on lines 2878..2898
                main.go on lines 2900..2923

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

                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 21 locations. Consider refactoring.
                Open

                func isoleucine(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 and 20 other locations - About 2 hrs to fix
                main.go on lines 2459..2481
                main.go on lines 2483..2503
                main.go on lines 2505..2525
                main.go on lines 2549..2569
                main.go on lines 2571..2591
                main.go on lines 2593..2613
                main.go on lines 2615..2635
                main.go on lines 2637..2657
                main.go on lines 2659..2679
                main.go on lines 2681..2701
                main.go on lines 2703..2723
                main.go on lines 2724..2744
                main.go on lines 2746..2766
                main.go on lines 2768..2788
                main.go on lines 2790..2810
                main.go on lines 2812..2832
                main.go on lines 2834..2854
                main.go on lines 2856..2876
                main.go on lines 2878..2898
                main.go on lines 2900..2923

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

                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

                Severity
                Category
                Status
                Source
                Language