Dabolus/google-assistant-desktop-unofficial

View on GitHub

Showing 10 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

      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

              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

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

                  export default function template(this: Wizard) {
                    return html`
                      <div class="backdrop"></div>
                      <div class="modal">
                        <div class="content">
                  Severity: Minor
                  Found in src/renderer/components/wizard/wizard.template.ts - About 25 mins 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 connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const connect = <S>(store: Store<S>) => <
                    T extends Constructor<CustomElement>
                  >(
                    baseElement: T,
                  ) =>
                  Severity: Minor
                  Found in src/renderer/components/helpers.ts - About 25 mins 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

                  Severity
                  Category
                  Status
                  Source
                  Language