bcgov/vue3-scaffold

View on GitHub

Showing 34 of 34 total issues

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

const warn = (title: string, msg: string = '', options: ToastMessageOptions = {}) => {
const { severity = 'warn', summary = `Warning: ${title}`, detail = msg, life = ToastTimeout.WARNING } = options;
toast.add({ severity: severity, summary: summary, detail: detail, life: life });
};
Severity: Major
Found in frontend/src/lib/primevue/useToast.ts and 3 other locations - About 4 hrs to fix
frontend/src/lib/primevue/useToast.ts on lines 8..11
frontend/src/lib/primevue/useToast.ts on lines 13..16
frontend/src/lib/primevue/useToast.ts on lines 18..21

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

const info = (title: string, msg: string = '', options: ToastMessageOptions = {}) => {
const { severity = 'info', summary = `Info: ${title}`, detail = msg, life = ToastTimeout.INFO } = options;
toast.add({ severity: severity, summary: summary, detail: detail, life: life });
};
Severity: Major
Found in frontend/src/lib/primevue/useToast.ts and 3 other locations - About 4 hrs to fix
frontend/src/lib/primevue/useToast.ts on lines 8..11
frontend/src/lib/primevue/useToast.ts on lines 18..21
frontend/src/lib/primevue/useToast.ts on lines 23..26

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

const success = (title: string, msg: string = '', options: ToastMessageOptions = {}) => {
const { severity = 'success', summary = `Success: ${title}`, detail = msg, life = ToastTimeout.SUCCESS } = options;
toast.add({ severity: severity, summary: summary, detail: detail, life: life });
};
Severity: Major
Found in frontend/src/lib/primevue/useToast.ts and 3 other locations - About 4 hrs to fix
frontend/src/lib/primevue/useToast.ts on lines 8..11
frontend/src/lib/primevue/useToast.ts on lines 13..16
frontend/src/lib/primevue/useToast.ts on lines 23..26

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

const error = (title: string, msg: string = '', options: ToastMessageOptions = {}) => {
const { severity = 'error', summary = `Error: ${title}`, detail = msg, life = ToastTimeout.ERROR } = options;
toast.add({ severity: severity, summary: summary, detail: detail, life: life });
};
Severity: Major
Found in frontend/src/lib/primevue/useToast.ts and 3 other locations - About 4 hrs to fix
frontend/src/lib/primevue/useToast.ts on lines 13..16
frontend/src/lib/primevue/useToast.ts on lines 18..21
frontend/src/lib/primevue/useToast.ts on lines 23..26

Function currentUser has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

export const currentUser = async (req: Request, res: Response, next: NextFunction) => {
const authorization = req.get('Authorization');
const currentUser: CurrentUser = {
authType: AuthType.NONE,
tokenPayload: null
Severity: Minor
Found in app/src/middleware/authentication.ts - About 3 hrs to fix

Function useAuthStore has 77 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useAuthStore = defineStore('auth', () => {
const configService = new ConfigService();
const authService = new AuthService();
const userManager = authService.getUserManager();
 
 
Severity: Major
Found in frontend/src/store/authStore.ts - About 3 hrs to fix

    Function useAppStore has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const useAppStore = defineStore('app', () => {
    // State
    const state: AppStoreState = {
    loadingCalls: ref(0),
    loadingInterval: ref(undefined),
    Severity: Minor
    Found in frontend/src/store/appStore.ts - About 1 hr to fix

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

      export const currentUser = async (req: Request, res: Response, next: NextFunction) => {
      const authorization = req.get('Authorization');
      const currentUser: CurrentUser = {
      authType: AuthType.NONE,
      tokenPayload: null
      Severity: Minor
      Found in app/src/middleware/authentication.ts - About 1 hr to fix

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

        export default function getRouter() {
        const appStore = useAppStore();
        const authService = new AuthService();
        const router = createRouter({
        history: createWebHistory(),
        Severity: Minor
        Found in frontend/src/router/index.ts - About 1 hr to fix

          Function getGitRevision has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          export function getGitRevision(): string {
          try {
          const gitDir = (() => {
          let dir = '.git',
          i = 0;
          Severity: Minor
          Found in app/src/components/utils.ts - About 25 mins to fix

          Require statement not part of import statement.
          Open

          const baseConfig = require('./.eslintrc.js');
          Severity: Minor
          Found in frontend/volar.config.js by eslint

          Headers should be surrounded by blank lines
          Open

          #### Screenshots

          Headers should be surrounded by blank lines
          Open

          #### Additional context

          Require statement not part of import statement.
          Open

          require('volar-service-eslint').default(program => ({
          Severity: Minor
          Found in frontend/volar.config.js by eslint

          Headers should be surrounded by blank lines
          Open

          #### Additional context

          Headers should be surrounded by blank lines
          Open

          #### Describe the bug

          Headers should be surrounded by blank lines
          Open

          #### Version Number

          Headers should be surrounded by blank lines
          Open

          #### Version Number

          Trailing punctuation in header
          Open

          #### Is your feature request related to a problem? Please describe.

          Headers should be surrounded by blank lines
          Open

          #### Expected behavior
          Severity
          Category
          Status
          Source
          Language