akito0107/fm5

View on GitHub

Showing 4 of 6 total issues

Function appendFunctionalOptionType has 94 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func appendFunctionalOptionType(typename, methodname, outtypename string) ([]ast.Decl, error) {

    optDef := &ast.GenDecl{
        Tok: token.TYPE,
        Specs: []ast.Spec{
Severity: Major
Found in generator.go - About 2 hrs to fix

    Function appendFunctionalOptions has 66 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func appendFunctionalOptions(ts *ast.TypeSpec, typename string) ([]ast.Decl, error) {
        st, ok := ts.Type.(*ast.StructType)
        if !ok {
            return nil, &NotStructType{Typename: fmt.Sprintf("%v", ts.Type)}
        }
    Severity: Minor
    Found in generator.go - About 1 hr to fix

      Function generate has 9 return statements (exceeds 4 allowed).
      Open

      func generate(filename, typename, fmn, fmon, outtype string, fm, fo, dryrun bool) (bool, error) {
          r, err := os.Open(filename)
          if err != nil {
              return false, err
          }
      Severity: Major
      Found in cmd/fm5/main.go - About 55 mins to fix

        Function Parse has 7 return statements (exceeds 4 allowed).
        Open

        func Parse(r io.Reader, typename string) (string, *ast.TypeSpec, error) {
            src, err := ioutil.ReadAll(r)
            if err != nil {
                return "", nil, errors.Wrap(err, "parse file readAll failed")
            }
        Severity: Major
        Found in parser.go - About 45 mins to fix
          Severity
          Category
          Status
          Source
          Language