Showing 1,111 of 1,370 total issues
Method cnsiTokenBackup.BackupEndpoints
has 6 return statements (exceeds 4 allowed). Open
Open
func (ctb *cnsiTokenBackup) BackupEndpoints(c echo.Context) error {
log.Debug("BackupEndpoints")
// Create the backup request struct from the body
body, err := ioutil.ReadAll(c.Request().Body)
Method CertKubeAuth.DoFlowRequest
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *CertKubeAuth) DoFlowRequest(cnsiRequest *interfaces.CNSIRequest, req *http.Request) (*http.Response, error) {
log.Debug("doCertAuthFlowRequest")
authHandler := func(tokenRec interfaces.TokenRecord, cnsi interfaces.CNSIRecord) (*http.Response, error) {
Method UserInfo.updateUserInfo
has 6 return statements (exceeds 4 allowed). Open
Open
func (userInfo *UserInfo) updateUserInfo(c echo.Context) error {
_, err := userInfo.preFlightChecks(c)
if err != nil {
return err
}
Method Analysis.getLatestReport
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *Analysis) getLatestReport(ec echo.Context) error {
log.Debug("getLatestReport")
var p = c.portalProxy
// Need to get a config object for the target endpoint
Method CloudFoundrySpecification.openNoaaConsumer
has 6 return statements (exceeds 4 allowed). Open
Open
func (c CloudFoundrySpecification) openNoaaConsumer(echoContext echo.Context) (*AuthorizedConsumer, error) {
ac := &AuthorizedConsumer{}
// Get the CNSI and app IDs from route parameters
Method PostgresCNSIRepository.List
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *PostgresCNSIRepository) List(encryptionKey []byte) ([]*interfaces.CNSIRecord, error) {
log.Debug("List")
rows, err := p.db.Query(listCNSIs)
if err != nil {
return nil, fmt.Errorf("Unable to retrieve CNSI records: %v", err)
Method PostgresCNSIRepository.Update
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *PostgresCNSIRepository) Update(endpoint interfaces.CNSIRecord, encryptionKey []byte) error {
log.Debug("Update endpoint")
if endpoint.GUID == "" {
msg := "Unable to update Endpoint without a valid guid."
Function ApplyMigrations
has 6 return statements (exceeds 4 allowed). Open
Open
func ApplyMigrations(conf *goose.DBConf, db *sql.DB) error {
current, err := goose.EnsureDBVersion(conf, db)
if err != nil {
return fmt.Errorf("Failed to get database version: %s", err.Error())
}
Method CloudFoundrySpecification.cfLoginHook
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *CloudFoundrySpecification) cfLoginHook(context echo.Context) error {
cfAPI, cfCnsi, err := c.fetchAutoRegisterEndpoint()
// CF auto reg url missing, continue as normal
if cfAPI == "" {
Function getKubeDashboardSecretToken
has 6 return statements (exceeds 4 allowed). Open
Open
func getKubeDashboardSecretToken(p interfaces.PortalProxy, cnsiGUID, userGUID string, sa *v1.ServiceAccount) (string, error) {
log.Debug("getKubeDashboardSecretToken request")
namespace := sa.Namespace
Method portalProxy.setupSaveConfig
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *portalProxy) setupSaveConfig(c echo.Context) error {
log.Debug("setupSaveConfig")
consoleRepo, err := console_config.NewPostgresConsoleConfigRepository(p.DatabaseConnectionPool)
Method CustomBinder.bindData
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *CustomBinder) bindData(ptr interface{}, data map[string][]string, tag string) error {
typ := reflect.TypeOf(ptr).Elem()
val := reflect.ValueOf(ptr).Elem()
if typ.Kind() != reflect.Struct {
Method UserFavorites.create
has 6 return statements (exceeds 4 allowed). Confirmed
Confirmed
func (uf *UserFavorites) create(c echo.Context) error {
store, err := userfavoritesstore.NewFavoritesDBStore(uf.portalProxy.GetDatabaseConnection())
if err != nil {
return interfaces.NewHTTPShadowError(
Function CreateServiceAccount
has 6 return statements (exceeds 4 allowed). Open
Open
func CreateServiceAccount(p interfaces.PortalProxy, endpointGUID, userGUID string) error {
log.Debug("CreateServiceAccount")
svc, err := getKubeDashboardServiceInfo(p, endpointGUID, userGUID)
if err != nil {
Function createPluginForEndpointType
has 6 return statements (exceeds 4 allowed). Open
Open
func createPluginForEndpointType(endpointType string) GeneratedEndpointPlugin {
log.Debugf("Generating plugin %s", endpointType)
gep := GeneratedEndpointPlugin{}
gep.endpointType = endpointType
gep.subTypes = make(map[string]pluginConfig)
Method portalProxy.initialiseConsoleConfig
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *portalProxy) initialiseConsoleConfig(envLookup *env.VarSet) (*interfaces.ConsoleConfig, error) {
log.Debug("initialiseConsoleConfig")
consoleConfig := &interfaces.ConsoleConfig{}
if err := config.Load(consoleConfig, envLookup.Lookup); err != nil {
Method UserFavorites.setMetadata
has 6 return statements (exceeds 4 allowed). Open
Open
func (uf *UserFavorites) setMetadata(c echo.Context) error {
store, err := userfavoritesstore.NewFavoritesDBStore(uf.portalProxy.GetDatabaseConnection())
if err != nil {
return err
Method GeneratedEndpointPlugin.Connect
has 6 return statements (exceeds 4 allowed). Open
Open
func (gep GeneratedEndpointPlugin) Connect(ec echo.Context, cnsiRecord interfaces.CNSIRecord, userId string) (*interfaces.TokenRecord, bool, error) {
params := new(interfaces.LoginToCNSIParams)
err := interfaces.BindOnce(params, ec)
if err != nil {
return nil, false, err
Method portalProxy.buildCNSIList
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *portalProxy) buildCNSIList(c echo.Context) ([]*interfaces.CNSIRecord, error) {
log.Debug("buildCNSIList")
if p.GetConfig().UserEndpointsEnabled != config.UserEndpointsConfigEnum.Disabled {
userID, err := p.GetSessionValue(c, "user_id")
Function saveLocalUserConsoleConfig
has 6 return statements (exceeds 4 allowed). Open
Open
func saveLocalUserConsoleConfig(consoleRepo console_config.Repository, consoleConfig *interfaces.ConsoleConfig) error {
log.Debug("saveLocalUserConsoleConfig")
if err := consoleRepo.SetValue(systemGroupName, "AUTH_ENDPOINT_TYPE", "local"); err != nil {