BetterTyped/hyper-fetch

View on GitHub

Showing 248 of 345 total issues

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

  const additionalCallbacks = {
    onEvent: (callback: NonNullable<typeof onEventCallback.current>) => {
      onEventCallback.current = callback;
    },
  };
Severity: Minor
Found in packages/react/src/hooks/use-listener/use-listener.hooks.ts and 1 other location - About 30 mins to fix
packages/react/src/hooks/use-event-messages/use-event-messages.hooks.ts on lines 42..46

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 45.

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

Avoid too many return statements within this function.
Open

      return endBefore(value);
Severity: Major
Found in packages/adapter-firebase/src/realtime/utils/constraints.utils.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return limitToLast(value);
    Severity: Major
    Found in packages/adapter-firebase/src/realtime/utils/constraints.utils.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return startAfter(docOrFields);
      Severity: Major
      Found in packages/adapter-firebase/src/firestore/utils/constraints.utils.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return equalTo(value);
        Severity: Major
        Found in packages/adapter-firebase/src/realtime/utils/constraints.utils.ts - About 30 mins to fix

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

            setAuth = (auth: QueryParamsType | string) => {
              this.auth = auth;
              this.adapter.reconnect();
              return this;
            };
          Severity: Minor
          Found in packages/sockets/src/socket/socket.ts and 1 other location - About 30 mins to fix
          packages/sockets/src/socket/socket.ts on lines 134..138

          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 45.

          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

          Avoid too many return statements within this function.
          Open

                return ref.endAt(value);
          Severity: Major
          Found in packages/adapter-firebase-admin/src/realtime/utils/constraints.utils.ts - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                if (isEmpty(firstValue) && isEmpty(secondValue)) return true;
            Severity: Major
            Found in packages/react/src/utils/deep-equal.utils.ts - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return ref.equalTo(value);
              Severity: Major
              Found in packages/adapter-firebase-admin/src/realtime/utils/constraints.utils.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return endBefore(docOrFields);
                Severity: Major
                Found in packages/adapter-firebase/src/firestore/utils/constraints.utils.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return collectionRef.startAfter(docOrFields);
                  Severity: Major
                  Found in packages/adapter-firebase-admin/src/firestore/utils/constraints.utils.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return limitToFirst(value);
                    Severity: Major
                    Found in packages/adapter-firebase/src/realtime/utils/constraints.utils.ts - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return endAt(docOrFields);
                      Severity: Major
                      Found in packages/adapter-firebase/src/firestore/utils/constraints.utils.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return collectionRef.endAt(docOrFields);
                        Severity: Major
                        Found in packages/adapter-firebase-admin/src/firestore/utils/constraints.utils.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return ref.limitToFirst(value);
                          Severity: Major
                          Found in packages/adapter-firebase-admin/src/realtime/utils/constraints.utils.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return ref.limitToLast(value);
                            Severity: Major
                            Found in packages/adapter-firebase-admin/src/realtime/utils/constraints.utils.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return this.logger.debug("Awaiting for network restoration", { response, requestDetails, request });
                              Severity: Major
                              Found in packages/core/src/dispatcher/dispatcher.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return this.logger.debug("Successful response, removing request from queue.", {
                                        response,
                                        requestDetails,
                                        request,
                                      });
                                Severity: Major
                                Found in packages/core/src/dispatcher/dispatcher.ts - About 30 mins to fix

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

                                    const additionalCallbacks = {
                                      onEvent: (callback: NonNullable<typeof onEventCallback.current>) => {
                                        onEventCallback.current = callback;
                                      },
                                    };
                                  packages/react/src/hooks/use-listener/use-listener.hooks.ts on lines 54..58

                                  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 45.

                                  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

                                    setQuery = (queryParams: QueryParamsType | string) => {
                                      this.queryParams = queryParams;
                                      this.adapter.reconnect();
                                      return this;
                                    };
                                  Severity: Minor
                                  Found in packages/sockets/src/socket/socket.ts and 1 other location - About 30 mins to fix
                                  packages/sockets/src/socket/socket.ts on lines 125..129

                                  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 45.

                                  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