bemusic/bemuse

View on GitHub

Showing 274 of 508 total issues

Function _run has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function _run() {
    const [nodePath /* Ex: /bin/node */, scriptPath /* /repo/common/scripts/install-run-rush.js */, ...packageBinArgs /* [build, --to, myproject] */] = process.argv;
    // Detect if this script was directly invoked, or if the install-run-rushx script was invokved to select the
    // appropriate binary inside the rush package to run
    const scriptName = path.basename(scriptPath);
Severity: Minor
Found in common/scripts/install-run-rush.js - About 1 hr to fix

    Function start has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function start(callback) {
      const tasks = {}
      const running = {}
      const taskList = []
    
    
    Severity: Minor
    Found in bemuse/src/game/loaders/multitasker.js - About 1 hr to fix

      Function _doSoX has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _doSoX(path, type, inputTypeArgs) {
          return throat(
            () =>
              new Promise((resolve, reject) => {
                const sox = spawn('sox', [
      Severity: Minor
      Found in packages/bemuse-tools/src/audio.js - About 1 hr to fix

        Function userSignUp has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function userSignUp(
            username: string,
            email: string,
            password: string,
            playerName: string
        Severity: Minor
        Found in bemuse/src/online/scoreboard-system/createLegacyScoreboardClient.ts - About 1 hr to fix

          Function onDrop has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              const onDrop = async (e: DragEvent) => {
                e.preventDefault()
                const items = e.dataTransfer!.items
                if (items.length !== 1) {
                  alert('Please drop only one folder.')
          Severity: Minor
          Found in bemuse/src/previewer/PreviewFileDropHandler.tsx - About 1 hr to fix

            Function validateSong has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function validateSong(song: Song): Problem[] {
              const problems: Problem[] = []
              const report = (message: string, ...keys: string[]) =>
                problems.push({ keys, message })
              if (song.unreleased) {
            Severity: Minor
            Found in bemuse/src/music-collection-viewer/MusicTable.tsx - About 1 hr to fix

              Function previewStateReducer has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              export function previewStateReducer(
                state: PreviewState,
                action: PreviewAction
              ) {
                let nextState = state
              Severity: Minor
              Found in bemuse/src/previewer/PreviewState.tsx - 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 loginByUsernamePassword has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              export async function loginByUsernamePassword(
                username,
                password,
                {
                  log = (message) => console.log('[loginByUsernamePassword]', message),
              Severity: Minor
              Found in bemuse/src/online/scoreboard-system/authenticationFlow.js - 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 loadPreview has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              export async function loadPreview(loadOptions: LoadPreviewOptions) {
                const log =
                  loadOptions.log ||
                  ((message: string) => console.log(`[PreviewLoader] ${message}`))
              
              
              Severity: Minor
              Found in bemuse/src/previewer/PreviewLoader.tsx - 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 getVisibleNotes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                getVisibleNotes(lower, upper, headroom) {
                  const out = []
                  const notes = this._notes
                  if (!headroom) headroom = 0
                  for (let i = 0; i < notes.length; i++) {
              Severity: Minor
              Found in bemuse/src/game/display/note-area.js - 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 combine has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                public combine(...input: [boolean, boolean]) {
                  for (let i = 0; i < 2; ++i) {
                    if (input[i] && this.input[i] <= 0) {
                      this.input[i] = 1
                      this.last = i
              Severity: Minor
              Found in bemuse/src/game/input/dual-input.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 simultaneous has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              export function simultaneous(target: Progress) {
                const queue: Progress[] = []
                let current: Progress | undefined
                let unsubscribe: (() => void) | null = null
                function update() {
              Severity: Minor
              Found in bemuse/src/progress/utils.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 getFileInfo has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              async function getFileInfo(
                data: Buffer,
                meta: InputMeta,
                options?: { extensions?: ExtensionMap }
              ): Promise<OutputFileInfo> {
              Severity: Minor
              Found in packages/bemuse-indexer/src/index.ts - About 1 hr to fix

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

                export function bmp2png(file) {
                  return throat(
                    () =>
                      new Promise((resolve, reject) => {
                        const convert = spawn('convert', [realpathSync(file.path), 'png:-'])
                Severity: Minor
                Found in packages/bemuse-tools/src/bmp2png.js - About 1 hr to fix

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

                  export function main() {
                    const props = {
                      result: {
                        1: 9999,
                        2: 999,
                  Severity: Minor
                  Found in bemuse/src/devtools/playgrounds/result.js - About 1 hr to fix

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

                    function hopeGauge() {
                      let primary
                      let secondary
                      let extra
                      return {
                    Severity: Minor
                    Found in bemuse/src/game/display/Gauge.js - About 1 hr to fix

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

                        _preTransform(
                          bmsNotes: BMS.BMSNote[],
                          playerOptions: Partial<PlayerOptions>
                        ) {
                          let chain = _.chain(bmsNotes)
                      Severity: Minor
                      Found in packages/bemuse-notechart/src/index.ts - About 1 hr to fix

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

                          function update() {
                            if (!enabled) {
                              if (backgroundPlayed) {
                                backgroundFader.fadeTo(0, 100)
                                backgroundPlayed = false
                        Severity: Minor
                        Found in bemuse/src/music-previewer/index.js - About 1 hr to fix

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

                            public update(axis: number, threshold: number = 3) {
                              if (this.previous === false) {
                                this.previous = axis
                                return 0
                              }
                          Severity: Minor
                          Found in bemuse/src/omni-input/axis-logic.ts - About 1 hr to fix

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

                            const OptionsInputField = <T,>(
                              props: OptionsInputFieldProps<T> &
                                Omit<ComponentProps<'input'>, keyof OptionsInputFieldProps<T>>
                            ) => {
                              const { stringify, parse, onChange, validator, value } = props
                            Severity: Minor
                            Found in bemuse/src/app/ui/OptionsInputField.tsx - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language