cloudfoundry-incubator/stratos

View on GitHub

Showing 1,111 of 1,370 total issues

Method cnsiTokenBackup.BackupEndpoints has 6 return statements (exceeds 4 allowed).
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)
Severity: Major
Found in src/jetstream/plugins/backup/backup_restore.go - About 40 mins to fix

    Method CertKubeAuth.DoFlowRequest has 6 return statements (exceeds 4 allowed).
    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) {
    
    
    Severity: Major
    Found in src/jetstream/plugins/kubernetes/auth/cert.go - About 40 mins to fix

      Method UserInfo.updateUserInfo has 6 return statements (exceeds 4 allowed).
      Open

      func (userInfo *UserInfo) updateUserInfo(c echo.Context) error {
          _, err := userInfo.preFlightChecks(c)
          if err != nil {
              return err
          }
      Severity: Major
      Found in src/jetstream/plugins/userinfo/main.go - About 40 mins to fix

        Method Analysis.getLatestReport has 6 return statements (exceeds 4 allowed).
        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
        Severity: Major
        Found in src/jetstream/plugins/analysis/list.go - About 40 mins to fix

          Method CloudFoundrySpecification.openNoaaConsumer has 6 return statements (exceeds 4 allowed).
          Open

          func (c CloudFoundrySpecification) openNoaaConsumer(echoContext echo.Context) (*AuthorizedConsumer, error) {
          
              ac := &AuthorizedConsumer{}
          
              // Get the CNSI and app IDs from route parameters
          Severity: Major
          Found in src/jetstream/plugins/cloudfoundry/cf_websocket_streams.go - About 40 mins to fix

            Method PostgresCNSIRepository.List has 6 return statements (exceeds 4 allowed).
            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)
            Severity: Major
            Found in src/jetstream/repository/cnsis/pgsql_cnsis.go - About 40 mins to fix

              Method PostgresCNSIRepository.Update has 6 return statements (exceeds 4 allowed).
              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."
              Severity: Major
              Found in src/jetstream/repository/cnsis/pgsql_cnsis.go - About 40 mins to fix

                Function ApplyMigrations has 6 return statements (exceeds 4 allowed).
                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())
                    }
                Severity: Major
                Found in src/jetstream/datastore/datastore_migrator.go - About 40 mins to fix

                  Method CloudFoundrySpecification.cfLoginHook has 6 return statements (exceeds 4 allowed).
                  Open

                  func (c *CloudFoundrySpecification) cfLoginHook(context echo.Context) error {
                  
                      cfAPI, cfCnsi, err := c.fetchAutoRegisterEndpoint()
                      // CF auto reg url missing, continue as normal
                      if cfAPI == "" {
                  Severity: Major
                  Found in src/jetstream/plugins/cloudfoundry/main.go - About 40 mins to fix

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

                    func getKubeDashboardSecretToken(p interfaces.PortalProxy, cnsiGUID, userGUID string, sa *v1.ServiceAccount) (string, error) {
                        log.Debug("getKubeDashboardSecretToken request")
                    
                        namespace := sa.Namespace
                    
                    
                    Severity: Major
                    Found in src/jetstream/plugins/kubernetes/dashboard/common.go - About 40 mins to fix

                      Method portalProxy.setupSaveConfig has 6 return statements (exceeds 4 allowed).
                      Open

                      func (p *portalProxy) setupSaveConfig(c echo.Context) error {
                      
                          log.Debug("setupSaveConfig")
                      
                          consoleRepo, err := console_config.NewPostgresConsoleConfigRepository(p.DatabaseConnectionPool)
                      Severity: Major
                      Found in src/jetstream/setup_console.go - About 40 mins to fix

                        Method CustomBinder.bindData has 6 return statements (exceeds 4 allowed).
                        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 {
                        Severity: Major
                        Found in src/jetstream/custombinder/custombinder.go - About 40 mins to fix

                          Method UserFavorites.create has 6 return statements (exceeds 4 allowed).
                          Confirmed

                          func (uf *UserFavorites) create(c echo.Context) error {
                          
                              store, err := userfavoritesstore.NewFavoritesDBStore(uf.portalProxy.GetDatabaseConnection())
                              if err != nil {
                                  return interfaces.NewHTTPShadowError(
                          Severity: Major
                          Found in src/jetstream/plugins/userfavorites/favorites.go - About 40 mins to fix

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

                            func CreateServiceAccount(p interfaces.PortalProxy, endpointGUID, userGUID string) error {
                                log.Debug("CreateServiceAccount")
                            
                                svc, err := getKubeDashboardServiceInfo(p, endpointGUID, userGUID)
                                if err != nil {
                            Severity: Major
                            Found in src/jetstream/plugins/kubernetes/dashboard/configure.go - About 40 mins to fix

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

                              func createPluginForEndpointType(endpointType string) GeneratedEndpointPlugin {
                                  log.Debugf("Generating plugin %s", endpointType)
                                  gep := GeneratedEndpointPlugin{}
                                  gep.endpointType = endpointType
                                  gep.subTypes = make(map[string]pluginConfig)
                              Severity: Major
                              Found in src/jetstream/plugins/yamlgenerated/main.go - About 40 mins to fix

                                Method portalProxy.initialiseConsoleConfig has 6 return statements (exceeds 4 allowed).
                                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 {
                                Severity: Major
                                Found in src/jetstream/setup_console.go - About 40 mins to fix

                                  Method UserFavorites.setMetadata has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func (uf *UserFavorites) setMetadata(c echo.Context) error {
                                  
                                      store, err := userfavoritesstore.NewFavoritesDBStore(uf.portalProxy.GetDatabaseConnection())
                                      if err != nil {
                                          return err
                                  Severity: Major
                                  Found in src/jetstream/plugins/userfavorites/favorites.go - About 40 mins to fix

                                    Method GeneratedEndpointPlugin.Connect has 6 return statements (exceeds 4 allowed).
                                    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
                                    Severity: Major
                                    Found in src/jetstream/plugins/yamlgenerated/main.go - About 40 mins to fix

                                      Method portalProxy.buildCNSIList has 6 return statements (exceeds 4 allowed).
                                      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")
                                      Severity: Major
                                      Found in src/jetstream/cnsi.go - About 40 mins to fix

                                        Function saveLocalUserConsoleConfig has 6 return statements (exceeds 4 allowed).
                                        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 {
                                        Severity: Major
                                        Found in src/jetstream/setup_console.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language