Showing 167 of 167 total issues
File LanguageCode.go
has 1625 lines of code (exceeds 500 allowed). Consider refactoring. Open
package tools
import (
"log"
)
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)
- Read upRead up
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)
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{}
- Read upRead up
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)
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)
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)
- Read upRead up
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)
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)
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 := `
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)
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)
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 {
- Read upRead up
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 {
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)
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{}
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"])
}
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)
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{}) {
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)