pkg/input/input.go
Method ResourceRepo.mappingFor
has 6 return statements (exceeds 4 allowed). Open
Open
func (r *ResourceRepo) mappingFor(resourceOrKindArg string) (*meta.RESTMapping, error) {
fullySpecifiedGVR, groupResource := schema.ParseResourceArg(resourceOrKindArg)
gvk := schema.GroupVersionKind{}
restMapper, err := r.f.ToRESTMapper()
if err != nil {
Method ResourceRepo.Owners
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
Open
func (r *ResourceRepo) Owners(obj Object) (out Objects, err error) {
uobj := obj.Unstructured()
namespace := uobj.GetNamespace()
owners := uobj.GetOwnerReferences()
if len(owners) == 0 {
- Read upRead up
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
exported method Object.Unstructured should have comment or be unexported Open
Open
func (u Object) Unstructured() *unstructured.Unstructured {
- Exclude checks
exported function NewResourceRepo should have comment or be unexported Open
Open
func NewResourceRepo(factory util.Factory) (*ResourceRepo, error) {
- Exclude checks
exported method ResourceRepo.Ingresses should have comment or be unexported Open
Open
func (r *ResourceRepo) Ingresses(namespace string) (*netv1.IngressList, error) {
- Exclude checks
exported method ResourceRepo.DynamicObjects should have comment or be unexported Open
Open
func (r *ResourceRepo) DynamicObjects(gvr schema.GroupVersionResource, namespace string) (Objects, error) {
- Exclude checks
exported method ResourceRepo.Objects should have comment or be unexported Open
Open
func (r *ResourceRepo) Objects(namespace string, args []string, labelSelector string) (Objects, error) {
- Exclude checks
exported method ResourceRepo.Services should have comment or be unexported Open
Open
func (r *ResourceRepo) Services(namespace string) (*corev1.ServiceList, error) {
- Exclude checks
exported type Objects should have comment or be unexported Open
Open
type Objects []Object
- Exclude checks
exported method ResourceRepo.Endpoints should have comment or be unexported Open
Open
func (r *ResourceRepo) Endpoints(namespace string) (*corev1.EndpointsList, error) {
- Exclude checks
exported method ResourceRepo.CLIQueryResults should have comment or be unexported Open
Open
func (r *ResourceRepo) CLIQueryResults(args []string) *resource.Result {
- Exclude checks
exported method ResourceRepo.Owners should have comment or be unexported Open
Open
func (r *ResourceRepo) Owners(obj Object) (out Objects, err error) {
- Exclude checks
exported method ResourceRepo.FirstObject should have comment or be unexported Open
Open
func (r *ResourceRepo) FirstObject(namespace string, args []string, labelSelector string) (Object, error) {
- Exclude checks
exported method ResourceRepo.Service should have comment or be unexported Open
Open
func (r *ResourceRepo) Service(namespace, name string) (*corev1.Service, error) {
- Exclude checks
exported type ResourceRepo should have comment or be unexported Open
Open
type ResourceRepo struct {
- Exclude checks
exported method ResourceRepo.GVRFor should have comment or be unexported Open
Open
func (r *ResourceRepo) GVRFor(resourceOrKindArg string) (schema.GroupVersionResource, error) {
- Exclude checks
exported method ResourceRepo.NonTerminatedPodsOnTheNode should have comment or be unexported Open
Open
func (r *ResourceRepo) NonTerminatedPodsOnTheNode(nodeName string) (Objects, error) {
- Exclude checks
exported method ResourceRepo.ObjectEvents should have comment or be unexported Open
Open
func (r *ResourceRepo) ObjectEvents(u *unstructured.Unstructured) (*corev1.EventList, error) {
- Exclude checks
exported method ResourceRepo.DynamicObject should have comment or be unexported Open
Open
func (r *ResourceRepo) DynamicObject(gvr schema.GroupVersionResource, namespace string, name string) (Object, error) {
- Exclude checks