Showing 650 of 1,370 total issues
Function updateUserMissingRoles
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateUserMissingRoles(users: IRequestEntityTypeState<APIResource<CfUser>>, action: APISuccessOrFailedAction<NormalizedResponse>) {
// At this point in the flow the request flow (APISuccessOrFailedAction), the users may or may not be in the store yet
// (via WrapperRequestActionSuccess). Therefore in order to avoid partial entities we need to stick the whole user set into the store
// including `missingRoles`.
const usersInResponse: IRequestEntityTypeState<APIResource<CfUser>> = action.response.entities[cfUserEntityType];
Function installChart
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
installChart(): Observable<StepOnNextResult> {
const endpoint = getMonocularEndpoint(this.route, null, null);
// Build the request body
const values: HelmInstallValues = {
...this.details.value,
Function mapPods
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private mapPods(pods: KubernetesPod[]): HelmReleaseChartData {
const podPhases: { [phase: string]: number, } = {};
const containers = {
ready: {
name: 'Ready',
Function load
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
load(): Observable<boolean> {
const guid = this.endpoint.guid;
const podsObs = kubeEntityCatalog.pod.store.getPaginationService(guid);
const pods$ = podsObs.entities$;
const nodesObs = kubeEntityCatalog.node.store.getPaginationService(guid);
Function constructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
public kubeEndpointService: KubernetesEndpointService,
public activatedRoute: ActivatedRoute,
public store: Store<AppState>,
private snackbarService: SnackBarService
Method KubeTerminal.Start
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
func (k *KubeTerminal) Start(c echo.Context) error {
log.Debug("Kube Terminal start request")
endpointGUID := c.Param("guid")
userGUID := c.Get("user_id").(string)
- 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 TokenStore.FindCNSIToken
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
func (d *TokenStore) FindCNSIToken(cnsiGUID string, userGUID string, encryptionKey []byte) (interfaces.TokenRecord, error) {
local, cfg, err := ListKubernetes()
if err == nil {
for _, cluster := range local {
- 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 MigrateSetupData
has 15 return statements (exceeds 4 allowed). Open
func MigrateSetupData(portal interfaces.PortalProxy, configStore Repository) error {
// Determine if we need to migrate data first
_, ok, err := configStore.GetValue(systemGroupName, configSetupNeededMarker)
if err != nil {
Function parseAuth
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
public parseAuth(cluster: KubeConfigFileCluster, user: KubeConfigFileUser): RowState {
// Default subtype is generic Kubernetes ('') or previously determined/selected sub type
cluster._subType = cluster._subType || '';
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
this.addOrg = new FormGroup({
orgName: new FormControl('', [Validators.required as any, this.nameTakenValidator()]),
quotaDefinition: new FormControl(),
});
Function ngOnInit
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
this.boundApps$ = combineLatest([
this.config$.asObservable().pipe(first()),
this.row$
]).pipe(
Function userFavoriteGroupsReducer
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function userFavoriteGroupsReducer(
state: IUserFavoritesGroupsState = getDefaultFavoriteGroupsState(),
action: Action
): IUserFavoritesGroupsState {
switch (action.type) {
Function getActionBuilder
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getActionBuilder(
configOrBuilder: OrchestratedActionBuilder |
EntityRequestActionConfig<OrchestratedActionBuilder> |
PaginationRequestActionConfig<OrchestratedActionBuilder>,
actionKey: string,
Function apply
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private apply(response) {
if (response) {
// In order to supplement the sanitizers with extra properties need to create new obj (see spread below and `reduce`)
response = {
...response,
Function getPaginationStore
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getPaginationStore<Y, ABC extends OrchestratedActionBuilders = OrchestratedActionBuilders>(
builders: KnownActionBuilders<ABC>,
entityKey: string,
getSchema: (schema: string) => EntitySchema
): CustomEntityCatalogEntityStore<Y, ABC> {
Method Analysis.checkStatus
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c *Analysis) checkStatus() error {
log.Debug("Checking status....")
p := c.portalProxy
// Create a record in the reports datastore
dbStore, err := store.NewAnalysisDBStore(p.GetDatabaseConnection())
Method PgsqlTokenRepository.UpdateTokenAuth
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *PgsqlTokenRepository) UpdateTokenAuth(userGUID string, tr interfaces.TokenRecord, encryptionKey []byte) error {
log.Debug("UpdateTokenAuth")
if userGUID == "" {
msg := "Unable to save Token without a valid User GUID."
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
store: Store<CFAppState>,
datePipe: DatePipe,
scmService: GitSCMService
) {
Function waitForRow
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function waitForRow() {
// Timeout after 32 attempts (each 5 seconds, which is just under 3 minutes)
let retries = 32;
const sub = timer(5000, 5000).pipe(
switchMap(() => promise.all<boolean | number | TableData[]>([
Function setupList
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private setupList(store: Store<CFAppState>, appService: ApplicationService) {
const listActionAddRoute: IGlobalListAction<APIResource> = {
action: () => {
appService.application$.pipe(
take(1),