arttor/helmify

View on GitHub

Showing 27 of 41 total issues

Method deployment.Process has 111 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (d deployment) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
    if obj.GroupVersionKind() != deploymentGVC {
        return false, nil, nil
    }
    depl := appsv1.Deployment{}
Severity: Major
Found in pkg/processor/deployment/deployment.go - About 3 hrs to fix

    Method daemonset.Process has 105 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (d daemonset) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
        if obj.GroupVersionKind() != daemonsetGVC {
            return false, nil, nil
        }
        dae := appsv1.DaemonSet{}
    Severity: Major
    Found in pkg/processor/daemonset/daemonset.go - About 3 hrs to fix

      Method crd.Process has 75 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (c crd) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
          if obj.GroupVersionKind() != crdGVC {
              return false, nil, nil
          }
          name, ok, err := unstructured.NestedString(obj.Object, "spec", "names", "singular")
      Severity: Minor
      Found in pkg/processor/crd/crd.go - About 2 hrs to fix

        Method secret.Process has 71 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (d secret) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
            if obj.GroupVersionKind() != configMapGVC {
                return false, nil, nil
            }
            sec := corev1.Secret{}
        Severity: Minor
        Found in pkg/processor/secret/secret.go - About 1 hr to fix

          Method deployment.Process has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring.
          Open

          func (d deployment) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
              if obj.GroupVersionKind() != deploymentGVC {
                  return false, nil, nil
              }
              depl := appsv1.Deployment{}
          Severity: Minor
          Found in pkg/processor/deployment/deployment.go - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method daemonset.Process has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
          Open

          func (d daemonset) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
              if obj.GroupVersionKind() != daemonsetGVC {
                  return false, nil, nil
              }
              dae := appsv1.DaemonSet{}
          Severity: Minor
          Found in pkg/processor/daemonset/daemonset.go - About 1 hr to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method deployment.Process has 17 return statements (exceeds 4 allowed).
          Open

          func (d deployment) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
              if obj.GroupVersionKind() != deploymentGVC {
                  return false, nil, nil
              }
              depl := appsv1.Deployment{}
          Severity: Major
          Found in pkg/processor/deployment/deployment.go - About 1 hr to fix

            Method daemonset.Process has 16 return statements (exceeds 4 allowed).
            Open

            func (d daemonset) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                if obj.GroupVersionKind() != daemonsetGVC {
                    return false, nil, nil
                }
                dae := appsv1.DaemonSet{}
            Severity: Major
            Found in pkg/processor/daemonset/daemonset.go - About 1 hr to fix

              Method pvc.Process has 61 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

              func (p pvc) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                  if obj.GroupVersionKind() != pvcGVC {
                      return false, nil, nil
                  }
                  meta, err := processor.ProcessObjMeta(appMeta, obj)
              Severity: Minor
              Found in pkg/processor/storage/pvc.go - About 1 hr to fix

                Method crd.Process has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
                Open

                func (c crd) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                    if obj.GroupVersionKind() != crdGVC {
                        return false, nil, nil
                    }
                    name, ok, err := unstructured.NestedString(obj.Object, "spec", "names", "singular")
                Severity: Minor
                Found in pkg/processor/crd/crd.go - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method pvc.Process has 11 return statements (exceeds 4 allowed).
                Open

                func (p pvc) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                    if obj.GroupVersionKind() != pvcGVC {
                        return false, nil, nil
                    }
                    meta, err := processor.ProcessObjMeta(appMeta, obj)
                Severity: Major
                Found in pkg/processor/storage/pvc.go - About 1 hr to fix

                  Method svc.Process has 52 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

                  func (r svc) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                      if obj.GroupVersionKind() != svcGVC {
                          return false, nil, nil
                      }
                      service := corev1.Service{}
                  Severity: Minor
                  Found in pkg/processor/service/service.go - About 1 hr to fix

                    Method crd.Process has 9 return statements (exceeds 4 allowed).
                    Open

                    func (c crd) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                        if obj.GroupVersionKind() != crdGVC {
                            return false, nil, nil
                        }
                        name, ok, err := unstructured.NestedString(obj.Object, "spec", "names", "singular")
                    Severity: Major
                    Found in pkg/processor/crd/crd.go - About 55 mins to fix

                      Method secret.Process has 9 return statements (exceeds 4 allowed).
                      Open

                      func (d secret) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                          if obj.GroupVersionKind() != configMapGVC {
                              return false, nil, nil
                          }
                          sec := corev1.Secret{}
                      Severity: Major
                      Found in pkg/processor/secret/secret.go - About 55 mins to fix

                        Function processPodContainer has 6 return statements (exceeds 4 allowed).
                        Open

                        func processPodContainer(name string, appMeta helmify.AppMetadata, c corev1.Container, values *helmify.Values) (corev1.Container, error) {
                            index := strings.LastIndex(c.Image, ":")
                            if index < 0 {
                                return c, errors.New("wrong image format: " + c.Image)
                            }
                        Severity: Major
                        Found in pkg/processor/daemonset/daemonset.go - About 40 mins to fix

                          Method clusterRoleBinding.Process has 6 return statements (exceeds 4 allowed).
                          Open

                          func (r clusterRoleBinding) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                              if obj.GroupVersionKind() != clusterRoleBindingGVC {
                                  return false, nil, nil
                              }
                          
                          
                          Severity: Major
                          Found in pkg/processor/rbac/clusterrolebinding.go - About 40 mins to fix

                            Method roleBinding.Process has 6 return statements (exceeds 4 allowed).
                            Open

                            func (r roleBinding) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                                if obj.GroupVersionKind() != roleBindingGVC {
                                    return false, nil, nil
                                }
                                rb := rbacv1.RoleBinding{}
                            Severity: Major
                            Found in pkg/processor/rbac/rolebinding.go - About 40 mins to fix

                              Method cert.Process has 6 return statements (exceeds 4 allowed).
                              Open

                              func (c cert) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                                  if obj.GroupVersionKind() != certGVC {
                                      return false, nil, nil
                                  }
                                  name := appMeta.TrimName(obj.GetName())
                              Severity: Major
                              Found in pkg/processor/webhook/cert.go - About 40 mins to fix

                                Function processPodContainer has 6 return statements (exceeds 4 allowed).
                                Open

                                func processPodContainer(name string, appMeta helmify.AppMetadata, c corev1.Container, values *helmify.Values) (corev1.Container, error) {
                                    index := strings.LastIndex(c.Image, ":")
                                    if index < 0 {
                                        return c, errors.New("wrong image format: " + c.Image)
                                    }
                                Severity: Major
                                Found in pkg/processor/deployment/deployment.go - About 40 mins to fix

                                  Method configMap.Process has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (d configMap) Process(appMeta helmify.AppMetadata, obj *unstructured.Unstructured) (bool, helmify.Template, error) {
                                      if obj.GroupVersionKind() != configMapGVC {
                                          return false, nil, nil
                                      }
                                      var meta, immutable, binaryData, data string
                                  Severity: Major
                                  Found in pkg/processor/configmap/configmap.go - About 40 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language