bemusic/bemuse

View on GitHub

Showing 274 of 508 total issues

Avoid too many return statements within this function.
Open

  return { file: file, offset: offset }
Severity: Major
Found in packages/bemuse-indexer/src/bmson-bga.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            if (currentTime > gameNote.time) return false
    Severity: Major
    Found in bemuse/src/previewer/NotechartPreview.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        if (object.bga.bga_events.length !== 1) return undefined
      Severity: Major
      Found in packages/bemuse-indexer/src/bmson-bga.ts - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          if (!file) return undefined
        Severity: Major
        Found in packages/bemuse-indexer/src/bmson-bga.ts - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

            if (score < 500000) return 'A'
          Severity: Major
          Found in bemuse/src/rules/grade.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

              return 'S'
            Severity: Major
            Found in bemuse/src/rules/grade.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                return NORMAL_JUDGE
              Severity: Major
              Found in bemuse/src/game/judgments.ts - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return `${prefix} Pitch${rest[1] === 'up' ? '+' : '-'}`
                Severity: Major
                Found in bemuse/src/omni-input/index.ts - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return false
                  Severity: Major
                  Found in bemuse/src/game/state/player-state.ts - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return noteColumn(sprites.white, c)
                    Severity: Major
                    Found in bemuse/src/previewer/PreviewCanvas.tsx - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return new FixedTimegatesJudge(TRANSITIONAL_BEGINNER_LV4_TIMEGATES)
                      Severity: Major
                      Found in bemuse/src/game/judgments.ts - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return 5
                        Severity: Major
                        Found in bemuse/src/game/state/player-stats.ts - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                            return `${String(key).replace(/\./g, ' ')}?`
                          Severity: Major
                          Found in bemuse/src/omni-input/index.ts - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return new FixedTimegatesJudge(TRANSITIONAL_BEGINNER_LV5_TIMEGATES)
                            Severity: Major
                            Found in bemuse/src/game/judgments.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    if (rest[0] === 'mod') return 'Mod'
                              Severity: Major
                              Found in bemuse/src/omni-input/index.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                    if (i < 161) return 4
                                Severity: Major
                                Found in bemuse/src/game/state/player-stats.ts - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                    return scene
                                  Severity: Major
                                  Found in bemuse/src/app/index.tsx - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                          if (rest[0] === 'sustain') return 'Sustain'
                                    Severity: Major
                                    Found in bemuse/src/omni-input/index.ts - About 30 mins to fix

                                      Function lcs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      export function lcs(a: string, b: string) {
                                        let max = ''
                                        for (let i = 0; i < a.length; i++) {
                                          for (let j = 0; j < b.length; j++) {
                                            const cur = lcp(a, i, b, j)
                                      Severity: Minor
                                      Found in packages/bemuse-indexer/src/lcs.ts - About 25 mins 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 getReleaseChangelog has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      function getReleaseChangelog(changelog, version) {
                                        const lines = changelog.split('\n')
                                        /** @type {string[] | undefined} */
                                        let output
                                        for (const line of lines) {
                                      Severity: Minor
                                      Found in build-scripts/lib/changelog.js - About 25 mins 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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language