short-d/short

View on GitHub
frontend/src/service/shortGraphQL/ShortLinkGraphQL.api.ts

Summary

Maintainability
A
1 hr
Test Coverage

Showing 2 of 6 total issues

Function createShortLink has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

async createShortLink(
shortLink: ShortLink,
isPublic: boolean
): Promise<ShortLink> {
const gqlCreateShortLink = `
Severity: Major
Found in frontend/src/service/shortGraphQL/ShortLinkGraphQL.api.ts - About 2 hrs to fix

    Function updateShortLink has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Wontfix

    async updateShortLink(oldAlias: string, shortLink: Partial<ShortLink>) {
    let captchaResponse;
    try {
    captchaResponse = await this.captchaService.execute(UPDATE_SHORT_LINK);
    } catch (err) {
    Severity: Minor
    Found in frontend/src/service/shortGraphQL/ShortLinkGraphQL.api.ts - About 1 hr to fix

      Function getUserShortLinks has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Wontfix

      getUserShortLinks(offset: number, pageSize: number): Promise<ShortLink[]> {
      const getUserShortLinksQuery = `
      query params($authToken: String!) {
      authQuery(authToken: $authToken) {
      shortLinks {
      Severity: Minor
      Found in frontend/src/service/shortGraphQL/ShortLinkGraphQL.api.ts - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Wontfix

        constructor(
        private authService: AuthService,
        private envService: EnvService,
        private graphQLService: GraphQLService,
        private captchaService: CaptchaService
        Severity: Major
        Found in frontend/src/service/shortGraphQL/ShortLinkGraphQL.api.ts and 1 other location - About 2 hrs to fix
        frontend/src/service/shortGraphQL/ChangeLogGraphQL.api.ts on lines 26..33

        Similar blocks of code found in 5 locations. Consider refactoring.
        Open

        try {
        captchaResponse = await this.captchaService.execute(CREATE_SHORT_LINK);
        } catch (err) {
        return Promise.reject(err);
        }
        Severity: Major
        Found in frontend/src/service/shortGraphQL/ShortLinkGraphQL.api.ts and 4 other locations - About 30 mins to fix
        frontend/src/service/shortGraphQL/ChangeLogGraphQL.api.ts on lines 110..114
        frontend/src/service/shortGraphQL/ChangeLogGraphQL.api.ts on lines 154..158
        frontend/src/service/shortGraphQL/ChangeLogGraphQL.api.ts on lines 196..200
        frontend/src/service/shortGraphQL/ShortLinkGraphQL.api.ts on lines 133..137

        Similar blocks of code found in 5 locations. Consider refactoring.
        Open

        try {
        captchaResponse = await this.captchaService.execute(UPDATE_SHORT_LINK);
        } catch (err) {
        return Promise.reject(err);
        }
        Severity: Major
        Found in frontend/src/service/shortGraphQL/ShortLinkGraphQL.api.ts and 4 other locations - About 30 mins to fix
        frontend/src/service/shortGraphQL/ChangeLogGraphQL.api.ts on lines 110..114
        frontend/src/service/shortGraphQL/ChangeLogGraphQL.api.ts on lines 154..158
        frontend/src/service/shortGraphQL/ChangeLogGraphQL.api.ts on lines 196..200
        frontend/src/service/shortGraphQL/ShortLinkGraphQL.api.ts on lines 81..85

        There are no issues that match your filters.

        Category
        Status