Asymmetrik/ngx-starter

View on GitHub

Showing 14 of 31 total issues

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

    constructor(
        private loadPageFunc: LoadPageFunction<T>,
        public storageKey?: string,
        initialSort: SortChange = {} as SortChange,
        initialSearch = '',
Severity: Major
Found in src/app/common/table/asy-table-data-source.ts - About 2 hrs to fix

    Function provideExampleSiteFeature has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function provideExampleSiteFeature() {
        return makeEnvironmentProviders([
            {
                provide: ADMIN_TOPICS,
                multi: true,
    Severity: Major
    Found in src/app/site/example/provider.ts - About 2 hrs to fix

      Function _loadState has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          _loadState() {
              if (this.storageKey()) {
                  const columnsOrder: string[] = this.storage.getValue(
                      `${this.storageKey()}-columns-order`,
                      []
      Severity: Minor
      Found in src/app/common/table/column-chooser/column-chooser.component.ts - About 2 hrs 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

      Function format has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          static format(
              value: string | number | Date | DateTime | null | undefined,
              format?: string
          ): string {
              if (value) {
      Severity: Minor
      Found in src/app/common/pipes/utc-date-pipe/utc-date-utils.service.ts - About 2 hrs 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

      Function provideAdminFeature has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function provideAdminFeature() {
          return makeEnvironmentProviders([
              {
                  provide: APP_FEATURE_ADMIN,
                  useValue: true
      Severity: Major
      Found in src/app/core/admin/provider.ts - About 2 hrs to fix

        Function _buildFilter has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            _buildFilter() {
                let $lte = DateTime.invalid('not set');
                let $gte = DateTime.invalid('not set');
        
                if (this.enabled()) {

        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 exports has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function(config) {
            config.set({
                basePath: 'src',
                frameworks: ['jasmine', '@angular-devkit/build-angular'],
                plugins: [
        Severity: Minor
        Found in karma.conf.js - About 1 hr to fix

          Function _loadState has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _loadState() {
                  if (this.storageKey()) {
                      const columnsOrder: string[] = this.storage.getValue(
                          `${this.storageKey()}-columns-order`,
                          []
          Severity: Minor
          Found in src/app/common/table/column-chooser/column-chooser.component.ts - About 1 hr to fix

            Function authGuard has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function authGuard(configOrRoles?: string | string[] | Partial<AuthGuardConfig>) {
                return (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => {
                    // eslint-disable-next-line deprecation/deprecation
                    const router = inject(Router);
                    const sessionService = inject(SessionService);
            Severity: Minor
            Found in src/app/core/auth/auth.guard.ts - About 1 hr to fix

              Function provideTeamsFeature has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function provideTeamsFeature(additionalRoutes?: AdditionalTeamsRoutes) {
                  return makeEnvironmentProviders([
                      {
                          provide: APP_FEATURE_TEAM,
                          useValue: true
              Severity: Minor
              Found in src/app/core/teams/provider.ts - About 1 hr to fix

                Function handleError has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    handleError<ReturnType>(error: unknown, returnValue: ReturnType) {
                        if (error instanceof HttpErrorResponse) {
                            if (error.status === 400 && error.error.errors) {
                                const vError = error.error.errors.body?.[0] || error.error.errors.query?.[0];
                                if (vError) {
                Severity: Minor
                Found in src/app/common/abstract-entity.service.ts - 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

                Function transform has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    transform(date: Date | string | number | null | undefined, hideAgo?: boolean): string {
                        if (null != date) {
                            let agoDate;
                            // If it's not null, and it's either a number, string or a date
                            if (typeof date === 'number') {
                Severity: Minor
                Found in src/app/common/pipes/ago-date.pipe.ts - 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

                Function format has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    static format(
                        value: string | number | Date | DateTime | null | undefined,
                        format?: string
                    ): string {
                        if (value) {
                Severity: Minor
                Found in src/app/common/pipes/utc-date-pipe/utc-date-utils.service.ts - About 1 hr to fix

                  Function provideAppConfig has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function provideAppConfig() {
                      return makeEnvironmentProviders([
                          {
                              provide: APP_INITIALIZER,
                              useFactory: (configService: ConfigService) => {
                  Severity: Minor
                  Found in src/app/core/provider.ts - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language