File util.go
has 588 lines of code (exceeds 500 allowed). Consider refactoring.
Function parsePod
has 99 lines of code (exceeds 50 allowed). Consider refactoring.
func parsePod(ctx context.Context, clusterInfo *ClusterState,
pod *corev1.Pod, events []*corev1.Event) (err error) {
const deploymentPodTemplateHash = "pod-template-hash"
const rolloutPodTemplateHash = "rollouts-pod-template-hash"
Function parsePodLifeCycle
has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring.
func parsePodLifeCycle(pod corev1.Pod) []*LifeCycleItem {
var lifeCycle []*LifeCycleItem
if pod.DeletionTimestamp != nil {
lifeCycle = []*LifeCycleItem{
Function parsePodLifeCycle
has 87 lines of code (exceeds 50 allowed). Consider refactoring.
func parsePodLifeCycle(pod corev1.Pod) []*LifeCycleItem {
var lifeCycle []*LifeCycleItem
if pod.DeletionTimestamp != nil {
lifeCycle = []*LifeCycleItem{
Function podMapping
has 56 lines of code (exceeds 50 allowed). Consider refactoring.
func podMapping(pod corev1.Pod) *ClusterPod {
clusterPod := &ClusterPod{
Metadata: PodMetadata{
CreationTimestamp: pod.CreationTimestamp,
Namespace: pod.Namespace,
Identical blocks of code found in 2 locations. Consider refactoring.
func computeRolloutStepHash(rollout *rolloutsV1alpha1.Rollout) string {
if rollout.Spec.Strategy.BlueGreen != nil || rollout.Spec.Strategy.Canary == nil {
return ""
}
rolloutStepHasher := fnv.New32a()
Similar blocks of code found in 2 locations. Consider refactoring.
if rollout.Status.CurrentStepHash == computeRolloutStepHash(rollout) &&
rollout.Status.CurrentStepIndex != nil {
index := float64(*rollout.Status.CurrentStepIndex)
index = math.Min(index, float64(len(rollout.Spec.Strategy.Canary.Steps)))
for i := 0; i < int(index); i++ {
Identical blocks of code found in 2 locations. Consider refactoring.
clusterPod := &ClusterPod{
Metadata: PodMetadata{
CreationTimestamp: pod.CreationTimestamp,
Namespace: pod.Namespace,
Annotations: pod.Annotations,
Identical blocks of code found in 2 locations. Consider refactoring.
clusterPod := &ClusterPod{
Metadata: PodMetadata{
CreationTimestamp: pod.CreationTimestamp,
Namespace: pod.Namespace,
Annotations: pod.Annotations,
Similar blocks of code found in 2 locations. Consider refactoring.
case e.ValueFrom.ConfigMapKeyRef != nil:
optional := e.ValueFrom.ConfigMapKeyRef.Optional != nil && *e.ValueFrom.ConfigMapKeyRef.Optional
env = append(env, corev1.EnvVar{
Name: e.Name,
Value: fmt.Sprintf("<set to the key '%s' of config map '%s'>\tOptional: %t\n",
Similar blocks of code found in 2 locations. Consider refactoring.
case e.ValueFrom.SecretKeyRef != nil:
optional := e.ValueFrom.SecretKeyRef.Optional != nil && *e.ValueFrom.SecretKeyRef.Optional
env = append(env, corev1.EnvVar{
Name: e.Name,
Value: fmt.Sprintf("<set to the key '%s' in secret '%s'>\tOptional: %t\n",
There are no issues that match your filters.