Showing 718 of 1,370 total issues
File schema-tree-traverse.spec.ts
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { RecursiveDelete } from '../effects/recursive-entity-delete.effect';
import { EntitySchema } from './entity-schema';
import { EntitySchemaTreeBuilder, IFlatTreeValue } from './schema-tree-traverse';
describe('SchemaTreeTraversal', () => {
File cf-api.types.ts
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { APIResource } from '../../store/src/types/api.types';
import { IService, IServiceBinding } from './cf-api-svc.types';
import { CfUser } from './store/types/cf-user.types';
export interface StratosCFEntity {
Function deployAppReducer
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function deployAppReducer(state: DeployApplicationState = defaultState, action): DeployApplicationState {
switch (action.type) {
case SET_APP_SOURCE_DETAILS:
return {
...state,
Function StratosSpecReporter
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
var StratosSpecReporter = function (baseReporterDecorator, config) {
baseReporterDecorator(this);
const reporterConfig = Object.assign({}, config.stratosReporter);
this.file = reporterConfig.reportFile || './stratos-test-report.log';
Function createPodExpandedStatus
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
static createPodExpandedStatus(pod: KubernetesPod): KubernetesPodExpandedStatus {
let restarts = 0;
const totalContainers = pod.spec.containers ? pod.spec.containers.length : 0;
let readyContainers = 0;
ListHeaderComponent
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
export class ListHeaderComponent extends Component {
listLocator: ElementFinder;
constructor(locator: ElementFinder) {
File kubernetes.actions.ts
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { SortDirection } from '@angular/material/sort';
import { Action } from '@ngrx/store';
import { getActions } from 'frontend/packages/store/src/actions/action.helper';
import { ApiRequestTypes } from 'frontend/packages/store/src/reducers/api-request-reducer/request-helpers';
Method HelmRelease.parseManifest
has a Cognitive Complexity of 31 (exceeds 8 allowed). Consider refactoring. Open
func (r *HelmRelease) parseManifest() {
r.ManifestErrors = false
reader := bytes.NewReader([]byte(r.Manifest))
buffer := bufio.NewReader(reader)
var bufr strings.Builder
- 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 get
has a Cognitive Complexity of 31 (exceeds 8 allowed). Consider refactoring. Open
get(summary: any, appInstances: AppStat[]): ApplicationStateData {
const appState: string = summary ? summary.state : 'UNKNOWN';
const pkgState = this.getPackageState(appState, summary);
const wildcard = this.stateMetadata['?'];
- 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
File quota-definitions.actions.ts
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { HttpParams, HttpRequest } from '@angular/common/http';
import { PaginatedAction } from '../../../store/src/types/pagination.types';
import { ICFAction } from '../../../store/src/types/request.types';
import { IQuotaDefinition } from '../cf-api.types';
CfTopLevelPage
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
export class CfTopLevelPage extends CFPage {
private readonly until = protractor.ExpectedConditions;
constructor() {
Function ngOnInit
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
this.cardTwoFetching$ = this.applicationService.application$.pipe(
combineLatest(
this.applicationService.appSummary$
),
Function constructor
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
public activatedRoute: ActivatedRoute,
public kubeEndpointService: KubernetesEndpointService
) {
this.podName = activatedRoute.snapshot.params.podName;
File cf-org-space-service.service.ts
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Injectable, OnDestroy } from '@angular/core';
import { Store } from '@ngrx/store';
import { BehaviorSubject, combineLatest, Observable, of, Subscription } from 'rxjs';
import {
distinctUntilChanged,
Function getFolderSource
has a Cognitive Complexity of 30 (exceeds 8 allowed). Consider refactoring. Open
func getFolderSource(clientWebSocket *websocket.Conn, tempDir string, msg SocketMessage) (StratosProject, string, error) {
// The msg data is JSON for the Folder info
info := FolderSourceInfo{
WaitAfterUpload: 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
File autoscaler-transform-policy.spec.ts
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { isEqual } from './autoscaler-util';
import {
autoscalerTransformArrayToMap,
autoscalerTransformMapToArray,
} from './autoscaler-transform-policy';
File services-helper-e2e.ts
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { browser, promise, protractor } from 'protractor';
import { IService, IServiceInstance, IServicePlan } from '../../frontend/packages/cloud-foundry/src/cf-api-svc.types';
import { CFResponse, createEmptyCfResponse } from '../../frontend/packages/cloud-foundry/src/store/types/cf-api.types';
import { APIResource } from '../../frontend/packages/store/src/types/api.types';
File shared.module.ts
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { CdkTableModule } from '@angular/cdk/table';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
Method CFAppPush.deploy
has 121 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (cfAppPush *CFAppPush) deploy(echoContext echo.Context) error {
cnsiGUID := echoContext.Param("cnsiGuid")
orgGUID := echoContext.Param("orgGuid")
spaceGUID := echoContext.Param("spaceGuid")
Function ngOnInit
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
public ngOnInit() {
const contentElement = this.content.nativeElement;
const containerElement = this.container.nativeElement;
this.stopped$ = new BehaviorSubject<boolean>(false);