Showing 718 of 1,370 total issues
Function setActive
has a Cognitive Complexity of 21 (exceeds 8 allowed). Consider refactoring. Open
setActive(index: number) {
if (this.basePreviousRedirect && index < 0) {
this.dispatchRedirect(this.basePreviousRedirect);
}
if (!this.canGoto(index)) {
- Read upRead up
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 getColors
has a Cognitive Complexity of 21 (exceeds 8 allowed). Consider refactoring. Open
private getColors(total: number, used: number) {
const percentage = (used / total) * 100;
// I'm sure this can be tidies up - NJ
if (this.thresholds) {
if (this.thresholds.hasOwnProperty('danger')) {
- Read upRead up
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 ngOnInit
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
if (this.setUsernames) {
this.blocked.next(false);
} else {
this.cfRolesService.loading$.subscribe(loading => this.blocked.next(loading));
Function ngOnInit
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
this.sourceType$ = this.store.select(selectSourceType);
// Set previously supplied docker values
this.subs.push(this.store.select(selectDeployAppState).pipe(
Method CFHosting.Init
has 84 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (ch *CFHosting) Init() error {
// Determine if we are running CF by presence of env var "VCAP_APPLICATION" and configure appropriately
if ch.portalProxy.Env().IsSet(VCapApplication) {
log.Info("Detected that Console is deployed as a Cloud Foundry Application")
Method PgsqlTokenRepository.findCNSIToken
has 84 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *PgsqlTokenRepository) findCNSIToken(cnsiGUID string, userGUID string, encryptionKey []byte, includeDisconnected bool) (interfaces.TokenRecord, error) {
log.Debug("findCNSIToken")
if cnsiGUID == "" {
msg := "Unable to find CNSI Token without a valid CNSI GUID."
log.Debug(msg)
File edit-autoscaler-policy-step4.component.ts
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, ValidatorFn, Validators } from '@angular/forms';
import { ErrorStateMatcher, ShowOnDirtyErrorStateMatcher } from '@angular/material/core';
import { ActivatedRoute } from '@angular/router';
import { Store } from '@ngrx/store';
CfUserService
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
@Injectable()
export class CfUserService {
private allUsers$: Observable<PaginationObservables<APIResource<CfUser>>>;
users: { [guid: string]: Observable<APIResource<CfUser>>; } = {};
Method portalProxy.getInfo
has 83 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *portalProxy) getInfo(c echo.Context) (*interfaces.Info, error) {
// get the version
versions, err := p.getVersionsData()
if err != nil {
return nil, errors.New("Could not find database version")
File application-tabs-base.component.ts
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, NgZone, OnDestroy, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { GitSCMService, GitSCMType } from '@stratosui/git';
import { combineLatest as observableCombineLatest, Observable, Subscription } from 'rxjs';
import { filter, first, map, startWith, switchMap, withLatestFrom } from 'rxjs/operators';
Method Analyzer.doRun
has 82 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (a *Analyzer) doRun(ec echo.Context) error {
log.Debug("Run analyzer!")
engine := ec.Param("analyzer")
Function constructor
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
public endpointsService: EndpointsService,
private store: Store<AppState>,
public userFavoriteManager: UserFavoriteManager,
private scrollDispatcher: ScrollDispatcher,
Method Monocular.procesChartVersions
has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring. Open
func (m *Monocular) procesChartVersions(endpoint, repoURL, repoName, name string, chartVersions []IndexFileMetadata) syncResult {
result := syncResult{}
// Find the newest version
- Read upRead up
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.processJsonResource
has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring. Open
func (r *HelmRelease) processJsonResource(obj interface{}) {
data, err := json.Marshal(obj)
if err == nil {
var t KubeResource
if err := json.Unmarshal(data, &t); err == nil {
- Read upRead up
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.doRequest
has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring. Open
func (p *portalProxy) doRequest(cnsiRequest *interfaces.CNSIRequest, done chan<- *interfaces.CNSIRequest) {
log.Debugf("doRequest for URL: %s", cnsiRequest.URL.String())
var body io.Reader
var res *http.Response
var req *http.Request
- Read upRead up
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.SetupMiddleware
has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring. Open
func (p *portalProxy) SetupMiddleware() echo.MiddlewareFunc {
return func(h echo.HandlerFunc) echo.HandlerFunc {
if !setupComplete {
- Read upRead up
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 ngOnInit
has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring. Open
ngOnInit() {
this.cardTwoFetching$ = this.applicationService.application$.pipe(
combineLatest(
this.applicationService.appSummary$
),
- Read upRead up
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 ngOnInit
has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring. Open
public ngOnInit() {
const contentElement = this.content.nativeElement;
const containerElement = this.container.nativeElement;
this.stopped$ = new BehaviorSubject<boolean>(false);
- Read upRead up
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 KubeDashboardProxy
has 81 lines of code (exceeds 50 allowed). Consider refactoring. 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 + "/"
Function validationLoop
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validationLoop(config: ValidateLoopConfig): ValidateEntityResult[] {
const { cfGuid, entities, parentRelation, allEntities, allPagination, newEntities, action } = config;
if (!entities) {
return [];