Showing 1,395 of 1,395 total issues
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
store: Store<CFAppState>,
userPerms: CurrentUserPermissionsService,
activeRouteCfOrgSpace: ActiveRouteCfOrgSpace
) {
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 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 generateEventEntity
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generateEventEntity(endpointDefinition: StratosEndpointExtensionDefinition) {
const definition: IStratosEntityDefinition = {
type: cfEventEntityType,
schema: cfEntityFactory(cfEventEntityType),
label: 'Event',
Function handleSpaceRoleChange
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function handleSpaceRoleChange(
state: IAllCfRolesState,
endpointGuid: string,
cf: ICfRolesState,
orgGuid: string,
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 getBreadcrumbs
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected getBreadcrumbs(
endpoint: EndpointModel,
org: APIResource<IOrganization>,
space: APIResource<ISpace>
) {
Function storeToLocalStorageSyncReducer
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static storeToLocalStorageSyncReducer(reducer: ActionReducer<any>): ActionReducer<any> {
// This is done to ensure we don't accidentally apply state from session storage from another user.
let globalUserId = null;
return localStorageSync({
// Decide the key to store each section by
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 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 createProvider
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private createProvider(catalogEntity: any) {
this.isNamespacedView = !this.isWorkloadView && !!catalogEntity.definition.apiNamespaced;
let action;
if (this.isWorkloadView) {
action = catalogEntity.actions.getInWorkload(this.kubeId, this.workloadNamespace, this.workloadTitle);
Function endpointErrorsHandlerFactory
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const endpointErrorsHandlerFactory = (actionDispatcher: ActionDispatcher) => (
action: EntityRequestAction,
catalogEntity: StratosBaseCatalogEntity,
requestType: ApiRequestTypes,
errors: JetstreamError[]
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 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 map
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public map() {
if (!this.report.report) {
return;
}
Function transform
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
transform(value: string, args?: string): string {
if (!value) {
return '';
}
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(
types$: Observable<StratosCatalogEndpointEntity[]>,
store: Store<GeneralEntityAppState>
) {
this.store = store;
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 getNodeStatusCount
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getNodeStatusCount(
nodes$: Observable<KubernetesNode[]>,
conditionType: string,
valueLabels: object = {},
countStatus = 'True'
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"