akito0107/generr

View on GitHub
generator.go

Summary

Maintainability
C
1 day
Test Coverage

Function appendErrorImplementation has 125 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func appendErrorImplementation(ts *ast.TypeSpec, typename, mes string) ([]ast.Decl, error) {
    it, ok := ts.Type.(*ast.InterfaceType)
    if !ok {
        return nil, errors.Errorf("type %+v is not a interface", ts.Type)
    }
Severity: Major
Found in generator.go - About 4 hrs to fix

    Function appendCheckFunction has 124 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func appendCheckFunction(ts *ast.TypeSpec, withCause bool) ([]ast.Decl, error) {
        it, ok := ts.Type.(*ast.InterfaceType)
        if !ok {
            return nil, errors.Errorf("type %+v is not a interface", ts.Type)
        }
    Severity: Major
    Found in generator.go - About 3 hrs to fix

      Method Generator.Out has 5 return statements (exceeds 4 allowed).
      Open

      func (g *Generator) Out(w io.Writer) error {
          var buf bytes.Buffer
          if _, err := fmt.Fprintf(&buf, "// Code generated by \"generr\"; DO NOT EDIT.\n"); err != nil {
              return err
          }
      Severity: Major
      Found in generator.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status