nikoksr/proji

View on GitHub

Showing 26 of 37 total issues

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

func storeTemplates(tx *gorm.DB, templates []*domain.Template, packageID uint) error {
    insertTemplateStmt := "INSERT OR IGNORE INTO templates (created_at, updated_at, is_file, destination, path, description) VALUES (?, ?, ?, ?, ?, ?)"
    insertAssociationStmt := "INSERT OR IGNORE INTO package_templates (package_id, template_id) VALUES (?, ?)"
    queryIDStmt := "SELECT id from templates WHERE destination = ? AND path = ?"
    for _, template := range templates {
Severity: Major
Found in pkg/package/store/store.go - About 35 mins to fix

    Method packageService.ImportPackagesFromCollection has 5 return statements (exceeds 4 allowed).
    Open

    func (ps packageService) ImportPackagesFromCollection(url *url.URL, exclude *regexp.Regexp) ([]*domain.Package, error) {
        // Get code repo
        codeRepo, err := remote.NewCodeRepository(url, ps.authentication)
        if err != nil {
            return nil, errors.Wrap(err, "get code repository")
    Severity: Major
    Found in pkg/package/service/collection.go - About 35 mins to fix

      Method projectStore.StoreProject has 5 return statements (exceeds 4 allowed).
      Open

      func (ps *projectStore) StoreProject(project *domain.Project) error {
          err := ps.db.Where("path = ?", project.Path).First(project).Error
          if err == nil {
              return ErrProjectExists
          }
      Severity: Major
      Found in pkg/project/store/store.go - About 35 mins to fix

        Method packageStore.deepQueryPackage has 5 return statements (exceeds 4 allowed).
        Open

        func (ps packageStore) deepQueryPackage(conditions string, values ...string) (pkg *domain.Package, err error) {
            rows, err := ps.db.Raw(defaultPackageDeepQueryBase+" "+conditions, values).Rows()
            if err != nil {
                return nil, err
            }
        Severity: Major
        Found in pkg/package/store/store.go - About 35 mins to fix

          Method packageService.ImportPackageFromConfig has 5 return statements (exceeds 4 allowed).
          Open

          func (ps packageService) ImportPackageFromConfig(path string) (*domain.Package, error) {
              // Validate file path
              err := isConfigPathValid(path)
              if err != nil {
                  return nil, err
          Severity: Major
          Found in pkg/package/service/config.go - About 35 mins to fix

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

            func storePlugins(tx *gorm.DB, plugins []*domain.Plugin, packageID uint) error {
                var err error
                insertPluginStmt := "INSERT OR IGNORE INTO plugins (created_at, updated_at, path, exec_number, description) VALUES (?, ?, ?, ?, ?)"
                insertAssociationStmt := "INSERT OR IGNORE INTO package_plugins (package_id, plugin_id) VALUES (?, ?)"
                queryIDStmt := "SELECT id from plugins WHERE path = ?"
            Severity: Major
            Found in pkg/package/store/store.go - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language