conceptadev/rockets

View on GitHub

Showing 33 of 317 total issues

Function getRequestOptions has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Confirmed

  public getRequestOptions(
    target: ReflectionTargetOrHandler,
    handler: ReflectionTargetOrHandler,
  ): CrudOptions & { model: CrudModelOptionsInterface } {
    return {
Severity: Major
Found in packages/nestjs-crud/src/services/crud-reflection.service.ts - About 3 hrs to fix

    Function applyApiResponse has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Confirmed

    export function applyApiResponse(
      action: CrudActions,
      options: ApiResponseOptions = {},
    ): MethodDecorator {
      return (target: DecoratorTargetObject, ...rest) => {

      Function AuthGuard has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      export const AuthGuard = (
        strategyName: string,
        options: AuthGuardOptions = { canDisable: false },
      ) => {
        // TODO: Add logic to get this information dynamically
      Severity: Minor
      Found in packages/nestjs-authentication/src/guards/auth.guard.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 createUserRepository has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function createUserRepository(dataSource: DataSource) {
        /**
         * Fake user "database"
         */
        const users: UserEntity[] = [

        Function catch has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          catch(exception: ExceptionInterface, host: ArgumentsHost): void {
            const { httpAdapter } = this.httpAdapterHost;
            const ctx = host.switchToHttp();
        
            // error code is UNKNOWN unless it gets overridden
        Severity: Minor
        Found in packages/nestjs-exception/src/filters/exceptions.filter.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 CrudInitApiQuery has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Confirmed

          (...args: Parameters<ClassDecorator>) => {
            // get the args
            const [classTarget] = args;
        
            const reflectionService = new CrudReflectionService();

          Function forFeature has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            static forFeature(
              entityOptions: Record<string, TypeOrmExtEntityOptionInterface>,
            ): DynamicModule {
              const dataSources: Record<string, TypeOrmExtDataSourceToken> = {};
          
          
          Severity: Minor
          Found in packages/nestjs-typeorm-ext/src/typeorm-ext.module.ts - About 1 hr to fix

            Function createRoleRepositoriesProviders has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function createRoleRepositoriesProviders(
              options: RoleEntitiesOptionsInterface,
            ): Provider[] {
              const { entities } = options;
            
            
            Severity: Minor
            Found in packages/nestjs-role/src/role.module-definition.ts - About 1 hr to fix

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

                catch(exception: ExceptionInterface, host: ArgumentsHost): void {
                  const { httpAdapter } = this.httpAdapterHost;
                  const ctx = host.switchToHttp();
              
                  // error code is UNKNOWN unless it gets overridden
              Severity: Minor
              Found in packages/nestjs-exception/src/filters/exceptions.filter.ts - About 1 hr to fix

                Function createOneCustom has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  @CrudCreateOne()
                  @AccessControlCreateOne(InvitationResource.One)
                  @ApiOperation({
                    summary: 'Create one invitation.',
                  })
                Severity: Minor
                Found in packages/nestjs-invitation/src/controllers/invitation.controller.ts - About 1 hr to fix

                  Function checkAccessQueries has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    protected async checkAccessQueries(
                      context: ExecutionContext,
                      queriesPermitted: IQueryInfo[],
                    ): Promise<boolean> {
                      const targets = [context.getClass(), context.getHandler()];
                  Severity: Minor
                  Found in packages/nestjs-access-control/src/access-control.guard.ts - About 1 hr to fix

                    Function accept has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      async accept(
                        invitationDto: InvitationDto,
                        passcode: string,
                        payload?: LiteralObject,
                        queryOptions?: QueryOptionsInterface,

                      Function setJoin has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        protected setJoin(
                          cond: QueryJoin,
                          joinOptions: JoinOptions,
                          builder: SelectQueryBuilder<T>,
                        ): ReturnType<xTypeOrmCrudService<T>['setJoin']> {
                      Severity: Minor
                      Found in packages/nestjs-crud/src/services/typeorm-crud.service.ts - About 1 hr to fix

                        Function setJoin has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                          protected setJoin(
                            cond: QueryJoin,
                            joinOptions: JoinOptions,
                            builder: SelectQueryBuilder<T>,
                          ): ReturnType<xTypeOrmCrudService<T>['setJoin']> {
                        Severity: Minor
                        Found in packages/nestjs-crud/src/services/typeorm-crud.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 updatePassword has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          async updatePassword(
                            passcode: string,
                            newPassword: string,
                            queryOptions?: QueryOptionsInterface,
                          ): Promise<ReferenceIdInterface | null> {
                        Severity: Minor
                        Found in packages/nestjs-auth-recovery/src/services/auth-recovery.service.ts - About 1 hr to fix

                          Function CrudInitApiParams has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Confirmed

                            (...args: Parameters<ClassDecorator>) => {
                              // get the args
                              const [classTarget] = args;
                          
                              const reflectionService = new CrudReflectionService();

                            Function checkAccessGrants has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Confirmed

                              protected async checkAccessGrants(
                                context: ExecutionContext,
                              ): Promise<boolean> {
                                const rules = this.settings.rules;
                            
                            
                            Severity: Minor
                            Found in packages/nestjs-access-control/src/access-control.guard.ts - About 1 hr to fix

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

                                protected async checkAccessQueries(
                                  context: ExecutionContext,
                                  queriesPermitted: IQueryInfo[],
                                ): Promise<boolean> {
                                  const targets = [context.getClass(), context.getHandler()];
                              Severity: Minor
                              Found in packages/nestjs-access-control/src/access-control.guard.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 checkAccessGrants has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                protected async checkAccessGrants(
                                  context: ExecutionContext,
                                ): Promise<boolean> {
                                  const rules = this.settings.rules;
                              
                              
                              Severity: Minor
                              Found in packages/nestjs-access-control/src/access-control.guard.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 getOptions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Confirmed

                                protected getOptions(
                                  context: ExecutionContext,
                                ): CrudSerializationOptionsInterface {
                                  // get serialization options
                                  const options =
                              Severity: Minor
                              Found in packages/nestjs-crud/src/interceptors/crud-serialize.interceptor.ts - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language