schmurfy / chipi

Function with cyclomatic complexity higher than threshold GO-R1005
Anti-pattern
Minor
20 days ago2 months old
func convertValue has a cyclomatic complexity of 23 with "high" risk
 23	_noValue = reflect.Value{}
 24)
 25
 26func convertValue(fieldType reflect.Type, value string) (reflect.Value, error) { 27	switch fieldType.Kind() {
 28	case reflect.Ptr:
 29		fieldType := fieldType.Elem()
func createFilledRequestObject has a cyclomatic complexity of 23 with "high" risk
121	return nil
122}
123
124func createFilledRequestObject(r *http.Request, obj interface{}, parsingErrors map[string]string) (ret reflect.Value, response reflect.Value, err error) {125	typ := reflect.TypeOf(obj)
126
127	if typ.Kind() == reflect.Ptr {
func ParseJsonTag has a cyclomatic complexity of 20 with "high" risk
25	Style       *string
26}
27
28func ParseJsonTag(f reflect.StructField) *jsonTag {29	ret := &jsonTag{
30		Name: f.Name,
31	}
func generateStructureSchema has a cyclomatic complexity of 28 with "very-high" risk
255	return pkgName(t.PkgPath())
256}
257
258func (s *Schema) generateStructureSchema(ctx context.Context, doc *openapi3.T, t reflect.Type, inlineLevel int, fieldInfo shared.AttributeInfo, callbacksObject shared.ChipiCallbacks) (*openapi3.Schema, error) {259	ret := &openapi3.Schema{
260		Type: "object",
261	}
func generateSchemaFor has a cyclomatic complexity of 28 with "very-high" risk
 65	}, nil
 66}
 67
 68func (s *Schema) generateSchemaFor(ctx context.Context, doc *openapi3.T, t reflect.Type, inlineLevel int, fieldInfo shared.AttributeInfo, callbacksObject shared.ChipiCallbacks) (*openapi3.SchemaRef, error) { 69	fullName := typeName(t)
 70
 71	if !fieldInfo.Empty() {