horizoncd/horizon

View on GitHub
core/controller/environment/controller.go

Summary

Maintainability
A
1 hr
Test Coverage
D
69%

Showing 3 of 3 total issues

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

func (c *controller) Create(ctx context.Context, request *CreateEnvironmentRequest) (uint, error) {
environment, err := c.envMgr.CreateEnvironment(ctx, &models.Environment{
Name: request.Name,
DisplayName: request.DisplayName,
})
Severity: Minor
Found in core/controller/environment/controller.go and 1 other location - About 45 mins to fix
core/controller/environmentregion/controller.go on lines 66..76

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

func (c *controller) GetByID(ctx context.Context, id uint) (*Environment, error) {
environment, err := c.envMgr.GetByID(ctx, id)
if err != nil {
return nil, err
}
Severity: Minor
Found in core/controller/environment/controller.go and 1 other location - About 35 mins to fix
core/controller/environment/controller.go on lines 68..74

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

func (c *controller) GetByName(ctx context.Context, name string) (*Environment, error) {
environment, err := c.envMgr.GetByName(ctx, name)
if err != nil {
return nil, err
}
Severity: Minor
Found in core/controller/environment/controller.go and 1 other location - About 35 mins to fix
core/controller/environment/controller.go on lines 59..66

There are no issues that match your filters.

Category
Status