SUSE/stratos

View on GitHub

Showing 1,395 of 1,395 total issues

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

func (invite *UserInvite) UAAUserInvite(c echo.Context, endpoint interfaces.CNSIRecord, uaaInviteReq *UserInviteReq) (*UserInviteResponse, error) {
    log.Debug("Requesting invite links from UAA")

    // See if we can get a token for the invite user
    token, ok := invite.portalProxy.GetCNSITokenRecord(endpoint.GUID, UserInviteUserID)
Severity: Minor
Found in src/jetstream/plugins/userinvite/invite.go - About 1 hr 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.SendEmail has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

func (invite *UserInvite) SendEmail(emailAddress, inviteLink string, endpoint interfaces.CNSIRecord) error {
    log.Debugf("User Invite: Sending Email to: %s", emailAddress)
    mailHost := fmt.Sprintf("%s:%d", invite.Config.SMTP.Host, invite.Config.SMTP.Port)

    var auth smtp.Auth
Severity: Minor
Found in src/jetstream/plugins/userinvite/email.go - About 1 hr 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 fetchManifest has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

func fetchManifest(repoPath string, stratosProject StratosProject, clientWebSocket *websocket.Conn) (Applications, string, error) {

    var manifest Applications

    // Can be either manifest.yml or manifest.yaml
Severity: Minor
Found in src/jetstream/plugins/cfapppush/deploy.go - About 1 hr 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 KubernetesSpecification.Info has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
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: Minor
Found in src/jetstream/plugins/kubernetes/main.go - About 1 hr 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 Analyzer.doStatus has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

func (a *Analyzer) doStatus(ec echo.Context) error {
    log.Debug("Status")
    req := ec.Request()

    // Body contains an array of IDs that the client thinks are running
Severity: Minor
Found in src/jetstream/plugins/analysis/container/status.go - About 1 hr 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 HelmRelease.UpdateResources has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

func (r *HelmRelease) UpdateResources(jetstream interfaces.PortalProxy) {
    // This will be an array of resources
    runner := NewKubeAPIJob(jetstream, r.Jobs)
    res := runner.Run()
    for _, j := range res {
Severity: Minor
Found in src/jetstream/plugins/kubernetes/helm/release.go - About 1 hr 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 init has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

func init() {
    RegisterMigration(20190522121200, "LocalUsers", func(txn *sql.Tx, conf *goose.DBConf) error {
        binaryDataType := "BYTEA"
        if strings.Contains(conf.Driver.Name, "mysql") {
            binaryDataType = "BLOB"
Severity: Minor
Found in src/jetstream/datastore/20190522121200_LocalUsers.go - About 1 hr 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.setupGetAvailableScopes has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

func (p *portalProxy) setupGetAvailableScopes(c echo.Context) error {

    // Check if already set up
    if p.GetConfig().ConsoleConfig.IsSetupComplete() {
        return c.NoContent(http.StatusServiceUnavailable)
Severity: Minor
Found in src/jetstream/setup_console.go - About 1 hr 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.DoLoginToCNSIwithConsoleUAAtoken has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

func (p *portalProxy) DoLoginToCNSIwithConsoleUAAtoken(c echo.Context, theCNSIrecord interfaces.CNSIRecord) error {
    userID, err := p.GetSessionStringValue(c, "user_id")
    if err != nil {
        return errors.New("could not find correct session value")
    }
Severity: Minor
Found in src/jetstream/authcnsi.go - About 1 hr 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 createCfOrSpaceMultipleFilterFn has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

export const createCfOrSpaceMultipleFilterFn = (
  store: Store<CFAppState>,
  action: PaginatedAction,
  setQParam: (setQ: QParam, qs: QParam[]) => boolean,
  preResetUpdate?: () => void

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 13 (exceeds 8 allowed). Consider refactoring.
Open

  constructor(
    private activatedRoute: ActivatedRoute,
    router: Router
  ) {
    const serviceId = getIdFromRoute(activatedRoute, 'serviceId');

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 initialiseSpaceObservables has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

  private initialiseSpaceObservables() {
    this.space$ = this.cfUserService.isConnectedUserAdmin(this.cfGuid).pipe(
      switchMap(isAdmin => {
        const relations = [
          createEntityRelationKey(spaceEntityType, spaceQuotaEntityType),

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 arraysAreEqual has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

function arraysAreEqual(a1: any[], a2: any[]): boolean {
  if (a1.length !== a2.length) {
    return false;
  }

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 13 (exceeds 8 allowed). Consider refactoring.
Open

  constructor() {
    super();
    this.artifactHubAndHelmRepoTypes$ = stratosEntityCatalog.endpoint.store.getAll.getPaginationService().entities$.pipe(
      filter(endpoints => !!endpoints), // Wait until we have some entities
      first(),

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 onChanges has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring.
Open

  onChanges() {
    this.sub = this.editProfileForm.valueChanges.subscribe(values => {
      // Old password is required if either email or new pw is specified (uaa)
      // or only if new pw is specified (local account)
      const required = this.needsPasswordForEmailChange ?

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 Monocular.fetchChartsFromArtifactHub has 52 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (m *Monocular) fetchChartsFromArtifactHub(c echo.Context, endpointID string) error {
    cacheFolder := path.Join(m.CacheFolder, endpointID)
    indexFile := path.Join(cacheFolder, "hub_index.json")
    if ok := useCachedFile(indexFile); ok {
        // Just send the cached file
Severity: Minor
Found in src/jetstream/plugins/monocular/artifacthub.go - About 1 hr to fix

    Function constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      constructor(
        store: Store<CFAppState>,
        datePipe: DatePipe,
        private cfOrgSpaceService: CfOrgSpaceDataService,
        currentUserPermissionsService: CurrentUserPermissionsService,

      Function fetchCfUserRole has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function fetchCfUserRole(store: Store<AppState>, action: GetCurrentCfUserRelations, httpClient: HttpClient): Observable<boolean> {
        const url = `pp/v1/proxy/v2/users/${action.guid}/${action.relationType}`;
        const params = {
          headers: {
            'x-cap-cnsi-list': action.endpointGuid,

        Function constructor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          constructor(
            listConfig: ListConfig<APIResource>,
          ) {
            this.filtersFormGroup = new FormGroup({
              actee: new FormControl(null, []),

          Function initErrorSub has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            initErrorSub() {
              if (this.appAutoscalerPolicyErrorSub) {
                this.appAutoscalerScalingHistoryErrorSub.unsubscribe();
              }
          
          
            Severity
            Category
            Status
            Source
            Language