Showing 718 of 1,370 total issues
Function MigrateSetupData
has 15 return statements (exceeds 4 allowed). Open
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 getYDomainLine
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
Open
getYDomainLine(): any[] {
const domain = [];
for (const results of this.lineChart) {
for (const d of results.series) {
- 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 parseAuth
has a Cognitive Complexity of 15 (exceeds 8 allowed). Consider refactoring. Open
Open
public parseAuth(cluster: KubeConfigFileCluster, user: KubeConfigFileUser): RowState {
// Default subtype is generic Kubernetes ('') or previously determined/selected sub type
cluster._subType = cluster._subType || '';
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ngOnInit() {
this.addOrg = new FormGroup({
orgName: new FormControl('', [Validators.required as any, this.nameTakenValidator()]),
quotaDefinition: new FormControl(),
});
Function ngOnInit
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ngOnInit() {
this.appSub$ = this.applicationService.entityService.entityMonitor.entityRequest$.subscribe(requestInfo => {
if (
requestInfo.deleting.deleted ||
requestInfo.error
Function apply
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private apply(response) {
if (response) {
// In order to supplement the sanitizers with extra properties need to create new obj (see spread below and `reduce`)
response = {
...response,
Function userFavoriteGroupsReducer
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function userFavoriteGroupsReducer(
state: IUserFavoritesGroupsState = getDefaultFavoriteGroupsState(),
action: Action
): IUserFavoritesGroupsState {
switch (action.type) {
Method UserInvite.UAAUserInvite
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
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)
Method Analysis.checkStatus
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *Analysis) checkStatus() error {
log.Debug("Checking status....")
p := c.portalProxy
// Create a record in the reports datastore
dbStore, err := store.NewAnalysisDBStore(p.GetDatabaseConnection())
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
store: Store<CFAppState>,
datePipe: DatePipe,
scmService: GitSCMService
) {
Function waitForRow
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function waitForRow() {
// Timeout after 32 attempts (each 5 seconds, which is just under 3 minutes)
let retries = 32;
const sub = timer(5000, 5000).pipe(
switchMap(() => promise.all<boolean | number | TableData[]>([
Function autoscalerTransformMapToArray
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function autoscalerTransformMapToArray(oldPolicy: AppAutoscalerPolicyLocal) {
const newPolicy: AppAutoscalerPolicy = {
instance_min_count: oldPolicy.instance_min_count,
instance_max_count: oldPolicy.instance_max_count
};
Method PgsqlTokenRepository.UpdateTokenAuth
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
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."
Function constructAmalgamatedObservables
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private constructAmalgamatedObservables() {
// Assign/Amalgamate them to public properties (with mangling if required)
const appStats = cfEntityCatalog.appStats.store.getPaginationService(this.appGuid, this.cfGuid);
// This will fail to fetch the app stats if the current app is not running but we're
// willing to do this to speed up the initial fetch for a running application.
Function generateCfOrgEntity
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generateCfOrgEntity(endpointDefinition: StratosEndpointExtensionDefinition) {
const orgDefinition: IStratosEntityDefinition = {
type: organizationEntityType,
schema: cfEntityFactory(organizationEntityType),
label: 'Organization',
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
store: Store<CFAppState>,
appService: ApplicationService,
datePipe: DatePipe,
currentUserPermissionService: CurrentUserPermissionsService,
Function getPaginationUpdater
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getPaginationUpdater = (types: [string, string, string]) => {
const [requestType, successType, failureType] = types;
return (state: PaginationEntityState = getDefaultPaginationEntityState(), action): PaginationEntityState => {
switch (action.type) {
case requestType:
Function canActivate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
canActivate(route: ActivatedRouteSnapshot, routeState: RouterStateSnapshot): Observable<boolean> {
// Reroute user to endpoint/no endpoint screens if there are no connected or registered endpoints
return observableCombineLatest(
this.store.select('auth'),
this.store.select(endpointStatusSelector)
Function setActive
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setActive(index: number) {
if (this.basePreviousRedirect && index < 0) {
this.dispatchRedirect(this.basePreviousRedirect);
}
if (!this.canGoto(index)) {
Function ngOnInit
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
Confirmed
ngOnInit() {
if (!this.connectionStatus) {
return;
}