SUSE/stratos

View on GitHub

Showing 1,395 of 1,395 total issues

Method KubernetesSpecification.ProxyKubernetesAPI has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func (c *KubernetesSpecification) ProxyKubernetesAPI(userID string, f KubeProxyFunc) (KubeProxyResponses, error) {

    var p = c.portalProxy
    k8sList := make([]*interfaces.ConnectedEndpoint, 0)
    eps, err := p.ListEndpointsByUser(userID)
Severity: Minor
Found in src/jetstream/plugins/kubernetes/api_proxy.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function makePrometheusRequestInfos has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func makePrometheusRequestInfos(c echo.Context, userGUID string, metrics map[string]EndpointMetricsRelation, prometheusOp string, queries string, addJob bool) []interfaces.ProxyRequestInfo {
    // Construct the metadata for proxying
    requests := make([]interfaces.ProxyRequestInfo, 0)
    for _, metric := range metrics {
        req := interfaces.ProxyRequestInfo{}
Severity: Minor
Found in src/jetstream/plugins/metrics/cloud_foundry.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function KubeDashboardStatus has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func KubeDashboardStatus(p interfaces.PortalProxy, endpointGUID, userGUID string, includeToken bool) (*StatusResponse, error) {

    status := &StatusResponse{
        Endpoint:  endpointGUID,
        Installed: false,
Severity: Minor
Found in src/jetstream/plugins/kubernetes/dashboard/status.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method UserInvite.refreshToken has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func (invite *UserInvite) refreshToken(clientID, clientSecret string, endpoint interfaces.CNSIRecord) (*interfaces.UAAResponse, *interfaces.TokenRecord, error) {
    now := time.Now()
    clientSecret = strings.TrimSpace(clientSecret)
    authEndpoint := fmt.Sprintf("%s/oauth/token", endpoint.TokenEndpoint)

Severity: Minor
Found in src/jetstream/plugins/userinvite/auth.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function NewKubeTerminal has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func NewKubeTerminal(p interfaces.PortalProxy) *KubeTerminal {
    // Only enabled in tech preview
    if !p.GetConfig().EnableTechPreview {
        log.Info("Kube Terminal not enabled - requires tech preview")
        return nil
Severity: Minor
Found in src/jetstream/plugins/kubernetes/terminal/terminal.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function detectTLSCert has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func detectTLSCert(pc interfaces.PortalConfig) (string, string, error) {
    log.Debug("detectTLSCert")
    certFilename := "pproxy.crt"
    certKeyFilename := "pproxy.key"

Severity: Minor
Found in src/jetstream/main.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method UserInvite.invite has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func (invite *UserInvite) invite(c echo.Context) error {
    log.Debug("Invite User")
    cfGUID := c.Param("id")

    // Check that there is an endpoint with the specified ID and that it is a Cloud Foundry endpoint
Severity: Minor
Found in src/jetstream/plugins/userinvite/invite.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method portalProxy.logoutOfCNSI has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func (p *portalProxy) logoutOfCNSI(c echo.Context) error {
    log.Debug("logoutOfCNSI")

    cnsiGUID := c.Param("cnsi_guid")

Severity: Minor
Found in src/jetstream/authcnsi.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function NewConfigFileLookup has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func NewConfigFileLookup(path string) env.Lookup {

    // Check if the config file exists
    if _, err := os.Stat(path); err != nil {
        return env.NoopLookup
Severity: Minor
Found in src/jetstream/repository/interfaces/config/config.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getJSONValue has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func getJSONValue(data map[string]interface{}, valuePath string) string {
    parts := strings.Split(valuePath, ".")
    value := data[parts[0]]
    if value != nil {
        if len(parts) == 1 {
Severity: Minor
Found in src/jetstream/plugins/yamlgenerated/main.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method portalProxy.login has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

func (p *portalProxy) login(c echo.Context, skipSSLValidation bool, client string, clientSecret string, endpoint string) (uaaRes *interfaces.UAAResponse, u *interfaces.JWTUserTokenInfo, err error) {
    log.Debug("login")
    if c.Request().Method == http.MethodGet {
        code := c.QueryParam("code")
        state := c.QueryParam("state")
Severity: Minor
Found in src/jetstream/auth.go - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function autoscalerTransformMapToArray has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

export function autoscalerTransformMapToArray(oldPolicy: AppAutoscalerPolicyLocal) {
  const newPolicy: AppAutoscalerPolicy = {
    instance_min_count: oldPolicy.instance_min_count,
    instance_max_count: oldPolicy.instance_max_count
  };

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getXDomainLine has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

  getXDomainLine(): any[] {
    let values = [];

    for (const results of this.lineChart) {
      for (const d of results.series) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function createPaginationAction has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

  public createPaginationAction(isAdmin: boolean, cfGuid: string, orgGuid?: string, spaceGuid?: string): Observable<PaginatedAction> {
    if (isAdmin) {
      const allCfUsersAction = this.createCfGetAllUsersAction(cfGuid);

      if (!orgGuid) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function mapMetricsToStates has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

  private mapMetricsToStates(values: [number, string][]): CfCellHealthEntry[] {
    // Create a new collection containing only the change of state
    const newValues = values.reduce((res, value, index) => {
      const timestamp = value['0'];
      const state = value['1'];

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function initServiceObservables has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

  private initServiceObservables() {
    this.serviceEntityService = cfEntityCatalog.service.store.getEntityService(this.serviceGuid, this.cfGuid, {});
    this.service$ = this.serviceEntityService.waitForEntity$.pipe(
      filter(o => !!o && !!o.entity),
      map(o => o.entity),

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function open has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

  open() {
    if (this.isOpen) {
      return;
    }

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getPreviousModes has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

  getPreviousModes(toEndOfMatch) {
    let escapeMatch = ANSI_ESCAPE_MATCHER.exec(toEndOfMatch);
    let boldOn = null;
    let prevColour = null;
    let lastColourMatches = null;

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function constructor has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

  constructor(
    public applicationService: ApplicationService,
    private store: Store<CFAppState>,
    private endpointsService: EndpointsService,
    private ngZone: NgZone,

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getSafeObservables has a Cognitive Complexity of 9 (exceeds 8 allowed). Consider refactoring.
Open

  private getSafeObservables(
    org$?: Observable<EntityInfo<APIResource<IOrganization>>>,
    space$?: Observable<EntityInfo<APIResource<ISpace>>>
  ) {
    if (space$ && org$) {

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language