hyper-tuner/hyper-tuner-cloud

View on GitHub
src/pages/Upload.tsx

Summary

Maintainability
F
2 wks
Test Coverage

Function UploadPage has 812 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UploadPage = () => {
  const [form] = useForm<TunesRecord>();
  const routeMatch = useMatch(Routes.UPLOAD_WITH_TUNE_ID);

  const [isLoading, setIsLoading] = useState(false);
Severity: Major
Found in src/pages/Upload.tsx - About 4 days to fix

    File Upload.tsx has 911 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
      CheckOutlined,
      CopyOutlined,
      EditOutlined,
      EyeOutlined,
    Severity: Major
    Found in src/pages/Upload.tsx - About 2 days to fix

      Function UploadPage has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
      Open

      const UploadPage = () => {
        const [form] = useForm<TunesRecord>();
        const routeMatch = useMatch(Routes.UPLOAD_WITH_TUNE_ID);
      
        const [isLoading, setIsLoading] = useState(false);
      Severity: Minor
      Found in src/pages/Upload.tsx - About 1 day 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 publishTune has 110 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const publishTune = async (values: TunesRecord) => {
          setIsLoading(true);
      
          const vehicleName = values.vehicleName.trim();
          const engineMake = values.engineMake.trim();
      Severity: Major
      Found in src/pages/Upload.tsx - About 4 hrs to fix

        Function loadExistingTune has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async (currentTuneId: string) => {
              setNewTuneId(currentTuneId);
              const oldTune = await getTune(currentTuneId);
        
              if (oldTune) {
        Severity: Major
        Found in src/pages/Upload.tsx - About 2 hrs to fix

          Function uploadTune has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

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

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

              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

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

                            <Select placeholder="Aspiration" style={{ width: '100%' }}>
                              <Select.Option value={TunesAspirationOptions.na}>Naturally aspirated</Select.Option>
                              <Select.Option value={TunesAspirationOptions.turbocharged}>
                                Turbocharged
                              </Select.Option>
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 3 hrs to fix
                src/pages/Info.tsx on lines 117..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 98.

                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 name="engineCode" rules={requiredTextRules}>
                            <AutoComplete
                              options={autocompleteOptions.engineCode}
                              onSearch={(search) => searchAutocomplete('engineCode', search)}
                Severity: Major
                Found in src/pages/Upload.tsx and 2 other locations - About 3 hrs to fix
                src/pages/Upload.tsx on lines 699..709
                src/pages/Upload.tsx on lines 731..741

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

                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 name="engineMake" rules={requiredTextRules}>
                            <AutoComplete
                              options={autocompleteOptions.engineMake}
                              onSearch={(search) => searchAutocomplete('engineMake', search)}
                Severity: Major
                Found in src/pages/Upload.tsx and 2 other locations - About 3 hrs to fix
                src/pages/Upload.tsx on lines 699..709
                src/pages/Upload.tsx on lines 742..752

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

                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 name="vehicleName" rules={requiredTextRules}>
                            <AutoComplete
                              options={autocompleteOptions.vehicleName}
                              onSearch={(search) => searchAutocomplete('vehicleName', search)}
                Severity: Major
                Found in src/pages/Upload.tsx and 2 other locations - About 3 hrs to fix
                src/pages/Upload.tsx on lines 731..741
                src/pages/Upload.tsx on lines 742..752

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

                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

                      <Row style={{ marginTop: 10 }}>
                        <Item style={{ width: '100%' }}>
                          <Button type="primary" block onClick={goToNewTune} icon={<SendOutlined />}>
                            Open
                          </Button>
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 2 hrs to fix
                src/pages/Info.tsx on lines 41..47

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

                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 name="fuel">
                            <AutoComplete
                              options={autocompleteOptions.fuel}
                              onSearch={(search) => searchAutocomplete('fuel', search)}
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 2 hrs to fix
                src/pages/Upload.tsx on lines 805..815

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

                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 name="ignition">
                            <AutoComplete
                              options={autocompleteOptions.ignition}
                              onSearch={(search) => searchAutocomplete('ignition', search)}
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 2 hrs to fix
                src/pages/Upload.tsx on lines 794..804

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

                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

                        oldTune.logFiles.forEach(async (fileName: string) => {
                          tempLogFiles.push(await fetchFile(oldTune.id, fileName));
                          setDefaultLogFilesList((prev) => [
                            ...prev,
                            {
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 2 hrs to fix
                src/pages/Upload.tsx on lines 545..555

                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

                        oldTune.toothLogFiles.forEach(async (fileName: string) => {
                          tempToothLogFiles.push(await fetchFile(oldTune.id, fileName));
                          setDefaultToothLogFilesList((prev) => [
                            ...prev,
                            {
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 2 hrs to fix
                src/pages/Upload.tsx on lines 531..541

                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

                        <Upload
                          key={defaultTuneFileList[0]?.uid || 'tuneFile'}
                          listType="picture-card"
                          customRequest={uploadTune}
                          onRemove={removeTuneFile}
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 2 hrs to fix
                src/pages/Upload.tsx on lines 931..943

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

                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

                      <Upload
                        key={defaultCustomIniFileList[0]?.uid || 'customIni'}
                        listType="picture-card"
                        customRequest={uploadCustomIni}
                        onRemove={removeCustomIniFile}
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 2 hrs to fix
                src/pages/Upload.tsx on lines 987..999

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

                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 name="hp">
                            <InputNumber addonBefore="HP" style={{ width: '100%' }} min={0} max={100_000} />
                          </Item>
                        </Col>
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 1 hr to fix
                src/pages/Upload.tsx on lines 835..839

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

                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 name="stockHp">
                            <InputNumber addonBefore="Stock HP" style={{ width: '100%' }} min={0} max={100_000} />
                          </Item>
                        </Col>
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 1 hr to fix
                src/pages/Upload.tsx on lines 830..834

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

                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 (oldTune.tuneFile) {
                          setTuneFile(await fetchFile(oldTune.id, oldTune.tuneFile));
                          setDefaultTuneFileList([
                            {
                              uid: oldTune.tuneFile,
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 1 hr to fix
                src/pages/Upload.tsx on lines 519..528

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

                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 (oldTune.customIniFile) {
                          setCustomIniFile(await fetchFile(oldTune.id, oldTune.customIniFile));
                          setDefaultCustomIniFileList([
                            {
                              uid: oldTune.customIniFile,
                Severity: Major
                Found in src/pages/Upload.tsx and 1 other location - About 1 hr to fix
                src/pages/Upload.tsx on lines 508..517

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

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

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

                  const removeToothLogFile = (file: UploadFile) => {
                    setToothLogFiles((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 479..481

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

                            <Select.Option value={TunesVisibilityOptions.unlisted}>
                              <Space>
                                <EyeOutlined />
                                Unlisted
                              </Space>
                Severity: Minor
                Found in src/pages/Upload.tsx and 1 other location - About 50 mins to fix
                src/pages/Upload.tsx on lines 625..630

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

                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

                            <Select.Option value={TunesVisibilityOptions.public}>
                              <Space>
                                <GlobalOutlined />
                                Public
                              </Space>
                Severity: Minor
                Found in src/pages/Upload.tsx and 1 other location - About 50 mins to fix
                src/pages/Upload.tsx on lines 631..636

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

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

                      <Divider>
                        <Space>
                          Upload Custom INI
                          <Typography.Text type="secondary">(.ini)</Typography.Text>
                        </Space>
                Severity: Major
                Found in src/pages/Upload.tsx and 3 other locations - About 50 mins to fix
                src/pages/Upload.tsx on lines 884..889
                src/pages/Upload.tsx on lines 905..910
                src/pages/Upload.tsx on lines 981..986

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

                      <Divider>
                        <Space>
                          Upload Logs
                          <Typography.Text type="secondary">(.mlg, .csv, .msl)</Typography.Text>
                        </Space>
                Severity: Major
                Found in src/pages/Upload.tsx and 3 other locations - About 50 mins to fix
                src/pages/Upload.tsx on lines 905..910
                src/pages/Upload.tsx on lines 925..930
                src/pages/Upload.tsx on lines 981..986

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

                      <Divider>
                        <Space>
                          Upload Tooth and Composite logs
                          <Typography.Text type="secondary">(.csv)</Typography.Text>
                        </Space>
                Severity: Major
                Found in src/pages/Upload.tsx and 3 other locations - About 50 mins to fix
                src/pages/Upload.tsx on lines 884..889
                src/pages/Upload.tsx on lines 925..930
                src/pages/Upload.tsx on lines 981..986

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

                        <Divider>
                          <Space>
                            Upload Tune
                            <Typography.Text type="secondary">(.msq)</Typography.Text>
                          </Space>
                Severity: Major
                Found in src/pages/Upload.tsx and 3 other locations - About 50 mins to fix
                src/pages/Upload.tsx on lines 884..889
                src/pages/Upload.tsx on lines 905..910
                src/pages/Upload.tsx on lines 925..930

                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

                There are no issues that match your filters.

                Category
                Status