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

        <Item>
          <Button
            type="primary"
            htmlType="submit"
            style={{ width: '100%' }}
Severity: Major
Found in src/pages/auth/ResetPasswordConfirmation.tsx and 1 other location - About 1 hr to fix
src/pages/auth/Profile.tsx on lines 157..167

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

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

    const compressedToothLogFiles = await Promise.all(
      toothLogFiles.map(async (file) =>
        bufferToFile(
          await compress(file),
          (file as UploadedFile).uid ? file.name : removeFilenameSuffix(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 204..211

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

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

  const submitSignUp = (
    <Button
      type="primary"
      htmlType="submit"
      style={{ width: '100%' }}
Severity: Major
Found in src/pages/auth/Login.tsx and 1 other location - About 1 hr to fix
src/pages/auth/Login.tsx on lines 234..245

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

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

            <Item>
              <Button
                type="primary"
                htmlType="submit"
                style={{ width: '100%' }}
Severity: Major
Found in src/pages/auth/Profile.tsx and 1 other location - About 1 hr to fix
src/pages/auth/ResetPasswordConfirmation.tsx on lines 51..61

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

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

    const compressedLogFiles = await Promise.all(
      logFiles.map(async (file) =>
        bufferToFile(
          await compress(file),
          (file as UploadedFile).uid ? file.name : removeFilenameSuffix(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 213..220

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

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

  public parse(onProgress: (percent: number) => void): this {
    let unitsIndex = 999;
    const lines = this.raw.trim().split('\n');

    for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
Severity: Minor
Found in src/utils/logs/MslLogParser.ts - About 1 hr to fix

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

    const ResetPassword = () => {
      const [form] = Form.useForm();
      const [isLoading, setIsLoading] = useState(false);
      const { initResetPassword } = useAuth();
      const navigate = useNavigate();
    Severity: Minor
    Found in src/pages/auth/ResetPassword.tsx - About 1 hr to fix

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

            if (parts.length === 6) {
              // PriLevel,SecLevel,Trigger,Sync,ToothTime,Time
              this.resultComposite.push({
                ...base,
                maxTime: 0,
      Severity: Major
      Found in src/utils/logs/TriggerLogsParser.ts and 1 other location - About 1 hr to fix
      src/utils/logs/TriggerLogsParser.ts on lines 225..233

      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

            if (parts.length === 7) {
              // PriLevel,SecLevel,Trigger,Sync,RefTime,ToothTime,Time
              this.resultComposite.push({
                ...base,
                maxTime: 0,
      Severity: Major
      Found in src/utils/logs/TriggerLogsParser.ts and 1 other location - About 1 hr to fix
      src/utils/logs/TriggerLogsParser.ts on lines 235..243

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

          (
            rootMenuName: string,
            subMenus: Record<string, SubMenuType | GroupMenuType | GroupChildMenuType>,
            groupMenuName: string | null = null,
          ): ItemType[] => {
      Severity: Minor
      Found in src/components/Tune/SideBar.tsx - About 1 hr to fix

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

                  <Col {...colProps}>
                    <Item>
                      <Input value={tuneData.hp} addonBefore="HP" style={{ width: '100%' }} />
                    </Item>
                  </Col>
        Severity: Major
        Found in src/pages/Info.tsx and 2 other locations - About 1 hr to fix
        src/pages/Info.tsx on lines 104..112
        src/pages/Info.tsx on lines 173..177

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

        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

                  <Col {...colProps}>
                    <Item>
                      <Input value={tuneData.stockHp} addonBefore="Stock HP" style={{ width: '100%' }} />
                    </Item>
                  </Col>
        Severity: Major
        Found in src/pages/Info.tsx and 2 other locations - About 1 hr to fix
        src/pages/Info.tsx on lines 104..112
        src/pages/Info.tsx on lines 168..172

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

        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

                  <Col {...colProps}>
                    <Item>
                      <Input
                        value={tuneData.cylindersCount}
                        addonBefore="Cylinders"
        Severity: Major
        Found in src/pages/Info.tsx and 2 other locations - About 1 hr to fix
        src/pages/Info.tsx on lines 168..172
        src/pages/Info.tsx on lines 173..177

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

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

        function keyboardZoomPlugin(options: ZoomPluginOptions = {}): uPlotPlugin {
          const { zoomFactor = 0.9, panFactor = 0.3 } = options;
        
          return {
            hooks: {
        Severity: Minor
        Found in src/utils/uPlot/keyboardZoomPlugin.ts - About 1 hr to fix

          Function loadTune has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const loadTune = async (data: TunesResponse | null) => {
              if (data === null) {
                store.dispatch({ type: 'config/load', payload: null });
                store.dispatch({ type: 'tune/load', payload: null });
          
          
          Severity: Minor
          Found in src/App.tsx - About 1 hr to fix

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

                      <Radio.Button value={buildTuneUrl(Routes.TUNE_ROOT)}>
                        <Space>
                          <InfoCircleOutlined />
                          {lg && 'Info'}
                        </Space>
            Severity: Major
            Found in src/components/TopBar.tsx and 2 other locations - About 1 hr to fix
            src/components/TopBar.tsx on lines 188..193
            src/components/TopBar.tsx on lines 200..205

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

            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

                      <Radio.Button value={buildTuneUrl(Routes.TUNE_TUNE)}>
                        <Space>
                          <ToolOutlined />
                          {lg && 'Tune'}
                        </Space>
            Severity: Major
            Found in src/components/TopBar.tsx and 2 other locations - About 1 hr to fix
            src/components/TopBar.tsx on lines 188..193
            src/components/TopBar.tsx on lines 194..199

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

            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

                      <Radio.Button value={buildTuneUrl(Routes.HUB)}>
                        <Space>
                          <CarOutlined />
                          {lg && 'Hub'}
                        </Space>
            Severity: Major
            Found in src/components/TopBar.tsx and 2 other locations - About 1 hr to fix
            src/components/TopBar.tsx on lines 194..199
            src/components/TopBar.tsx on lines 200..205

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

            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

                      <tr>
                        <td {...titleProps} className="title-curve" key={yLabel}>{`${yLabel} (${yUnits})`}</td>
                        {renderRow('y', yData)}
                      </tr>
            Severity: Major
            Found in src/components/Tune/Dialog/Curve/Table.tsx and 1 other location - About 1 hr to fix
            src/components/Tune/Dialog/Curve/Table.tsx on lines 49..52

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

            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

                      <tr>
                        <td {...titleProps} className="title-curve" key={xLabel}>{`${xLabel} (${xUnits})`}</td>
                        {renderRow('x', xData)}
                      </tr>
            Severity: Major
            Found in src/components/Tune/Dialog/Curve/Table.tsx and 1 other location - About 1 hr to fix
            src/components/Tune/Dialog/Curve/Table.tsx on lines 45..48

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

            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