untoreh/mtr-go

View on GitHub

Showing 167 of 167 total issues

File LanguageCode.go has 1625 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package tools

import (
    "log"
)
Severity: Major
Found in tools/LanguageCode.go - About 3 days to fix

    Method Ep.InitGoogle has a Cognitive Complexity of 78 (exceeds 20 allowed). Consider refactoring.
    Open

    func (se *Ep) InitGoogle(map[string]interface{}) {
        se.Name = "google"
        se.Limit = 1000
        se.Txtrq.SetRegex(&se.Name, se.Limit)
    
    
    Severity: Minor
    Found in services/Google.go - About 1 day 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 Ep.InitGoogle has 255 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (se *Ep) InitGoogle(map[string]interface{}) {
        se.Name = "google"
        se.Limit = 1000
        se.Txtrq.SetRegex(&se.Name, se.Limit)
    
    
    Severity: Major
    Found in services/Google.go - About 1 day to fix

      Method Mtr.PickService has a Cognitive Complexity of 51 (exceeds 20 allowed). Consider refactoring.
      Open

      func (mtr *Mtr) PickService(inputServices interface{}, source string, target string) string {
          // srvcs is the list of picked services
          var ci interface{}
          var ok bool
          s := &srvw{}
      Severity: Minor
      Found in Mtr.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

      Method Ep.InitYandex has 142 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (se *Ep) InitYandex(map[string]interface{}) {
          se.Name = "yandex"
          se.Limit = 500
          se.Txtrq.SetRegex(&se.Name, se.Limit)
      
      
      Severity: Major
      Found in services/Yandex.go - About 4 hrs to fix

        Method Ep.InitFrengly has 123 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (se *Ep) InitFrengly(map[string]interface{}) {
            se.Name = "frengly"
            se.Limit = 1000
            se.Txtrq.SetRegex(&se.Name, se.Limit)
        
        
        Severity: Major
        Found in services/Frengly.go - About 3 hrs to fix

          Method Ep.InitYandex has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring.
          Open

          func (se *Ep) InitYandex(map[string]interface{}) {
              se.Name = "yandex"
              se.Limit = 500
              se.Txtrq.SetRegex(&se.Name, se.Limit)
          
          
          Severity: Minor
          Found in services/Yandex.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

          Method Ep.InitSystran has 120 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func (se *Ep) InitSystran(options map[string]interface{}) {
              se.Name = "systran"
              se.Limit = 1000
              se.Txtrq.SetRegex(&se.Name, se.Limit)
          
          
          Severity: Major
          Found in services/Systran.go - About 3 hrs to fix

            Method Ep.InitPromt has 111 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func (se *Ep) InitPromt(map[string]interface{}) {
                se.Name = "promt"
                se.Limit = 1000
                se.Txtrq.SetRegex(&se.Name, se.Limit)
            
            
            Severity: Major
            Found in services/Promt.go - About 3 hrs to fix

              Function TestTextReq_Pt has 87 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func TestTextReq_Pt(t *testing.T) {
                  s := `
                  As in the hurricane that sweeps the plain, men fly the neighborhood of some.
                  `
                  m := `
              Severity: Major
              Found in tools/tools_test.go - About 2 hrs to fix

                Method Ep.InitBing has 86 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

                func (se *Ep) InitBing(map[string]interface{}) {
                    se.Name = "bing"
                    se.Limit = 1000
                    se.Txtrq.SetRegex(&se.Name, se.Limit)
                
                
                Severity: Major
                Found in services/Bing.go - About 2 hrs to fix

                  Method Ep.InitMultillect has 86 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (se *Ep) InitMultillect(map[string]interface{}) {
                      se.Name = "multillect"
                      se.Limit = 1000
                      se.Txtrq.SetRegex(&se.Name, se.Limit)
                  
                  
                  Severity: Major
                  Found in services/Multillect.go - About 2 hrs to fix

                    Method Ep.RetReqs has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
                    Open

                    func (ep *Ep) RetReqs(dst interface{}, tp string, verb string, url string, reqs map[int]*grequests.RequestOptions) interface{} {
                        l := len(reqs)
                        cr := make(chan kr)
                    
                        if l == 0 {
                    Severity: Minor
                    Found in services/Ep.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

                    Method Ep.RetReqs has 64 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                    func (ep *Ep) RetReqs(dst interface{}, tp string, verb string, url string, reqs map[int]*grequests.RequestOptions) interface{} {
                        l := len(reqs)
                        cr := make(chan kr)
                    
                        if l == 0 {
                    Severity: Minor
                    Found in services/Ep.go - About 1 hr to fix

                      Method Ep.InitGoogle has 16 return statements (exceeds 4 allowed).
                      Open

                      func (se *Ep) InitGoogle(map[string]interface{}) {
                          se.Name = "google"
                          se.Limit = 1000
                          se.Txtrq.SetRegex(&se.Name, se.Limit)
                      
                      
                      Severity: Major
                      Found in services/Google.go - About 1 hr to fix

                        Method Mtr.PickService has 62 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

                        func (mtr *Mtr) PickService(inputServices interface{}, source string, target string) string {
                            // srvcs is the list of picked services
                            var ci interface{}
                            var ok bool
                            s := &srvw{}
                        Severity: Minor
                        Found in Mtr.go - About 1 hr to fix

                          Method Mtr.MakeServices has 55 lines of code (exceeds 50 allowed). Consider refactoring.
                          Open

                          func (mtr *Mtr) MakeServices() {
                              // http client
                              if _, ok := mtr.options["httpClient"]; ok {
                                  mergo.Merge(&mtr.httpClient, mtr.options["httpClient"])
                              }
                          Severity: Minor
                          Found in Mtr.go - About 1 hr to fix

                            Method Ep.InitFrengly has 7 return statements (exceeds 4 allowed).
                            Open

                            func (se *Ep) InitFrengly(map[string]interface{}) {
                                se.Name = "frengly"
                                se.Limit = 1000
                                se.Txtrq.SetRegex(&se.Name, se.Limit)
                            
                            
                            Severity: Major
                            Found in services/Frengly.go - About 45 mins to fix

                              Method Ep.GenQ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              func (ep *Ep) GenQ(source string, target string, input t.SMII, order t.MISI, genReqFun i.Genreq, req *grequests.RequestOptions) (inputs map[int]*grequests.RequestOptions, str_ar []interface{}) {
                              Severity: Minor
                              Found in services/Ep.go - About 45 mins to fix

                                Method Ep.InitMultillect has 7 return statements (exceeds 4 allowed).
                                Open

                                func (se *Ep) InitMultillect(map[string]interface{}) {
                                    se.Name = "multillect"
                                    se.Limit = 1000
                                    se.Txtrq.SetRegex(&se.Name, se.Limit)
                                
                                
                                Severity: Major
                                Found in services/Multillect.go - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language