sunboyy/repogen

View on GitHub
main.go

Summary

Maintainability
A
2 hrs
Test Coverage

Function main has 60 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func main() {
    flag.Usage = printUsage

    versionPtr := flag.Bool("version", false, "print version of repogen")
    pkgPtr := flag.String(
Severity: Minor
Found in main.go - About 1 hr to fix

    Function getPkgID has 5 return statements (exceeds 4 allowed).
    Open

    func getPkgID(pattern string) (string, error) {
        pkgs, err := packages.Load(nil, pattern)
        if err != nil {
            return "", err
        }
    Severity: Major
    Found in main.go - About 35 mins to fix

      Function generateFromRequest has 5 return statements (exceeds 4 allowed).
      Open

      func generateFromRequest(request GenerationRequest) (string, error) {
          cfg := packages.Config{
              Mode: packages.NeedName | packages.NeedTypes,
          }
          if request.ModelPkg == "" {
      Severity: Major
      Found in main.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status