Showing 7 of 13 total issues
UserQuerySet
has 68 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type UserQuerySet struct {
db *gorm.DB
}
Method InfoGenerator.GenFieldInfo
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (g InfoGenerator) GenFieldInfo(f Field) *Info {
tagSetting := parseTagSetting(f.Tag())
if tagSetting["-"] != "" { // skipped by tag field
return nil
}
Method InfoGenerator.GenFieldInfo
has 8 return statements (exceeds 4 allowed). Open
Open
func (g InfoGenerator) GenFieldInfo(f Field) *Info {
tagSetting := parseTagSetting(f.Tag())
if tagSetting["-"] != "" { // skipped by tag field
return nil
}
Method Generator.writeQuerySetsToOutput
has 6 return statements (exceeds 4 allowed). Open
Open
func (g Generator) writeQuerySetsToOutput(r io.Reader, packageName, outFile string) error {
const hdrTmpl = `%s
package %s
import (
Method Generator.Generate
has 5 return statements (exceeds 4 allowed). Open
Open
func (g Generator) Generate(ctx context.Context, inFilePath, outFilePath string) error {
parsedFile, err := g.StructsParser.ParseFile(ctx, inFilePath)
if err != nil {
return errors.Wrapf(err, "can't parse file %s to get structs", inFilePath)
}
Method Structs.ParseFile
has 5 return statements (exceeds 4 allowed). Open
Open
func (p Structs) ParseFile(ctx context.Context, filePath string) (*Result, error) {
absFilePath, err := filepath.Abs(filePath)
if err != nil {
return nil, errors.Wrapf(err, "can't get abs path for %s", filePath)
}
Method methodsBuilder.getQuerySetMethodsForField
has 5 return statements (exceeds 4 allowed). Open
Open
func (b *methodsBuilder) getQuerySetMethodsForField(f field.Info) []methods.Method {
fctx := b.sctx.FieldCtx(f)
basicTypeMethods := []methods.Method{
methods.NewBinaryFilterMethod(fctx.WithOperationName("eq")),
methods.NewBinaryFilterMethod(fctx.WithOperationName("ne")),