hyper-tuner/hyper-tuner-cloud

View on GitHub

Showing 212 of 214 total issues

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

  const removeLogFile = (file: UploadFile) => {
    setLogFiles((prev) => prev.filter((f) => removeFilenameSuffix(f.name) !== file.name));
  };
Severity: Major
Found in src/pages/Upload.tsx and 1 other location - About 1 hr to fix
src/pages/Upload.tsx on lines 483..485

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

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 3 locations. Consider refactoring.
Open

            <Item name="username" rules={usernameRules} hasFeedback>
              <Input prefix={<UserOutlined />} placeholder="Username" autoComplete="name" />
            </Item>
Severity: Major
Found in src/pages/auth/Profile.tsx and 2 other locations - About 1 hr to fix
src/pages/auth/Login.tsx on lines 278..280
src/pages/auth/ResetPassword.tsx on lines 41..43

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

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 3 locations. Consider refactoring.
Open

        <Item name="email" rules={emailRules} hasFeedback>
          <Input prefix={<MailOutlined />} placeholder="Email" autoComplete="email" />
        </Item>
Severity: Major
Found in src/pages/auth/ResetPassword.tsx and 2 other locations - About 1 hr to fix
src/pages/auth/Login.tsx on lines 278..280
src/pages/auth/Profile.tsx on lines 151..153

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

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 3 locations. Consider refactoring.
Open

          <Item name="username" rules={usernameRules} hasFeedback>
            <Input prefix={<UserOutlined />} placeholder="Username" autoComplete="name" />
          </Item>
Severity: Major
Found in src/pages/auth/Login.tsx and 2 other locations - About 1 hr to fix
src/pages/auth/Profile.tsx on lines 151..153
src/pages/auth/ResetPassword.tsx on lines 41..43

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

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 uploadCustomIni has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const uploadCustomIni = (options: UploadRequestOption) => {
    upload(
      options,
      (file) => {
        setCustomIniFile(file);
Severity: Minor
Found in src/pages/Upload.tsx - About 1 hr to fix

    Function rootReducer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const rootReducer = createReducer(initialState, (builder) => {
      builder
        .addCase(loadConfig, (state: AppState, action) => {
          state.config = action.payload;
        })
    Severity: Minor
    Found in src/store.ts - About 1 hr to fix

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

          try {
            const record = await tunesCollection.create<TunesResponse>(data);
      
            return Promise.resolve(record);
          } catch (error) {
      Severity: Major
      Found in src/hooks/useDb.ts and 1 other location - About 1 hr to fix
      src/hooks/useDb.ts on lines 43..51

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

      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

          try {
            await tunesCollection.update(id, data);
            return Promise.resolve();
          } catch (error) {
            Sentry.captureException(error);
      Severity: Major
      Found in src/hooks/useDb.ts and 1 other location - About 1 hr to fix
      src/hooks/useDb.ts on lines 55..64

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

      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

                <Col {...colProps}>
                  <Item>
                    <Input value={tuneData.displacement} addonBefore="Displacement" addonAfter="l" />
                  </Item>
                </Col>
      Severity: Major
      Found in src/pages/Info.tsx and 1 other location - About 1 hr to fix
      src/pages/Info.tsx on lines 156..160

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

      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

                <Col {...colProps}>
                  <Item>
                    <Input value={tuneData.injectorsSize} addonBefore="Injectors size" addonAfter="cc" />
                  </Item>
                </Col>
      Severity: Major
      Found in src/pages/Info.tsx and 1 other location - About 1 hr to fix
      src/pages/Info.tsx on lines 99..103

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

      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 Diagnose has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      const Diagnose = ({
        ui,
        loadedToothLogs,
        tuneData,
      }: {
      Severity: Minor
      Found in src/pages/Diagnose.tsx - About 1 hr 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 fetchWithProgress has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      export const fetchWithProgress = async (
        url: string,
        onProgress?: OnProgress,
        signal?: AbortSignal,
      ): Promise<ArrayBuffer> => {
      Severity: Minor
      Found in src/utils/http.ts - About 1 hr 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 StarButton has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      const StarButton = ({ tuneData }: { tuneData: TuneDataState }) => {
        const navigate = useNavigate();
        const { currentUserToken } = useAuth();
        const { toggleStar, isStarredByMe } = useDb();
        const [currentStars, setCurrentStars] = useState(tuneData.stars);
      Severity: Minor
      Found in src/components/StarButton.tsx - About 1 hr 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 searchTunes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const searchTunes = async (
          search: string,
          page: number,
          perPage: number,
        ): Promise<TunesResponseList> => {
      Severity: Minor
      Found in src/hooks/useDb.ts - About 1 hr to fix

        Function resolveDialogs has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const resolveDialogs = (source: DialogsType, dialogName: string) => {
            // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
            if (!source[dialogName]) {
              return;
            }
        Severity: Minor
        Found in src/components/Tune/Dialog.tsx - About 1 hr to fix

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

              facebook: {
                label: 'Facebook',
                icon: <FacebookOutlined />,
                onClick: () => {
                  setIsOAuthLoading(true);
          Severity: Major
          Found in src/pages/auth/Login.tsx and 2 other locations - About 1 hr to fix
          src/pages/auth/Login.tsx on lines 109..116
          src/pages/auth/Login.tsx on lines 117..124

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

          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 3 locations. Consider refactoring.
          Open

              github: {
                label: 'GitHub',
                icon: <GithubOutlined />,
                onClick: () => {
                  setIsOAuthLoading(true);
          Severity: Major
          Found in src/pages/auth/Login.tsx and 2 other locations - About 1 hr to fix
          src/pages/auth/Login.tsx on lines 109..116
          src/pages/auth/Login.tsx on lines 125..132

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

          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

            new MslLogParser(raw)
              .parse((progress) => {
                ctx.postMessage({
                  type: 'progress',
                  progress,
          Severity: Major
          Found in src/workers/logParserWorker.ts and 1 other location - About 1 hr to fix
          src/workers/logParserWorker.ts on lines 33..39

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

          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

            new Parser(raw).parse((progress) => {
              ctx.postMessage({
                type: 'progress',
                progress,
                elapsed: elapsed(t0),
          Severity: Major
          Found in src/workers/logParserWorker.ts and 1 other location - About 1 hr to fix
          src/workers/logParserWorker.ts on lines 22..29

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

          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 3 locations. Consider refactoring.
          Open

              google: {
                label: 'Google',
                icon: <GoogleOutlined />,
                onClick: () => {
                  setIsOAuthLoading(true);
          Severity: Major
          Found in src/pages/auth/Login.tsx and 2 other locations - About 1 hr to fix
          src/pages/auth/Login.tsx on lines 117..124
          src/pages/auth/Login.tsx on lines 125..132

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

          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