Showing 718 of 1,370 total issues
Method Analyzer.doStatus
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
func (a *Analyzer) doStatus(ec echo.Context) error {
log.Debug("Status")
req := ec.Request()
// Body contains an array of IDs that the client thinks are running
- 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 fetchManifest
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
func fetchManifest(repoPath string, stratosProject StratosProject, clientWebSocket *websocket.Conn) (Applications, string, error) {
var manifest Applications
// Can be either manifest.yml or manifest.yaml
- 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 HelmRelease.UpdateResources
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
func (r *HelmRelease) UpdateResources(jetstream interfaces.PortalProxy) {
// This will be an array of resources
runner := NewKubeAPIJob(jetstream, r.Jobs)
res := runner.Run()
for _, j := range res {
- 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 UserInvite.SendEmail
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
func (invite *UserInvite) SendEmail(emailAddress, inviteLink string, endpoint interfaces.CNSIRecord) error {
log.Debugf("User Invite: Sending Email to: %s", emailAddress)
mailHost := fmt.Sprintf("%s:%d", invite.Config.SMTP.Host, invite.Config.SMTP.Port)
var auth smtp.Auth
- 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 UserInvite.UAAUserInvite
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
func (invite *UserInvite) UAAUserInvite(c echo.Context, endpoint interfaces.CNSIRecord, uaaInviteReq *UserInviteReq) (*UserInviteResponse, error) {
log.Debug("Requesting invite links from UAA")
// See if we can get a token for the invite user
token, ok := invite.portalProxy.GetCNSITokenRecord(endpoint.GUID, UserInviteUserID)
- 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 KubernetesSpecification.Info
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
func (c *KubernetesSpecification) Info(apiEndpoint string, skipSSLValidation bool) (interfaces.CNSIRecord, interface{}, error) {
log.Debug("Kubernetes Info")
var v2InfoResponse interfaces.V2Info
var newCNSI interfaces.CNSIRecord
- 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 13 (exceeds 8 allowed). Consider refactoring. Open
func init() {
RegisterMigration(20190522121200, "LocalUsers", func(txn *sql.Tx, conf *goose.DBConf) error {
binaryDataType := "BYTEA"
if strings.Contains(conf.Driver.Name, "mysql") {
binaryDataType = "BLOB"
- 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.setupGetAvailableScopes
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
func (p *portalProxy) setupGetAvailableScopes(c echo.Context) error {
// Check if already set up
if p.GetConfig().ConsoleConfig.IsSetupComplete() {
return c.NoContent(http.StatusServiceUnavailable)
- 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.DoLoginToCNSIwithConsoleUAAtoken
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
func (p *portalProxy) DoLoginToCNSIwithConsoleUAAtoken(c echo.Context, theCNSIrecord interfaces.CNSIRecord) error {
userID, err := p.GetSessionStringValue(c, "user_id")
if err != nil {
return errors.New("could not find correct session value")
}
- 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 createCfOrSpaceMultipleFilterFn
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
export const createCfOrSpaceMultipleFilterFn = (
store: Store<CFAppState>,
action: PaginatedAction,
setQParam: (setQ: QParam, qs: QParam[]) => boolean,
preResetUpdate?: () => void
- 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(
private activatedRoute: ActivatedRoute,
router: Router
) {
const serviceId = getIdFromRoute(activatedRoute, 'serviceId');
- 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 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 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 initErrorSub
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
initErrorSub() {
if (this.appAutoscalerPolicyErrorSub) {
this.appAutoscalerScalingHistoryErrorSub.unsubscribe();
}
Function jsonFilter
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
jsonFilter(jsonString) {
try {
const messageObj = JSON.parse(jsonString);
if (!messageObj) {
return;
Function makeRequest
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private makeRequest(
method: string,
op: string,
busyMsg: string,
okMsg: string,
Function ngOnInit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
if (!this.id) {
return;
}
Function removeFavoriteFromGroup
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function removeFavoriteFromGroup(state: IUserFavoritesGroups, action: RemoveUserFavoriteSuccessAction): IUserFavoritesGroups {
const { favorite } = action;
const endpointGuid = getEndpointIDFromFavorite(favorite);
const userGroup = state[endpointGuid] || getDefaultFavoriteGroup();
// Favorite will not have and entityId if it is for an endpoint