hyper-tuner/hyper-tuner-cloud

View on GitHub

Showing 212 of 214 total issues

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

      const userAuthMenuItems = useMemo(() => {
        return currentUser
          ? [
              {
                key: 'profile',
    Severity: Minor
    Found in src/components/TopBar.tsx - About 1 hr to fix

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

              <Link to={generatePath(Routes.USER_ROOT, { userId: record.author })}>
                <AuthorName author={record.expand!.author} />
              </Link>
      Severity: Major
      Found in src/pages/Hub.tsx and 1 other location - About 1 hr to fix
      src/pages/Hub.tsx on lines 106..108

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

      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

                    <Link to={generatePath(Routes.USER_ROOT, { userId: tune.author })}>
                      <AuthorName author={tune.expand!.author} />
                    </Link>
      Severity: Major
      Found in src/pages/Hub.tsx and 1 other location - About 1 hr to fix
      src/pages/Hub.tsx on lines 169..171

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

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

            render: (tuneId: string, record: TunesResponse) => {
              const isOwner = currentUser?.id === record.author;
              const size = isOwner ? 'small' : 'middle';
      
              return (
      Severity: Minor
      Found in src/pages/Hub.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 parse has a Cognitive Complexity of 11 (exceeds 5 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

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

            private parseToothLogs(raw: string): void {
              this.resultTooth = [];
          
              raw.split('\n').forEach((line) => {
                const trimmed = line.trim();
          Severity: Minor
          Found in src/utils/logs/TriggerLogsParser.ts - About 1 hr to fix

            Function NewVersionPrompt has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const NewVersionPrompt = () => {
              // fetch /version.json?v=timestamp every 10s
              const { status, reloadPage } = useUpdateCheck({
                type: 'interval',
                interval: 10000,
            Severity: Minor
            Found in src/App.tsx - About 1 hr to fix

              Function panels has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const panels = Object.keys(resolvedDialogs).map((dialogName: string): RenderedPanel => {
                  const currentDialog: DialogType | CurveType | TableType = resolvedDialogs[dialogName];
                  let type = PanelTypes.CURVE;
                  let fields: FieldType[] = [];
              
              
              Severity: Minor
              Found in src/components/Tune/Dialog.tsx - About 1 hr to fix

                Function ready has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      ready(u) {
                        document.addEventListener('keydown', (e: KeyboardEvent) => {
                          if (e.ctrlKey || e.metaKey) {
                            return;
                          }
                Severity: Minor
                Found in src/utils/uPlot/keyboardZoomPlugin.ts - About 1 hr to fix

                  Function mapSubMenuItems has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        const mapSubMenuItems = (
                          rootMenuName: string,
                          rootMenu: MenuType,
                          subMenus: Record<string, SubMenuType | GroupMenuType | GroupChildMenuType>,
                          groupMenuName: string | null = null,
                  Severity: Minor
                  Found in src/components/CommandPalette.tsx - About 1 hr to fix

                    Function fetchWithProgress has 30 lines of code (exceeds 25 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

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

                              const raw = await fetchLogFileWithProgress(
                                tuneData!.id,
                                logFileName,
                                (percent, total, edge) => {
                                  setProgress(percent);
                      Severity: Major
                      Found in src/pages/Diagnose.tsx and 1 other location - About 1 hr to fix
                      src/pages/Logs.tsx on lines 203..212

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

                      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 raw = await fetchLogFileWithProgress(
                                tuneData!.id,
                                logFileName,
                                (percent, total, edge) => {
                                  setProgress(percent);
                      Severity: Major
                      Found in src/pages/Logs.tsx and 1 other location - About 1 hr to fix
                      src/pages/Diagnose.tsx on lines 95..104

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

                      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

                          {
                            id: 'UploadAction',
                            section: Sections.NAVIGATION,
                            name: 'Upload',
                            subtitle: 'Upload tune and logs.',
                      Severity: Major
                      Found in src/components/CommandPalette.tsx and 3 other locations - About 1 hr to fix
                      src/components/CommandPalette.tsx on lines 329..338
                      src/components/CommandPalette.tsx on lines 355..364
                      src/components/CommandPalette.tsx on lines 365..374

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

                          {
                            id: 'HubAction',
                            section: Sections.NAVIGATION,
                            name: 'Hub',
                            subtitle: 'Public tunes and logs.',
                      Severity: Major
                      Found in src/components/CommandPalette.tsx and 3 other locations - About 1 hr to fix
                      src/components/CommandPalette.tsx on lines 345..354
                      src/components/CommandPalette.tsx on lines 355..364
                      src/components/CommandPalette.tsx on lines 365..374

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

                          {
                            id: 'LoginAction',
                            section: Sections.AUTH,
                            name: 'Login',
                            subtitle: 'Login using email, Google or GitHub account.',
                      Severity: Major
                      Found in src/components/CommandPalette.tsx and 3 other locations - About 1 hr to fix
                      src/components/CommandPalette.tsx on lines 329..338
                      src/components/CommandPalette.tsx on lines 345..354
                      src/components/CommandPalette.tsx on lines 365..374

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

                          {
                            id: 'SignUpAction',
                            section: Sections.AUTH,
                            name: 'Sign-up',
                            subtitle: 'Create new account.',
                      Severity: Major
                      Found in src/components/CommandPalette.tsx and 3 other locations - About 1 hr to fix
                      src/components/CommandPalette.tsx on lines 329..338
                      src/components/CommandPalette.tsx on lines 345..354
                      src/components/CommandPalette.tsx on lines 355..364

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

                      Severity
                      Category
                      Status
                      Source
                      Language