Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
6 months ago8 months old
func Bootstrap has a cyclomatic complexity of 57 with "critical" risk
121}
122
123// Bootstrap Bootstrap for models
124func (mc *ModelCache) Bootstrap() {125	mc.Lock()
126	defer mc.Unlock()
127	if mc.done {
func ReadValues has a cyclomatic complexity of 31 with "very-high" risk
1892}
1893
1894// ReadValues query sql, read values , save to *[]ParamList.
1895func (d *dbBase) ReadValues(ctx context.Context, q dbQuerier, qs *querySet, mi *models.ModelInfo, cond *Condition, exprs []string, container interface{}, tz *time.Location) (int64, error) {1896	var (
1897		maps  []Params
1898		lists []ParamsList
func setFieldValue has a cyclomatic complexity of 73 with "critical" risk
1701}
1702
1703// Set one value to struct column field.
1704func (d *dbBase) setFieldValue(fi *models.FieldInfo, value interface{}, field reflect.Value) (interface{}, error) {1705	fieldType := fi.FieldType
1706	isNative := !fi.IsFielder
1707
func convertValueFromDB has a cyclomatic complexity of 57 with "critical" risk
1537}
1538
1539// convert value from database result to value following in field type.
1540func (d *dbBase) convertValueFromDB(fi *models.FieldInfo, val interface{}, tz *time.Location) (interface{}, error) {1541	if val == nil {
1542		return nil, nil
1543	}
func GenerateOperatorSQL has a cyclomatic complexity of 18 with "high" risk
1450}
1451
1452// GenerateOperatorSQL generate sql with replacing operator string placeholders and replaced values.
1453func (d *dbBase) GenerateOperatorSQL(mi *models.ModelInfo, fi *models.FieldInfo, operator string, args []interface{}, tz *time.Location) (string, []interface{}) {1454	var sql string
1455	params := getFlatParams(fi, args, tz)
1456