bemusic/bemuse

View on GitHub

Showing 274 of 508 total issues

Function show has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function show(message, e, url, line, col) {
Severity: Minor
Found in bemuse/src/boot/ui/ErrorDialog.js - About 35 mins to fix

    Function createNotechartPreview has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      notechart: Notechart,
      filename: string,
      samplingMaster: SamplingMaster,
      soundGroup: SoundGroup,
      samples: PreviewSoundSample[]
    Severity: Minor
    Found in bemuse/src/previewer/NotechartPreview.ts - About 35 mins to fix

      Function describeArc has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        x: number,
        y: number,
        radius: number,
        startAngle: number,
        endAngle: number
      Severity: Minor
      Found in bemuse/src/previewer/BarDot.tsx - About 35 mins to fix

        Function __createBinding has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
            if (k2 === undefined) k2 = k;
            var desc = Object.getOwnPropertyDescriptor(m, k);
            if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
              desc = { enumerable: true, get: function() { return m[k]; } };
        Severity: Minor
        Found in common/scripts/install-run.js - About 35 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 __createBinding has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
            if (k2 === undefined) k2 = k;
            var desc = Object.getOwnPropertyDescriptor(m, k);
            if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
              desc = { enumerable: true, get: function() { return m[k]; } };
        Severity: Minor
        Found in common/scripts/install-run-rush.js - About 35 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 go has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        async function go(loader, element) {
          const master = new SamplingMaster(ctx)
          const $log = element.find('.js-log')
          const $play = element.find('.js-play').hide()
          const $sampler = element.find('.js-sampler')
        Severity: Minor
        Found in bemuse/src/coming-soon/demo/index.js - About 35 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 add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          add(object: BMSObject) {
            if (object.channel !== '01') {
              for (let i = 0; i < this._objects.length; i++) {
                const test = this._objects[i]
                if (
        Severity: Minor
        Found in packages/bms/src/bms/objects.ts - About 35 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 judgeTimeWith has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export function judgeTimeWith(f: (timegate: Timegate) => number) {
          return function judgeTimeWithF(
            gameTime: number,
            noteTime: number,
            judge: IJudge = NORMAL_JUDGE
        Severity: Minor
        Found in bemuse/src/game/judgments.ts - About 35 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 main has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export async function main(bootContext: {
          setStatus: (status: string) => void
        }) {
          bootContext.setStatus('Loading song')
          const state口 = new Subject<ExperimentState>()
        Severity: Minor
        Found in bemuse/src/auto-synchro/index.tsx - About 35 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 update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          update() {
            const changes = new Map()
            for (const [name, control] of this._controls) {
              void name
              control.changed = false
        Severity: Minor
        Found in bemuse/src/game/input/index.ts - About 35 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 getToolbarItems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const getToolbarItems = ({
          online,
          user,
          handleCustomBMSOpen,
          handleAuthenticate,
        Severity: Minor
        Found in bemuse/src/app/ui/MusicSelectScene.tsx - About 35 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 unarchive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export async function unarchive(file: File): Promise<FileEntry[]> {
          const out: FileEntry[] = []
          const archive = await Archive.open(file)
          const extracted = await archive.extractFiles()
          const traverse = (tree: any, prefix = '') => {
        Severity: Minor
        Found in bemuse/src/resources/unarchiver.ts - About 35 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 getJudgeForNotechart has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export function getJudgeForNotechart(
          notechart: Notechart,
          { tutorial = false }
        ): IJudge {
          const info = notechart.songInfo
        Severity: Minor
        Found in bemuse/src/game/judgments.ts - About 35 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 NewRankingContainer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export const NewRankingContainer = ({
          chart,
          playMode,
          result,
        }: RankingContainerProps) => {
        Severity: Minor
        Found in bemuse/src/app/ui/RankingContainer.tsx - About 35 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 _updateSpeed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          _updateSpeed() {
            if (this.getPlayerInput('speedup').justPressed) {
              this._modifySpeed(+1)
            }
            if (this.getPlayerInput('speeddown').justPressed) {
        Severity: Minor
        Found in bemuse/src/game/state/player-state.ts - About 35 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 searchForChartFiles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        async function searchForChartFiles(
          directoryHandle: FileSystemDirectoryHandle,
          chartFileScanner: ChartFileScanner,
          io: CustomFolderScanIO,
          parentPath: string[] = []
        Severity: Minor
        Found in bemuse/src/custom-folder/index.ts - About 35 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

        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

            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

              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 (gameNote.position < position - windowSize * 0.5) return false
              Severity: Major
              Found in bemuse/src/previewer/NotechartPreview.ts - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language