Showing 650 of 1,370 total issues
File home-page.component.ts
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ScrollDispatcher } from '@angular/cdk/scrolling';
import {
AfterViewInit,
Component,
ElementRef,
File build-tab.component.ts
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { GitCommit, gitEntityCatalog, GitRepo, GitSCMService, GitSCMType, SCMIcon } from '@stratosui/git';
import { combineLatest as observableCombineLatest, Observable, of as observableOf, of } from 'rxjs';
Method portalProxy.updateEndpoint
has 88 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *portalProxy) updateEndpoint(ec echo.Context) error {
log.Debug("updateEndpoint")
params := new(interfaces.UpdateEndpointParams)
if err := ec.Bind(params); err != nil {
File pgsql_tokens.go
has 521 lines of code (exceeds 500 allowed). Consider refactoring. Open
package tokens
import (
"database/sql"
"errors"
Function onPrepare
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
onPrepare() {
// https://webdriver.io/docs/api/chromium.html#setnetworkconditions
// browser.driver.setNetworkConditions({
// offline: false,
// latency: 2000, // Additional latency (ms).
File helm-release-helper.service.ts
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Injectable } from '@angular/core';
import { combineLatest, Observable } from 'rxjs';
import { filter, map } from 'rxjs/operators';
import { helmEntityCatalog } from '../../../../helm/helm-entity-catalog';
Function ngOnInit
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
const guid = this.kubeEndpointService.baseKube.guid;
const podsObs = kubeEntityCatalog.pod.store.getPaginationService(guid);
const pods$ = podsObs.entities$;
File form.po.ts
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { browser, by, element, promise } from 'protractor';
import { ElementArrayFinder, ElementFinder, protractor } from 'protractor/built';
import { Key } from 'selenium-webdriver';
import { Component } from './component.po';
Function constructor
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
gitSCMService: GitSCMService,
activatedRoute: ActivatedRoute,
private fb: FormBuilder,
private snackBarService: SnackBarService,
Function parseAuth
has 61 lines of code (exceeds 25 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 || '';
Function authReducer
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function authReducer(state: AuthState = defaultState, action): AuthState {
switch (action.type) {
case LOGIN:
return { ...state, loggingIn: true, loggedIn: false, error: false };
case LOGIN_SUCCESS:
Function extractArchiveFiles
has a Cognitive Complexity of 21 (exceeds 8 allowed). Consider refactoring. Open
func extractArchiveFiles(archivePath, chartName, downloadFolder string, filenames []string) error {
// Map the filenames array into a map of path to destination file
requiredFiles := make(map[string]string)
requiredCount := len(filenames)
for _, name := range filenames {
- 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 CloudFoundrySpecification.cfLoginHook
has a Cognitive Complexity of 21 (exceeds 8 allowed). Consider refactoring. Open
func (c *CloudFoundrySpecification) cfLoginHook(context echo.Context) error {
cfAPI, cfCnsi, err := c.fetchAutoRegisterEndpoint()
// CF auto reg url missing, continue as normal
if cfAPI == "" {
- 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 PgsqlTokenRepository.SaveCNSIToken
has a Cognitive Complexity of 21 (exceeds 8 allowed). Consider refactoring. Open
func (p *PgsqlTokenRepository) SaveCNSIToken(cnsiGUID string, userGUID string, tr interfaces.TokenRecord, encryptionKey []byte) error {
log.Debug("SaveCNSIToken")
if cnsiGUID == "" {
msg := "Unable to save CNSI Token without a valid CNSI GUID."
log.Debug(msg)
- 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 validate
has a Cognitive Complexity of 21 (exceeds 8 allowed). Consider refactoring. Open
private validate(endpoints: EndpointModel[], cluster: KubeConfigFileCluster, clusters: KubeConfigFileCluster[]) {
cluster._invalid = false;
let reset = true;
const found = endpoints.find(item => item.name === cluster.name);
- 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 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 setupSpaceLevelTest
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupSpaceLevelTest(
selectAddRemove: (rb: RadioGroup) => void,
checkInitialState: () => void,
checkFinishingState: () => void) {
it('Check initial state and get to stepper', () => {
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));
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)