Dabolus/google-assistant-desktop-unofficial

View on GitHub

Showing 41 of 49 total issues

Function getBrowserWindowWithEvents has 164 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getBrowserWindowWithEvents = (
  options?: BrowserWindowConstructorOptions,
) => {
  const browserWindow = new BrowserWindow(options);

Severity: Major
Found in src/main/helpers/events.helper.ts - About 6 hrs to fix

    Function createMenu has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function createMenu(window: BrowserWindow) {
      const menu = Menu.buildFromTemplate([
        ...(environmentService.mac
          ? ([
              {
    Severity: Major
    Found in src/main/index.ts - About 3 hrs to fix

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

        protected _clientSecretModified(e: KeyboardEvent) {
          const {
            validity: { valid },
            value,
          } = e.target as HTMLInputElement;
      Severity: Major
      Found in src/renderer/components/wizard/wizard.component.ts and 1 other location - About 2 hrs to fix
      src/renderer/components/wizard/wizard.component.ts on lines 68..75

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 83.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        protected _clientIdModified(e: KeyboardEvent) {
          const {
            validity: { valid },
            value,
          } = e.target as HTMLInputElement;
      Severity: Major
      Found in src/renderer/components/wizard/wizard.component.ts and 1 other location - About 2 hrs to fix
      src/renderer/components/wizard/wizard.component.ts on lines 77..84

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 83.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      function* handleAudioSend({
        payload: { audio, conversationState },
      }: ChatActionSendAudioRequested) {
        try {
          yield call([chatService, 'sendAudio'], audio, { conversationState });
      Severity: Major
      Found in src/renderer/store/chat/chat.sagas.ts and 1 other location - About 2 hrs to fix
      src/renderer/store/chat/chat.sagas.ts on lines 15..23

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 78.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      function* handleMessageSend({
        payload: { text, conversationState },
      }: ChatActionSendMessageRequested) {
        try {
          yield call([chatService, 'sendMessage'], text, { conversationState });
      Severity: Major
      Found in src/renderer/store/chat/chat.sagas.ts and 1 other location - About 2 hrs to fix
      src/renderer/store/chat/chat.sagas.ts on lines 25..33

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 78.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      export enum Locale {
        EN_US = 'en-US',
        EN_AU = 'en-AU',
        EN_CA = 'en-CA',
        EN_GB = 'en-GB',
      Severity: Major
      Found in src/main/helpers/i18n.helper.ts and 1 other location - About 2 hrs to fix
      src/renderer/store/app/app.model.ts on lines 1..16

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 77.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      export enum Locale {
        EN_US = 'en-US',
        EN_AU = 'en-AU',
        EN_CA = 'en-CA',
        EN_GB = 'en-GB',
      Severity: Major
      Found in src/renderer/store/app/app.model.ts and 1 other location - About 2 hrs to fix
      src/main/helpers/i18n.helper.ts on lines 3..18

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 77.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function authReducer has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const authReducer: Reducer<AuthState, AuthAction> = (
        state: AuthState = initialState,
        action,
      ) => {
        switch (action.type) {
      Severity: Minor
      Found in src/renderer/store/auth/auth.reducer.ts - About 1 hr to fix

        Function chatReducer has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const chatReducer: Reducer<ChatState, ChatAction> = (
          state: ChatState = initialState,
          action,
        ) => {
          switch (action.type) {
        Severity: Minor
        Found in src/renderer/store/chat/chat.reducer.ts - About 1 hr to fix

          Function authenticateClient has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public authenticateClient(
              clientId: string,
              clientSecret: string,
            ): Promise<Tokens> {
              return new Promise((resolve, reject) => {
          Severity: Minor
          Found in src/main/services/auth.service.ts - About 1 hr to fix

            Function attachEventListeners has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const attachEventListeners = (store: Store) => {
              ipcRenderer
                .on('app.setTheme', (_: Event, theme: string) => {
                  store.dispatch(setTheme(theme));
                })
            Severity: Minor
            Found in src/renderer/helpers/events.helper.ts - About 1 hr to fix

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

                public removeEventListener<K extends keyof MediaRecorderEventMap>(
                  type: K,
                  listener: (this: MediaStream, ev: MediaRecorderEventMap[K]) => void,
                  options?: boolean | EventListenerOptions,
                ): void;
              Severity: Major
              Found in src/renderer/components/bottom-bar/bottom-bar.component.ts and 1 other location - About 1 hr to fix
              src/renderer/components/bottom-bar/bottom-bar.component.ts on lines 63..67

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 67.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                public addEventListener<K extends keyof MediaRecorderEventMap>(
                  type: K,
                  listener: (this: MediaStream, ev: MediaRecorderEventMap[K]) => void,
                  options?: boolean | AddEventListenerOptions,
                ): void;
              Severity: Major
              Found in src/renderer/components/bottom-bar/bottom-bar.component.ts and 1 other location - About 1 hr to fix
              src/renderer/components/bottom-bar/bottom-bar.component.ts on lines 74..78

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 67.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                public async getUserInfo(
                  clientId?: string,
                  clientSecret?: string,
                ): Promise<UserInfo> {
                  const id = clientId || this._storeService.getClientId();
              Severity: Minor
              Found in src/main/services/auth.service.ts - About 1 hr to fix

                Function createMainWindow has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function createMainWindow() {
                  const window = getBrowserWindowWithEvents({
                    center: true,
                    minWidth: 360,
                    minHeight: 540,
                Severity: Minor
                Found in src/main/index.ts - About 1 hr to fix

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

                  export enum ChatActionType {
                    UPDATE_INPUT = 'UPDATE_INPUT',
                  
                    SEND_MESSAGE_REQUESTED = 'SEND_MESSAGE_REQUESTED',
                    SEND_MESSAGE_RESOLVED = 'SEND_MESSAGE_RESOLVED',
                  Severity: Minor
                  Found in src/renderer/store/chat/chat.actions.ts and 1 other location - About 50 mins to fix
                  src/renderer/store/app/app.actions.ts on lines 5..17

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 51.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                  export enum AppActionType {
                    UPDATE_PAGE = 'UPDATE_PAGE',
                  
                    UPDATE_LOCALE_REQUESTED = 'UPDATE_LOCALE_REQUESTED',
                    UPDATE_LOCALE_RESOLVED = 'UPDATE_LOCALE_RESOLVED',
                  Severity: Minor
                  Found in src/renderer/store/app/app.actions.ts and 1 other location - About 50 mins to fix
                  src/renderer/store/chat/chat.actions.ts on lines 5..17

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 51.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                  export const rejectModalOpening = (
                    error: Error,
                  ): AppActionOpenModalRejected => ({
                    type: AppActionType.OPEN_MODAL_REJECTED,
                    error: true,
                  Severity: Major
                  Found in src/renderer/store/app/app.actions.ts and 5 other locations - About 35 mins to fix
                  src/renderer/store/app/app.actions.ts on lines 110..116
                  src/renderer/store/auth/auth.actions.ts on lines 119..125
                  src/renderer/store/auth/auth.actions.ts on lines 139..143
                  src/renderer/store/chat/chat.actions.ts on lines 109..115
                  src/renderer/store/chat/chat.actions.ts on lines 132..136

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 46.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                  export const rejectLocaleUpdate = (
                    error: Error,
                  ): AppActionUpdateLocaleRejected => ({
                    type: AppActionType.UPDATE_LOCALE_REJECTED,
                    error: true,
                  Severity: Major
                  Found in src/renderer/store/app/app.actions.ts and 5 other locations - About 35 mins to fix
                  src/renderer/store/app/app.actions.ts on lines 143..149
                  src/renderer/store/auth/auth.actions.ts on lines 119..125
                  src/renderer/store/auth/auth.actions.ts on lines 139..143
                  src/renderer/store/chat/chat.actions.ts on lines 109..115
                  src/renderer/store/chat/chat.actions.ts on lines 132..136

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 46.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language