SUSE/stratos

View on GitHub

Showing 1,395 of 1,395 total issues

Function buildMetricData has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  metricName: string,
  data: PaginationResponse<AppAutoscalerMetricData>,
  startTime: number,
  endTime: number,
  skipFormat: boolean,

    Function _normalize has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    var _normalize = function normalize(schema, input, parent, key, visit, addEntity, visitedEntities) {
    Severity: Major
    Found in src/frontend/packages/store/src/normalizr/normalizr.js - About 50 mins to fix

      Function handleOrgRoleChange has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        state: IAllCfRolesState,
        endpointGuid: string,
        cf: ICfRolesState,
        orgGuid: string,
        orgState: IOrgRoleState,

        Function buildMetricsChartConfig has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          metricsAction: MetricsAction,
          yAxisLabel: string,
          getSeriesName: (result) => string,
          dataType: ChartDataTypes = null,
          filterSeries?: MetricsFilterSeries,

          Method Monocular.artifactHubGetIcon has 8 return statements (exceeds 4 allowed).
          Open

          func (m *Monocular) artifactHubGetIcon(c echo.Context) error {
              endpoint := c.Param("guid")
              repo := c.Param("repo")
              chartName := c.Param("name")
              version := c.Param("version")
          Severity: Major
          Found in src/jetstream/plugins/monocular/artifacthub.go - About 50 mins to fix

            Function KubeDashboardProxy has 8 return statements (exceeds 4 allowed).
            Open

            func KubeDashboardProxy(c echo.Context, p interfaces.PortalProxy, config *rest.Config) error {
                log.Debugf("KubeDashboardProxy request for: %s", c.Request().RequestURI)
            
                cnsiGUID := c.Param("guid")
                prefix := "/pp/v1/apps/kubedash/ui/" + cnsiGUID + "/"
            Severity: Major
            Found in src/jetstream/plugins/kubernetes/dashboard/proxy.go - About 50 mins to fix

              Method KubernetesSpecification.Info has 8 return statements (exceeds 4 allowed).
              Open

              func (c *KubernetesSpecification) Info(apiEndpoint string, skipSSLValidation bool) (interfaces.CNSIRecord, interface{}, error) {
              
                  log.Debug("Kubernetes Info")
                  var v2InfoResponse interfaces.V2Info
                  var newCNSI interfaces.CNSIRecord
              Severity: Major
              Found in src/jetstream/plugins/kubernetes/main.go - About 50 mins to fix

                Method MetricsSpecification.createMetadata has 8 return statements (exceeds 4 allowed).
                Open

                func (m *MetricsSpecification) createMetadata(metricEndpoint *url.URL, httpClient http.Client, auth *MetricsAuth) (string, error) {
                    basicMetricRequest := fmt.Sprintf("%s/api/v1/query?query=firehose_total_metrics_received", metricEndpoint)
                    req, err := http.NewRequest("GET", basicMetricRequest, nil)
                    if err != nil {
                        msg := "Failed to create request for the Metrics Endpoint: %v"
                Severity: Major
                Found in src/jetstream/plugins/metrics/main.go - About 50 mins to fix

                  Function getSSHCode has 8 return statements (exceeds 4 allowed).
                  Open

                  func getSSHCode(authorizeEndpoint, clientID, token string, skipSSLValidation bool) (string, error) {
                      authorizeURL, err := url.Parse(authorizeEndpoint)
                      if err != nil {
                          return "", err
                      }
                  Severity: Major
                  Found in src/jetstream/plugins/cfappssh/app_ssh.go - About 50 mins to fix

                    Function InstallDashboard has 8 return statements (exceeds 4 allowed).
                    Open

                    func InstallDashboard(p interfaces.PortalProxy, endpointGUID, userGUID string) error {
                        // Download the Yaml for the dashboard
                        kubeDashboardImage := p.Env().String("STRATOS_KUBERNETES_DASHBOARD_IMAGE", "")
                        if len(kubeDashboardImage) == 0 {
                            kubeDashboardImage = dashboardInstallYAMLDownloadURL
                    Severity: Major
                    Found in src/jetstream/plugins/kubernetes/dashboard/configure.go - About 50 mins to fix

                      Function init has 8 return statements (exceeds 4 allowed).
                      Open

                      func init() {
                          RegisterMigration(20170818120003, "InitialSchema", func(txn *sql.Tx, conf *goose.DBConf) error {
                              binaryDataType := "BYTEA"
                              if strings.Contains(conf.Driver.Name, "mysql") {
                                  binaryDataType = "BLOB"
                      Severity: Major
                      Found in src/jetstream/datastore/20170818120003_InitialSchema.go - About 50 mins to fix

                        Function saveUAAConsoleConfig has 8 return statements (exceeds 4 allowed).
                        Open

                        func saveUAAConsoleConfig(consoleRepo console_config.Repository, consoleConfig *interfaces.ConsoleConfig) error {
                            log.Debugf("Saving ConsoleConfig: %+v", consoleConfig)
                        
                            if err := consoleRepo.SetValue(systemGroupName, "UAA_ENDPOINT", consoleConfig.UAAEndpoint.String()); err != nil {
                                return err
                        Severity: Major
                        Found in src/jetstream/setup_console.go - About 50 mins to fix

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                          describe('PodMetricsComponent', () => {
                            let component: PodMetricsComponent;
                            let fixture: ComponentFixture<PodMetricsComponent>;
                          
                            beforeEach(async(() => {
                          src/frontend/packages/kubernetes/src/kubernetes/kubernetes-tab-base/kubernetes-tab-base.component.spec.ts on lines 8..43

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 206.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                          describe('KubernetesTabBaseComponent', () => {
                            let component: KubernetesTabBaseComponent;
                            let fixture: ComponentFixture<KubernetesTabBaseComponent>;
                          
                            beforeEach(async(() => {
                          src/frontend/packages/kubernetes/src/kubernetes/pod-metrics/pod-metrics.component.spec.ts on lines 9..44

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 206.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                          describe('AutoscalerMetricPageComponent', () => {
                            let component: AutoscalerMetricPageComponent;
                            let fixture: ComponentFixture<AutoscalerMetricPageComponent>;
                          
                            beforeEach(async(() => {
                          src/frontend/packages/cf-autoscaler/src/features/edit-autoscaler-policy/edit-autoscaler-policy-step1/edit-autoscaler-policy-step1.component.spec.ts on lines 16..52

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 206.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                          describe('EditAutoscalerPolicyStep1Component', () => {
                            let component: EditAutoscalerPolicyStep1Component;
                            let fixture: ComponentFixture<EditAutoscalerPolicyStep1Component>;
                          
                            beforeEach(async(() => {
                          src/frontend/packages/cf-autoscaler/src/features/autoscaler-metric-page/autoscaler-metric-page.component.spec.ts on lines 16..52

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 206.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                          func mergeEndpoints(first, second []*interfaces.CNSIRecord) []*interfaces.CNSIRecord {
                          
                              if first == nil {
                                  return second
                              }
                          Severity: Minor
                          Found in src/jetstream/plugins/desktop/endpoints.go and 1 other location - About 45 mins to fix
                          src/jetstream/plugins/desktop/endpoints.go on lines 100..127

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 217.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                          func mergeConnectedEndpoints(first, second []*interfaces.ConnectedEndpoint) []*interfaces.ConnectedEndpoint {
                          
                              if first == nil {
                                  return second
                              }
                          Severity: Minor
                          Found in src/jetstream/plugins/desktop/endpoints.go and 1 other location - About 45 mins to fix
                          src/jetstream/plugins/desktop/endpoints.go on lines 70..97

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 217.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Method UserInvite.checkPermissions has 7 return statements (exceeds 4 allowed).
                          Open

                          func (invite *UserInvite) checkPermissions(c echo.Context, endpoint interfaces.CNSIRecord, userInviteRequest *UserInviteReq) error {
                              cfGUID := c.Param("id")
                              userGUID := c.Get("user_id").(string)
                          
                              // Get the User information for the endpoint connection
                          Severity: Major
                          Found in src/jetstream/plugins/userinvite/invite.go - About 45 mins to fix

                            Method CFAppPush.getGitSCMSource has 7 return statements (exceeds 4 allowed).
                            Open

                            func (cfAppPush *CFAppPush) getGitSCMSource(clientWebSocket *websocket.Conn, tempDir string, msg SocketMessage, userGUID string) (StratosProject, string, error) {
                                var (
                                    err error
                                )
                            
                            
                            Severity: Major
                            Found in src/jetstream/plugins/cfapppush/deploy.go - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language