horizoncd/horizon

View on GitHub
pkg/workload/rollout/rollout.go

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 4 of 4 total issues

Method rollout.GetSteps has 59 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (r *rollout) GetSteps(node *v1alpha1.ResourceNode, client *kube.Client) (*workload.Step, error) {
instance, un, err := r.getRolloutByNode(node, client)
if err != nil {
return nil, err
}
Severity: Minor
Found in pkg/workload/rollout/rollout.go - About 1 hr to fix

    Method rollout.IsHealthy has 51 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (r *rollout) IsHealthy(node *v1alpha1.ResourceNode,
    client *kube.Client) (bool, error) {
    instance, _, err := r.getRolloutByNode(node, client)
    if err != nil {
    return true, err
    Severity: Minor
    Found in pkg/workload/rollout/rollout.go - About 1 hr to fix

      Method rollout.IsHealthy has 6 return statements (exceeds 4 allowed).
      Open

      func (r *rollout) IsHealthy(node *v1alpha1.ResourceNode,
      client *kube.Client) (bool, error) {
      instance, _, err := r.getRolloutByNode(node, client)
      if err != nil {
      return true, err
      Severity: Major
      Found in pkg/workload/rollout/rollout.go - About 40 mins to fix

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

        if instance.Status.CurrentStepHash == computeStepHash(instance) &&
        instance.Status.CurrentStepIndex != nil {
        index := float64(*instance.Status.CurrentStepIndex)
        index = math.Min(index, float64(len(instance.Spec.Strategy.Canary.Steps)))
        for i := 0; i < int(index); i++ {
        Severity: Major
        Found in pkg/workload/rollout/rollout.go and 1 other location - About 1 hr to fix
        pkg/cd/util.go on lines 349..358

        There are no issues that match your filters.

        Category
        Status