Showing 650 of 1,370 total issues
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),
- 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 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(),
- 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 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;
}
- 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 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 ?
- 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 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
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 handleCreateServiceResult
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private handleCreateServiceResult(request: RequestInfoState, state: CreateServiceInstanceState): Observable<StepOnNextResult> {
const bindApp = !!state.bindAppGuid;
if (this.longRunningOpService.isLongRunning(request)) {
// This request has taken too long for the browser/jetstream and is on going. Treat this as a success
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 generateCFServicePlanEntity
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateCFServicePlanEntity(endpointDefinition: StratosEndpointExtensionDefinition) {
const definition: IStratosEntityDefinition = {
type: servicePlanEntityType,
schema: cfEntityFactory(servicePlanEntityType),
label: 'Service Plan',
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
private store: Store<CFAppState>,
private appService: ApplicationService,
private utilsService: UtilsService,
private router: Router,
Function generateCFServiceEntity
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateCFServiceEntity(endpointDefinition: StratosEndpointExtensionDefinition) {
const definition: IStratosEntityDefinition = {
type: serviceEntityType,
schema: cfEntityFactory(serviceEntityType),
label: 'Service',
Function generateStackEntity
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateStackEntity(endpointDefinition: StratosEndpointExtensionDefinition) {
const definition: IStratosEntityDefinition = {
type: stackEntityType,
schema: cfEntityFactory(stackEntityType),
label: 'Stack',
Function currentCfUserRolesReducer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const currentCfUserRolesReducer: EntityUserRolesReducer<IAllCfRolesState> = (
state: IAllCfRolesState = {},
action: Action
): IAllCfRolesState => {
switch (action.type) {
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
private store: Store<AppState>,
public id: string,
public entityKey: string,
public schema: EntitySchema,
Function generateCFDomainEntity
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateCFDomainEntity(endpointDefinition: StratosEndpointExtensionDefinition) {
const definition: IStratosEntityDefinition = {
type: domainEntityType,
schema: cfEntityFactory(domainEntityType),
label: 'Domain',
Function generateJsonSchemaFromObject
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function generateJsonSchemaFromObject(title, object) {
let processOutput;
const output: any = {
$schema: DRAFT
};
Function ngOnInit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
if (!this.id) {
return;
}
Function isNewer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public isNewer(other: Version): boolean {
if (!this.valid || !other.valid) {
return false;
}
Function makeRequest
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private makeRequest(
method: string,
op: string,
busyMsg: string,
okMsg: string,