ali2210/WizDwarf

View on GitHub

Showing 170 of 170 total issues

Avoid deeply nested control flow statements.
Open

                if err != nil {
                    return
                }
Severity: Major
Found in main.go - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    if err != nil {
                        return
                    }
    Severity: Major
    Found in main.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 profile has 6 return statements (exceeds 4 allowed).
        Open

        func profile(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 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

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

            func Mass(molecule *binary.Micromolecule) float64 {
            
                mass := 0.00
                if reflect.ValueOf(molecule).Elem().Kind() == reflect.Struct {
                    mass = reflect.ValueOf(molecule).Elem().Field(4).Float()
            Severity: Minor
            Found in other/molecules/molecules.go and 2 other locations - About 35 mins to fix
            other/molecules/molecules.go on lines 151..159
            other/molecules/molecules.go on lines 231..238

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

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

            func Make_string(chain *binary.Micromolecule) string {
            
                symbols := ""
                if reflect.ValueOf(chain).Elem().Kind() == reflect.Struct {
                    symbols = reflect.ValueOf(chain).Elem().Field(3).String()
            Severity: Minor
            Found in other/molecules/molecules.go and 2 other locations - About 35 mins to fix
            other/molecules/molecules.go on lines 151..159
            other/molecules/molecules.go on lines 162..169

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

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

            func Symbol(molecule *binary.Micromolecule) string {
            
                symbol := ""
                if reflect.ValueOf(molecule).Elem().Kind() == reflect.Struct {
            
            
            Severity: Minor
            Found in other/molecules/molecules.go and 2 other locations - About 35 mins to fix
            other/molecules/molecules.go on lines 162..169
            other/molecules/molecules.go on lines 231..238

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

            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 BucketObject.DownloadObject has 5 return statements (exceeds 4 allowed).
            Open

            func (boj *BucketObject) DownloadObject(project *uplink.Project) *bucket.Bucket_Error {
            
                downObj, err := project.StatObject(boj.Ctx, boj.Bucket, boj.Key)
                if err != nil {
            
            
            Severity: Major
            Found in other/bucket/storj_bucket/storj_bucket.go - About 35 mins to fix

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

              func Metadata(filename, key, ownership string, client *firestore.Client) int {
              
                  if reflect.DeepEqual(ownership, "") {
              
                      log.Fatalln("Empty ownership:", ownership)
              Severity: Major
              Found in other/parser/parse_image/parse_image.go - About 35 mins to fix

                Method BucketObject.StoreJCredentials has 5 return statements (exceeds 4 allowed).
                Open

                func (boj *BucketObject) StoreJCredentials(user_phrase string, passphrase ...string) (*bucket.Bucket_Error, *uplink.Access) {
                
                    const api_key string = "1dfJiTZDDGnTZ9gCmZDAFDp1gLCBSsijs838VhzgskptVYifaWwwDwE51cAqTwATc1L7wwfaQ8Jz723JMLjEvFntG6ZccHwgm7GpvaqCABtFMh4rtU2K"
                    const address string = "12L9ZFwhzVpuEKMUNUqkaTLGzwY9G24tbiigLiXpmZWKwmcNDDs@eu1.storj.io:7777"
                
                
                Severity: Major
                Found in other/bucket/storj_bucket/storj_bucket.go - About 35 mins to fix

                  Method Gallery_Stream_Server.SearchPictures has 5 return statements (exceeds 4 allowed).
                  Open

                  func (c *Gallery_Stream_Server) SearchPictures(ctx context.Context, compress *Compressed) *ContentRoute {
                  
                      // if no data will provided by the client then throw error
                      if reflect.DeepEqual(compress, &Compressed{}) {
                          return &ContentRoute{UserAgentId: "", IsP2PAddress: false}
                  Severity: Major
                  Found in other/collection/gallery_service.go - About 35 mins to fix

                    Method DLINK_Object.Preview_Get has 5 return statements (exceeds 4 allowed).
                    Open

                    func (o *DLINK_Object) Preview_Get(filename string, link ...string) (dlink.PreviewLink, dlink.Errors) {
                    
                        if errs := o.Get(filename, link...); errs != dlink.Errors_NONE {
                            return dlink.PreviewLink{}, errs
                        }
                    Severity: Major
                    Found in other/cloudmedia/dlink.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

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

                        func FilePrints(prints ...string) (map[string]string, linkcid.Cid) {
                        
                            nullify := map[string]string{}
                            hash_data := sha256.Sum256([]byte(prints[0]))
                        
                        
                        Severity: Major
                        Found in other/crypto/crypto.go - About 35 mins to fix

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

                          func CreateFile(filename ...string) (*os.File, error) {
                          
                              if _, err := os.Stat(filename[0]); os.IsExist(err) {
                                  return &os.File{}, err
                              }
                          Severity: Major
                          Found in other/parser/parser.go - About 35 mins to fix

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

                                    if err != nil {
                                        w.WriteHeader(http.StatusBadRequest)
                                        distorted(w, r)
                                        cacheObject.Set_Key("Internal:", err.Error())
                            
                            
                            Severity: Minor
                            Found in main.go and 1 other location - About 35 mins to fix
                            main.go on lines 1885..1899

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

                            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 err != nil {
                            
                                        w.WriteHeader(http.StatusBadRequest)
                                        distorted(w, r)
                                        cacheObject.Set_Key("Internal:", err.Error())
                            Severity: Minor
                            Found in main.go and 1 other location - About 35 mins to fix
                            main.go on lines 1910..1923

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

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

                                case "GAT":
                                    aminochain.Symbol = "D"
                                    aminochain.Mass = 133.103
                                    aminochain.Acidity_a = "1.99"
                                    aminochain.Acidity_b = "9.90" + "*/sc" + "3.90" //*/sc means side-chain pk_A
                            Severity: Major
                            Found in other/proteins/proteins.go and 9 other locations - About 30 mins to fix
                            other/proteins/proteins.go on lines 2970..2980
                            other/proteins/proteins.go on lines 2982..2992
                            other/proteins/proteins.go on lines 2994..3004
                            other/proteins/proteins.go on lines 3054..3064
                            other/proteins/proteins.go on lines 3066..3076
                            other/proteins/proteins.go on lines 3078..3088
                            other/proteins/proteins.go on lines 3090..3100
                            other/proteins/proteins.go on lines 3126..3136
                            other/proteins/proteins.go on lines 3138..3148

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

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

                                case "GAA":
                                    aminochain.Symbol = "E"
                                    aminochain.Mass = 147.130
                                    aminochain.Acidity_a = "2.10"
                                    aminochain.Acidity_b = "9.47" + "*/sc" + "4.07"
                            Severity: Major
                            Found in other/proteins/proteins.go and 9 other locations - About 30 mins to fix
                            other/proteins/proteins.go on lines 2958..2968
                            other/proteins/proteins.go on lines 2970..2980
                            other/proteins/proteins.go on lines 2994..3004
                            other/proteins/proteins.go on lines 3054..3064
                            other/proteins/proteins.go on lines 3066..3076
                            other/proteins/proteins.go on lines 3078..3088
                            other/proteins/proteins.go on lines 3090..3100
                            other/proteins/proteins.go on lines 3126..3136
                            other/proteins/proteins.go on lines 3138..3148

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

                            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