SUSE/stratos

View on GitHub
src/frontend/packages/core/src/shared/components/list/list.component.ts

Summary

Maintainability
F
3 days
Test Coverage

File list.component.ts has 655 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { animate, style, transition, trigger } from '@angular/animations';
import {
  AfterViewInit,
  ChangeDetectorRef,
  Component,

    Function initialise has 259 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      private initialise() {
        this.globalActions = this.setupActionsDefaultObservables(
          this.config.getGlobalActions()
        );
        this.multiActions = this.setupActionsDefaultObservables(

      Function initialise has a Cognitive Complexity of 38 (exceeds 8 allowed). Consider refactoring.
      Open

        private initialise() {
          this.globalActions = this.setupActionsDefaultObservables(
            this.config.getGlobalActions()
          );
          this.multiActions = this.setupActionsDefaultObservables(

      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

      ListComponent has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      @Component({
        selector: 'app-list',
        templateUrl: './list.component.html',
        styleUrls: ['./list.component.scss'],
        animations: [

        Function filterStoreToWidget has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              tap((paginationFilter: ListFilter) => {
                this.filterString = paginationFilter.string;
        
                const filterKey = paginationFilter.filterKey;
                if (filterKey) {

          Avoid too many return statements within this function.
          Open

                    return 'none';
          Severity: Major
          Found in src/frontend/packages/core/src/shared/components/list/list.component.ts - About 30 mins to fix

            TODO found
            Open

              // TODO: This needs tidying up - NJ

            There are no issues that match your filters.

            Category
            Status