Showing 20 of 27 total issues
Function main
has 339 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func main() { var metricsAddr string var enableLeaderElection bool var probeAddr string
Function main
has a Cognitive Complexity of 87 (exceeds 20 allowed). Consider refactoring. Open
Open
func main() { var metricsAddr string var enableLeaderElection bool var probeAddr string
- Read upRead up
App
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
Open
type App struct { serverURL url.URL appRepo CFAppRepository dropletRepo CFDropletRepository processRepo CFProcessRepository
Method ProcessStats.FetchStats
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *ProcessStats) FetchStats(ctx context.Context, authInfo authorization.Info, processGUID string) ([]PodStatsRecord, error) { processRecord, err := a.processRepo.GetProcess(ctx, authInfo, processGUID) if err != nil { return nil, err }
Function ForApp
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func ForApp(responseApp repositories.AppRecord, baseURL url.URL, includes ...include.Resource) AppResponse { return AppResponse{ Name: responseApp.Name, GUID: responseApp.GUID, State: string(responseApp.State),
Method ServicePlanRepo.planToRecord
has 62 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (r *ServicePlanRepo) planToRecord(ctx context.Context, authInfo authorization.Info, plan korifiv1alpha1.CFServicePlan) (ServicePlanRecord, error) { organizations := []VisibilityOrganization{} if plan.Spec.Visibility.Type == korifiv1alpha1.OrganizationServicePlanVisibilityType { var err error organizations, err = r.toVisibilityOrganizations(ctx, authInfo, plan.Spec.Visibility.Organizations)
Function NewApp
has 12 arguments (exceeds 5 allowed). Consider refactoring. Open
Open
serverURL url.URL, appRepo CFAppRepository, dropletRepo CFDropletRepository, processRepo CFProcessRepository, routeRepo CFRouteRepository,
Function SetupIndexWithManager
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func SetupIndexWithManager(mgr manager.Manager) error { err := mgr.GetFieldIndexer().IndexField(context.Background(), new(korifiv1alpha1.CFRoute), IndexRouteDestinationAppName, routeDestinationAppNameIndexFn) if err != nil { return err }
Method DuplicateValidator.ValidateUpdate
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (v DuplicateValidator) ValidateUpdate(ctx context.Context, logger logr.Logger, namespace string, oldObj, obj webhooks.UniqueClientObject) error { if oldObj.UniqueName() == obj.UniqueName() { return nil }
Function ForRoot
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func ForRoot(baseURL url.URL, uaaConfig config.UAA, logCacheURL url.URL) RootResponse { rootResponse := RootResponse{ Links: map[string]*APILink{ "self": { Link: Link{
Function main
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func main() { var ( metricsAddr string enableLeaderElection bool probeAddr string
Method Client.Push
has 12 return statements (exceeds 8 allowed). Open
Open
func (c Client) Push(ctx context.Context, creds Creds, repoRef string, zipReader io.Reader, tags ...string) (string, error) { tmpFile, err := os.CreateTemp(os.TempDir(), "sourceimg-%s") if err != nil { return "", fmt.Errorf("failed to create a temp file for image: %w", err) }
Method ManagedBindingsReconciler.ReconcileResource
has 12 return statements (exceeds 8 allowed). Open
Open
func (r *ManagedBindingsReconciler) ReconcileResource(ctx context.Context, cfServiceBinding *korifiv1alpha1.CFServiceBinding) (ctrl.Result, error) { log := logr.FromContextOrDiscard(ctx).WithName("reconcile-managed-service-binding") assets, err := r.assets.GetServiceBindingAssets(ctx, cfServiceBinding) if err != nil {
Function NewPackage
has 7 arguments (exceeds 5 allowed). Consider refactoring. Open
Open
serverURL url.URL, packageRepo CFPackageRepository, appRepo CFAppRepository, dropletRepo CFDropletRepository, imageRepo ImageRepository,
Method KpackBuildController.Reconcile
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
func (c *KpackBuildController) Reconcile(ctx context.Context, req reconcile.Request) (ctrl.Result, error) { log := c.log.WithName("KpackBuild"). WithValues("namespace", req.Namespace). WithValues("name", req.Name). WithValues("logID", uuid.NewString())
- Read upRead up
Function NewProcess
has 6 arguments (exceeds 5 allowed). Consider refactoring. Open
Open
serverURL url.URL, processRepo CFProcessRepository, requestValidator RequestValidator, podRepo PodRepository, gaugesCollector GaugesCollector,
Function NewRoute
has 6 arguments (exceeds 5 allowed). Consider refactoring. Open
Open
serverURL url.URL, routeRepo CFRouteRepository, domainRepo CFDomainRepository, appRepo CFAppRepository, spaceRepo CFSpaceRepository,
Method ImageRepository.UploadSourceImage
has 6 arguments (exceeds 5 allowed). Consider refactoring. Open
Open
func (r *ImageRepository) UploadSourceImage(ctx context.Context, authInfo authorization.Info, imageRef string, srcReader io.Reader, spaceGUID string, tags ...string) (string, error) {
Function NewOrg
has 6 arguments (exceeds 5 allowed). Consider refactoring. Open
Open
func NewOrg(apiBaseURL url.URL, orgRepo CFOrgRepository, domainRepo CFDomainRepository, requestValidator RequestValidator, userCertificateExpirationWarningDuration time.Duration, defaultDomainName string) *Org {
Method Validator.ValidateUpdate
has 9 return statements (exceeds 8 allowed). Open
Open
func (v *Validator) ValidateUpdate(ctx context.Context, oldObj, obj runtime.Object) (admission.Warnings, error) { route, ok := obj.(*korifiv1alpha1.CFRoute) if !ok { return nil, apierrors.NewBadRequest(fmt.Sprintf("expected a CFRoute but got a %T", obj)) }