horizoncd/horizon

View on GitHub
pkg/group/service/convert.go

Summary

Maintainability
A
2 hrs
Test Coverage
F
56%

Showing 4 of 4 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

func ConvertApplicationToChild(app *appmodels.Application, full *Full) *Child {
return &Child{
ID: app.ID,
Name: app.Name,
Path: app.Name,
Severity: Major
Found in pkg/group/service/convert.go and 3 other locations - About 45 mins to fix
pkg/group/service/convert.go on lines 81..92
pkg/group/service/convert.go on lines 94..105
pkg/group/service/convert.go on lines 120..131

Similar blocks of code found in 4 locations. Consider refactoring.
Open

func ConvertClusterToChild(cluster *clustermodels.Cluster, full *Full) *Child {
return &Child{
ID: cluster.ID,
Name: cluster.Name,
Path: cluster.Name,
Severity: Major
Found in pkg/group/service/convert.go and 3 other locations - About 45 mins to fix
pkg/group/service/convert.go on lines 81..92
pkg/group/service/convert.go on lines 94..105
pkg/group/service/convert.go on lines 107..118

Similar blocks of code found in 4 locations. Consider refactoring.
Open

func ConvertTemplateToChild(template *tmodels.Template, full *Full) *Child {
return &Child{
ID: template.ID,
Name: template.Name,
Path: template.Name,
Severity: Major
Found in pkg/group/service/convert.go and 3 other locations - About 45 mins to fix
pkg/group/service/convert.go on lines 94..105
pkg/group/service/convert.go on lines 107..118
pkg/group/service/convert.go on lines 120..131

Similar blocks of code found in 4 locations. Consider refactoring.
Open

func ConvertReleaseToChild(release *trmodels.TemplateRelease, full *Full) *Child {
return &Child{
ID: release.ID,
Name: release.Name,
Path: release.Name,
Severity: Major
Found in pkg/group/service/convert.go and 3 other locations - About 45 mins to fix
pkg/group/service/convert.go on lines 81..92
pkg/group/service/convert.go on lines 107..118
pkg/group/service/convert.go on lines 120..131

There are no issues that match your filters.

Category
Status