bemusic/bemuse

View on GitHub

Showing 274 of 508 total issues

Avoid too many return statements within this function.
Open

        return true
Severity: Major
Found in bemuse/src/previewer/NotechartPreview.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

              if (gameNote.position > position + windowSize * 1.5) 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 (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

                  return
          Severity: Major
          Found in bemuse/src/previewer/PreviewFileDropHandler.tsx - 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

                    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 `${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 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

                          if (rest[0] === 'sustain') return 'Sustain'
                    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_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

                            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 `${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 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

                                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 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 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] === 'mod') return 'Mod'
                                    Severity: Major
                                    Found in bemuse/src/omni-input/index.ts - About 30 mins to fix

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

                                      function hasScratch(chart: BMSChart) {
                                        const objects = chart.objects.all()
                                        for (let i = 0; i < objects.length; i++) {
                                          const object = objects[i]
                                          let channel = +object.channel
                                      Severity: Minor
                                      Found in packages/bemuse-indexer/src/index.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 runMocha has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      function runMocha() {
                                        const specs = []
                                        mocha
                                          .run()
                                          .on('test end', function reportFailedSpec(test) {
                                      Severity: Minor
                                      Found in bemuse/src/test/index.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