Showing 718 of 1,370 total issues
Function ngOnInit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
Confirmed
ngOnInit() {
this.connectionStatusSubject.next(0);
if (!this.applicationService.cfGuid || !this.applicationService.appGuid) {
this.messages = NEVER;
} else {
Function successEntityHandler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function successEntityHandler(
actionDispatcher: (actionToDispatch: Action) => void,
catalogEntity: StratosBaseCatalogEntity,
requestType: ApiRequestTypes,
action: EntityRequestAction,
Function checkPageLoad
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
checkPageLoad() {
let hasLoaded = false;
const errMsg = this.getStratosError();
if (!!errMsg) {
hasLoaded = true;
Function init
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private init() {
// Observabled for loading schema and values for the Chart
const schema$ = this.httpClient.get(this.schemaUrl).pipe(catchError(e => of(null)));
const values$: Observable<string> = this.httpClient.get(this.valuesUrl, { responseType: 'text' }).pipe(
catchError(e => of(null))
Function AddUnsigned
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static AddUnsigned( lX: number, lY: number ) : number
{
let lX4: number,
lY4: number,
lX8: number,
Method portalProxy.verifySession
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (p *portalProxy) verifySession(c echo.Context) error {
log.Debug("verifySession")
p.StratosAuthService.BeforeVerifySession(c)
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
store: Store<CFAppState>,
cfGuid: string,
appGuid: string,
listConfig: IListConfig<ListAppInstance>
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
cfGuid: string,
orgGuid: string,
spaceGuid: string,
store: Store<CFAppState>,
Function applyDefaultExcludes
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private applyDefaultExcludes() {
const defaultExcludedPackages = ['@example/theme', '@example/extensions', '@stratosui/desktop-extensions'];
if (this.stratosConfig && this.stratosConfig.packages && this.stratosConfig.packages.desktop) {
defaultExcludedPackages.pop();
this.log('Building with desktop package');
Function getBreadcrumbs
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected getBreadcrumbs(
endpoint: EndpointModel,
org: APIResource<IOrganization>,
space: APIResource<ISpace>
) {
Function ngOnInit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ngOnInit() {
if (this.placeholderMode) {
this.canRefresh = false;
this.hasEntities$ = of(false);
return;
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
store: Store<CFAppState>,
userPerms: CurrentUserPermissionsService,
activeRouteCfOrgSpace: ActiveRouteCfOrgSpace
) {
Function recentlyVisitedReducer
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function recentlyVisitedReducer(
state: IRecentlyVisitedState = getDefaultRecentState(),
action: Action
): IRecentlyVisitedState {
switch (action.type) {
Function paginationSuccess
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function paginationSuccess(state: PaginationEntityState, action): PaginationEntityState {
const { apiAction, response, result } = action;
let { totalResults, totalPages } = action;
totalResults = totalResults || (response ? response.result.length : state.totalResults);
totalPages = totalPages || (response ? response.totalPages : state.pageCount);
Function transformEntities
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(entities: KubernetesNode[], paginationState: PaginationEntityState) => {
if (!paginationState.clientPagination.filter.string) {
return entities;
}
Function getNodeStatusCount
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getNodeStatusCount(
nodes$: Observable<KubernetesNode[]>,
conditionType: string,
valueLabels: object = {},
countStatus = 'True'
Function map
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public map() {
if (!this.report.report) {
return;
}
Function EndpointRowStateSetUpManager
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function EndpointRowStateSetUpManager(
paginationMonitor: PaginationMonitor<EndpointModel>,
entityMonitorFactory: EntityMonitorFactory,
rowStateManager: TableRowStateManager
) {
Function transform
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
transform(value: string, args?: string): string {
if (!value) {
return '';
}
Method Monocular.getChartURL
has a Cognitive Complexity of 13 (exceeds 8 allowed). Consider refactoring. Open
Open
func (m *Monocular) getChartURL(repoURL, name, version string) (string, error) {
httpClient := m.portalProxy.GetHttpClient(true)
helmIndexURL := joinURL(repoURL, "index.yaml")
resp, err := httpClient.Get(helmIndexURL)
- 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"