Showing 650 of 1,370 total issues
Method Monocular.syncOnStartup
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
func (m *Monocular) syncOnStartup() {
// Always sync all repositories on startup
// Get all of the helm endpoints
endpoints, err := m.portalProxy.ListEndpoints()
- 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 CFAppSSH.appSSH
has 13 return statements (exceeds 4 allowed). Open
func (cfAppSsh *CFAppSSH) appSSH(c echo.Context) error {
// Need to get info for the endpoint
// Get the CNSI and app IDs from route parameters
cnsiGUID := c.Param("cnsiGuid")
userGUID := c.Get("user_id").(string)
Function start
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
func start(config interfaces.PortalConfig, p *portalProxy, needSetupMiddleware bool, isUpgrade bool, envLookup *env.VarSet) error {
log.Debug("start")
e := echo.New()
e.HideBanner = true
e.HidePort = true
- 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 cnsiTokenBackup.restoreBackup
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
func (ctb *cnsiTokenBackup) restoreBackup(backup *RestoreRequest) error {
log.Debug("restoreBackup")
data := &BackupContent{}
if err := json.Unmarshal([]byte(backup.Data), data); 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 MetricsSpecification.getCloudFoundryMetrics
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
func (m *MetricsSpecification) getCloudFoundryMetrics(c echo.Context) error {
userGUID, err := m.portalProxy.GetSessionStringValue(c, "user_id")
if err != nil {
return errors.New("Could not find session user_id")
}
- 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 CFAppPush.deploy
has 13 return statements (exceeds 4 allowed). Open
func (cfAppPush *CFAppPush) deploy(echoContext echo.Context) error {
cnsiGUID := echoContext.Param("cnsiGuid")
orgGUID := echoContext.Param("orgGuid")
spaceGUID := echoContext.Param("spaceGuid")
Method portalProxy.DoRegisterEndpoint
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
func (p *portalProxy) DoRegisterEndpoint(cnsiName string, apiEndpoint string, skipSSLValidation bool, clientId string, clientSecret string, userId string, ssoAllowed bool, subType string, createSystemEndpoint bool, fetchInfo interfaces.InfoFunc) (interfaces.CNSIRecord, error) {
Function readLoop
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
func readLoop(c *websocket.Conn, stopchan chan<- bool, pausechan chan<- bool) {
for {
messageType, r, err := c.NextReader()
if 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
Function WaitForMigrations
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
func WaitForMigrations(db *sql.DB) error {
migrations := GetOrderedMigrations()
targetVersion := migrations[len(migrations)-1]
// Timeout after which we will give up
- 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 NewDatabaseConnectionParametersFromConfig
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
func NewDatabaseConnectionParametersFromConfig(dc DatabaseConfig) (DatabaseConfig, error) {
if len(dc.DatabaseProvider) == 0 {
dc.DatabaseProvider = DefaultDatabaseProvider
}
- 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.UpdateTokenAuth
has a Cognitive Complexity of 14 (exceeds 8 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."
- 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 mergeDeep
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
private mergeDeep(target, ...sources) {
if (!sources.length) {
return target;
}
const source = sources.shift();
- 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 setProps
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
setProps(props: KubernetesResourceViewerConfig) {
this.title = props.title;
this.analysis = props.analysis;
this.component = props.component;
- 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 init
has a Cognitive Complexity of 14 (exceeds 8 allowed). Consider refactoring. Open
init() {
const eventStreams = this.userActiveEvents.map((eventName) => {
return fromEvent(document, eventName);
});
- 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 14 (exceeds 8 allowed). Consider refactoring. Open
constructor(
private loggedInService: LoggedInService,
store: Store<AuthOnlyAppState>,
public themeService: ThemeService,
@Inject(DOCUMENT) private document: Document,
- 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 InstallDashboard
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
func InstallDashboard(p interfaces.PortalProxy, endpointGUID, userGUID string) error {
// Download the Yaml for the dashboard
kubeDashboardImage := p.Env().String("STRATOS_KUBERNETES_DASHBOARD_IMAGE", "")
if len(kubeDashboardImage) == 0 {
kubeDashboardImage = dashboardInstallYAMLDownloadURL
Function MigrateSetupData
has 56 lines of code (exceeds 50 allowed). Consider refactoring. 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 row
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Input()
set row(row: APIResource<IService>) {
super.row = row;
if (row && !this.spaceLink$) {
this.broker$ = cfEntityCatalog.serviceBroker.store.getEntityService(
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
private store: Store<CFAppState>,
private activeRouteCfOrgSpace: ActiveRouteCfOrgSpace,
private cfUserService: CfUserService,
private route: ActivatedRoute
Function unconfigure
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
unconfigure(cfGUID: string) {
const confirmation = new ConfirmationDialogConfig(
'Disable User Invitations',
`Are you sure you want to disable user invitation support?`,
'Disable'