Showing 650 of 1,370 total issues
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 {
Method PostgresCNSIRepository.listBy
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *PostgresCNSIRepository) listBy(query string, match string, encryptionKey []byte) ([]*interfaces.CNSIRecord, error) {
rows, err := p.db.Query(query, match)
if err != nil {
return nil, fmt.Errorf("Unable to retrieve CNSI records: %v", err)
}
Method ConsoleConfigRepository.GetConsoleConfig
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *ConsoleConfigRepository) GetConsoleConfig() (*interfaces.ConsoleConfig, error) {
log.Debug("Get ConsoleConfig")
rows, err := c.db.Query(getConsoleConfig)
if err != nil {
return nil, fmt.Errorf("Unable to retrieve console config record: %v", err)
Consider simplifying this complex logical expression. Open
Open
if (isAdmin) {
const allCfUsersAction = this.createCfGetAllUsersAction(cfGuid);
if (!orgGuid) {
return observableOf(allCfUsersAction);
Method PgsqlTokenRepository.FindAllCNSITokenBackup
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *PgsqlTokenRepository) FindAllCNSITokenBackup(cnsiGUID string, encryptionKey []byte) ([]interfaces.BackupTokenRecord, error) {
log.Debug("FindAllCNSITokenBackup")
if cnsiGUID == "" {
msg := "Unable to find CNSI Token without a valid CNSI GUID."
log.Debug(msg)
Consider simplifying this complex logical expression. Open
Open
if (!secrets ||
!secrets.consoleUsers || !secrets.consoleUsers.admin || !secrets.consoleUsers.nonAdmin ||
!secrets.endpoints || !secrets.endpoints.cf
) {
throw new Error(`Failed to validate secrets`);
Consider simplifying this complex logical expression. Open
Open
if (ep.provider && ep.provider.metadata && ep.provider.metadata && ep.provider.metadata.metrics_stratos
&& Array.isArray(ep.provider.metadata.metrics_stratos)) {
ep.provider.metadata.metrics_stratos.forEach(endp => {
// See if we already know about this endpoint
const hasEndpoint = data.findIndex(i => compareUrl(i.url, endp.url) || compareUrl(i.url, endp.cfEndpoint)) !== -1;
Consider simplifying this complex logical expression. Open
Open
if (dsEndpointType || onlyConnected) {
transformEntities.push((entities: EndpointModel[]) => {
return dsEndpointType || onlyConnected ? entities.filter(endpoint => {
return (!onlyConnected || endpoint.connectionStatus === 'connected') &&
(!dsEndpointType || endpoint.cnsi_type === dsEndpointType);
Function start
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func start(config interfaces.PortalConfig, p *portalProxy, needSetupMiddleware bool, isUpgrade bool, envLookup *env.VarSet) error {
Function initSessionStore
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func initSessionStore(db *sql.DB, databaseProvider string, pc interfaces.PortalConfig, sessionExpiry int, env *env.VarSet) (HttpSessionStore, *sessions.Options, error) {
Function newPortalProxy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func newPortalProxy(pc interfaces.PortalConfig, dcp *sql.DB, ss HttpSessionStore, sessionStoreOptions *sessions.Options, env *env.VarSet) *portalProxy {
Method portalProxy.login
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (p *portalProxy) login(c echo.Context, skipSSLValidation bool, client string, clientSecret string, endpoint string) (uaaRes *interfaces.UAAResponse, u *interfaces.JWTUserTokenInfo, err error) {