SUSE/stratos

View on GitHub

Showing 1,395 of 1,395 total issues

Function constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(
    store: Store<CFAppState>,
    userPerms: CurrentUserPermissionsService,
    activeRouteCfOrgSpace: ActiveRouteCfOrgSpace
  ) {

    Function constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    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

        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

        function generateEventEntity(endpointDefinition: StratosEndpointExtensionDefinition) {
          const definition: IStratosEntityDefinition = {
            type: cfEventEntityType,
            schema: cfEntityFactory(cfEventEntityType),
            label: 'Event',
        Severity: Minor
        Found in src/frontend/packages/cloud-foundry/src/cf-entity-generator.ts - About 1 hr to fix

          Function handleSpaceRoleChange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function handleSpaceRoleChange(
            state: IAllCfRolesState,
            endpointGuid: string,
            cf: ICfRolesState,
            orgGuid: string,

            Function constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              constructor(
                cfGuid: string,
                orgGuid: string,
                spaceGuid: string,
                store: Store<CFAppState>,

              Function getBreadcrumbs has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                protected getBreadcrumbs(
                  endpoint: EndpointModel,
                  org: APIResource<IOrganization>,
                  space: APIResource<ISpace>
                ) {

                Function storeToLocalStorageSyncReducer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                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
                Severity: Minor
                Found in src/frontend/packages/store/src/helpers/local-storage-service.ts - About 1 hr to fix

                  Function paginationSuccess has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  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

                      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');
                    Severity: Minor
                    Found in src/frontend/packages/devkit/src/lib/stratos.config.ts - About 1 hr to fix

                      Function createProvider has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      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

                        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

                          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

                                  (entities: KubernetesNode[], paginationState: PaginationEntityState) => {
                                    if (!paginationState.clientPagination.filter.string) {
                                      return entities;
                                    }
                            
                            

                              Function map has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                public map() {
                                  if (!this.report.report) {
                                    return;
                                  }
                              
                              

                                Function transform has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  transform(value: string, args?: string): string {
                                    if (!value) {
                                      return '';
                                    }
                                
                                

                                  Function constructor has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    constructor(
                                      types$: Observable<StratosCatalogEndpointEntity[]>,
                                      store: Store<GeneralEntityAppState>
                                    ) {
                                      this.store = store;

                                    Function EndpointRowStateSetUpManager has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function EndpointRowStateSetUpManager(
                                      paginationMonitor: PaginationMonitor<EndpointModel>,
                                      entityMonitorFactory: EntityMonitorFactory,
                                      rowStateManager: TableRowStateManager
                                    ) {

                                      Function getNodeStatusCount has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      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

                                        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)
                                        Severity: Minor
                                        Found in src/jetstream/plugins/monocular/artifacthub.go - About 1 hr to fix

                                        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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language