Showing 650 of 1,370 total issues
Method portalProxy.writeSessionHook
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
func (p *portalProxy) writeSessionHook(c echo.Context) func() {
return func() {
// Has the session been modified and need saving?
sessionModifed := c.Get(jetStreamSessionContextUpdatedKey)
sessionIntf := c.Get(jetStreamSessionContextKey)
- 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 portalProxy.RefreshOidcToken
has 5 return statements (exceeds 4 allowed). Open
func (p *portalProxy) RefreshOidcToken(skipSSLValidation bool, cnsiGUID, userGUID, client, clientSecret, tokenEndpoint string) (t interfaces.TokenRecord, err error) {
log.Debug("RefreshOidcToken")
userToken, ok := p.GetCNSITokenRecordWithDisconnected(cnsiGUID, userGUID)
if !ok {
return t, fmt.Errorf("Info could not be found for user with GUID %s", userGUID)
Function getKubeDashboardService
has 5 return statements (exceeds 4 allowed). Open
func getKubeDashboardService(p interfaces.PortalProxy, cnsiGUID, userGUID string, labelSelector string) (ServiceInfo, error) {
log.Debug("getKubeDashboardService request")
info := ServiceInfo{}
response, err := p.DoProxySingleRequest(cnsiGUID, userGUID, "GET", "/api/v1/services?labelSelector="+labelSelector, nil, nil)
Method PostgresCNSIRepository.UpdateMetadata
has 5 return statements (exceeds 4 allowed). Open
func (p *PostgresCNSIRepository) UpdateMetadata(guid string, metadata string) error {
log.Debug("UpdateMetadata")
if guid == "" {
msg := "Unable to update Endpoint without a valid guid."
Function readCFFile
has 5 return statements (exceeds 4 allowed). Open
func readCFFile() (*CFConfigFile, *url.URL, error) {
var url *url.URL
usr, err := user.Current()
if err != nil {
Function readKubeConfigFile
has 5 return statements (exceeds 4 allowed). Open
func readKubeConfigFile() (*clientcmdapi.Config, error) {
// Use the KUBECONFIG env var if set, otherwise use default
kcFile := os.Getenv("KUBECONFIG")
if len(kcFile) == 0 {
Function parseConsoleConfigFromForm
has 5 return statements (exceeds 4 allowed). Open
func parseConsoleConfigFromForm(c echo.Context) (*interfaces.ConsoleConfig, error) {
consoleConfig := new(interfaces.ConsoleConfig)
// Local admin user configuration?
password := c.FormValue("local_admin_password")
Method ConsoleConfig.IsSetupComplete
has 5 return statements (exceeds 4 allowed). Open
func (consoleConfig *ConsoleConfig) IsSetupComplete() bool {
// No auth, then setup is complete
if AuthEndpointTypes[consoleConfig.AuthEndpointType] == AuthNone {
return true
Method KubeConfigFile.GetUserForCluster
has 5 return statements (exceeds 4 allowed). Open
func (k *KubeConfigFile) GetUserForCluster(clusterEndpoint string) (*KubeConfigUser, error) {
var cluster *KubeConfigCluster
var err error
Method portalProxy.RefreshOAuthToken
has 5 return statements (exceeds 4 allowed). Open
func (p *portalProxy) RefreshOAuthToken(skipSSLValidation bool, cnsiGUID, userGUID, client, clientSecret, tokenEndpoint string) (t interfaces.TokenRecord, err error) {
log.Debug("refreshToken")
userToken, ok := p.GetCNSITokenRecordWithDisconnected(cnsiGUID, userGUID)
if !ok {
return t, fmt.Errorf("Info could not be found for user with GUID %s", userGUID)
Method PgsqlTokenRepository.FindAuthToken
has 5 return statements (exceeds 4 allowed). Open
func (p *PgsqlTokenRepository) FindAuthToken(userGUID string, encryptionKey []byte) (interfaces.TokenRecord, error) {
log.Debug("FindAuthToken")
if userGUID == "" {
msg := "Unable to find UAA Token without a valid User GUID."
log.Debug(msg)
Function row
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
@Input('row')
set row(row: APIResource<IServiceInstance>) {
super.row = row;
if (row) {
this.serviceInstanceEntity = row;
- 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 jetstreamErrorHandler
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
export function jetstreamErrorHandler(
error: any,
action: EntityRequestAction,
catalogEntity: StratosBaseCatalogEntity,
requestType: ApiRequestTypes,
- 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 10 (exceeds 8 allowed). Consider refactoring. Open
constructor(
private store: Store<any>,
private route: ActivatedRoute,
router: Router,
kubeId: BaseKubeGuid,
- 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 a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
ngOnInit() {
const helmLastModifiedRegEx = /seconds:([0-9]*)/;
this.sessionData$ = this.store.select(s => s.auth).pipe(
- 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 arraysEqual
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
export const arraysEqual = (a: any[], b: any[]): boolean => {
// Both falsy
if (!a && !b) {
return 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
Function applyRoutesFromExtensions
has a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
private applyRoutesFromExtensions(router: Router) {
const routeConfig = [...router.config];
// Find the route that has the 'about' page as a child - this is the dashboard base
const dashboardRoute = routeConfig.find(r => {
- 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 a Cognitive Complexity of 10 (exceeds 8 allowed). Consider refactoring. Open
ngOnInit() {
const events$ = this.eventService.events$.pipe(
map(events => {
if (this.endpointOnly) {
return events.filter(event => event.key.split('-')[0] === 'endpointError');
- 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
Avoid too many return
statements within this function. Open
return {
label: 'Unknown',
indicator: StratosStatus.ERROR,
actions: null
};
Avoid too many return
statements within this function. Open
return {
...state,
isSetByUsername: isSetByUsernameAction.isSetByUsername
};