Showing 26 of 37 total issues
Function storeTemplates
has 5 return statements (exceeds 4 allowed). Open
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 {
Method packageService.ImportPackagesFromCollection
has 5 return statements (exceeds 4 allowed). Open
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")
Method projectStore.StoreProject
has 5 return statements (exceeds 4 allowed). Open
Open
func (ps *projectStore) StoreProject(project *domain.Project) error {
err := ps.db.Where("path = ?", project.Path).First(project).Error
if err == nil {
return ErrProjectExists
}
Method packageStore.deepQueryPackage
has 5 return statements (exceeds 4 allowed). Open
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
}
Method packageService.ImportPackageFromConfig
has 5 return statements (exceeds 4 allowed). Open
Open
func (ps packageService) ImportPackageFromConfig(path string) (*domain.Package, error) {
// Validate file path
err := isConfigPathValid(path)
if err != nil {
return nil, err
Function storePlugins
has 5 return statements (exceeds 4 allowed). Open
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 = ?"