bemusic/bemuse

View on GitHub

Showing 274 of 494 total issues

Function update has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
Open

  update(time, gameTime, playerState) {
    const touch3dMode = this._touch3dMode
    let player = this._player
    let noteArea = this._noteArea
    let stateful = this._stateful
Severity: Minor
Found in bemuse/src/game/display/player-display.js - About 1 day 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 tests has 349 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function tests(onlineServiceOptions) {
  function createOnline() {
    return new Online(new OnlineService(onlineServiceOptions))
  }

Severity: Major
Found in bemuse/src/online/index.spec.js - About 1 day to fix

    Function TouchPlugin has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
    Open

    export function TouchPlugin(context) {
      let scratchStartY = null
      let scratchY = null
      let getInput = bench.wrap('input:touch:I', _getInput)
      let getScratch = bench.wrap('input:touch:SC', _getScratch)
    Severity: Minor
    Found in bemuse/src/game/input/touch-plugin.js - About 1 day 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 createMusicPreviewer has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
    Open

    function createMusicPreviewer() {
      let enabled = false
      let currentUrl = null
      let backgroundLoaded = false
      let backgroundPlayed = false
    Severity: Minor
    Found in bemuse/src/music-previewer/index.js - About 1 day 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 Online has 189 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function Online(service) {
      const user口 = new Bacon.Bus()
      const seen口 = new Bacon.Bus()
      const submitted口 = new Bacon.Bus()
    
    
    Severity: Major
    Found in bemuse/src/online/index.js - About 7 hrs to fix

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

        update(time, gameTime, playerState) {
          const touch3dMode = this._touch3dMode
          let player = this._player
          let noteArea = this._noteArea
          let stateful = this._stateful
      Severity: Major
      Found in bemuse/src/game/display/player-display.js - About 7 hrs to fix

        File index.ts has 455 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import _ from 'lodash'
        import { get, set, del } from 'idb-keyval'
        import pMemoize from 'p-memoize'
        import {
          CustomFolderChartFile,
        Severity: Minor
        Found in bemuse/src/custom-folder/index.ts - About 6 hrs to fix

          Function load has 163 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function load(spec: LoadSpec) {
            const assets = spec.assets
            const bms = spec.bms
            const songId = spec.songId
          
          
          Severity: Major
          Found in bemuse/src/game/loaders/game-loader.ts - About 6 hrs to fix

            Function render has 148 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                return (
                  <div className='OptionsPlayer'>
                    <SettingRow
                      label='Speed'
            Severity: Major
            Found in bemuse/src/app/ui/OptionsPlayer.jsx - About 5 hrs to fix

              Function generateLoadersConfig has 148 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function generateLoadersConfig() {
                return [
                  {
                    test: /\.[jt]sx?$/,
                    include: [path('src'), path('spec')],
              Severity: Major
              Found in bemuse/config/webpack.js - About 5 hrs to fix

                File NotechartPreview.ts has 400 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import Notechart, {
                  GameLandmine,
                  GameNote,
                  SoundedEvent,
                } from 'bemuse-notechart'
                Severity: Minor
                Found in bemuse/src/previewer/NotechartPreview.ts - About 5 hrs to fix

                  File index.spec.js has 399 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import query from 'bemuse/utils/query'
                  
                  import Online from './'
                  import OnlineService from './scoreboard-system/OnlineService'
                  
                  
                  Severity: Minor
                  Found in bemuse/src/online/index.spec.js - About 5 hrs to fix

                    Function PreviewCanvas has 138 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    }> = (props) => {
                      const keymap = 'SCs 1 2b 3 4g 5 6b 7 - 8 9b 10 11g 12 13b 14 SC2s'
                      const notesImage = useImage('/skins/default/Note/DX/Note.png')
                      const landmineImage = useImage('/skins/default/Note/DX/Landmine.png')
                      const canvasRef = React.useRef<HTMLCanvasElement>(null)
                    Severity: Major
                    Found in bemuse/src/previewer/PreviewCanvas.tsx - About 5 hrs to fix

                      Function createMusicPreviewer has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function createMusicPreviewer() {
                        let enabled = false
                        let currentUrl = null
                        let backgroundLoaded = false
                        let backgroundPlayed = false
                      Severity: Major
                      Found in bemuse/src/music-previewer/index.js - About 5 hrs to fix

                        Function render has 132 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          render() {
                            return (
                              <Scene className='AboutScene'>
                                <SceneHeading>About</SceneHeading>
                                <section>
                        Severity: Major
                        Found in bemuse/src/app/ui/AboutScene.jsx - About 5 hrs to fix

                          Function getViewport has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                          Open

                            getViewport(currentTime: number, hiSpeed: number): PreviewViewport {
                              const beat = this._secondsToBeat(currentTime)
                              const position = this._notechart.beatToPosition(beat)
                              const speed = this._notechart.spacingAtBeat(beat)
                              const windowSize = 4 / speed / hiSpeed
                          Severity: Minor
                          Found in bemuse/src/previewer/NotechartPreview.ts - About 5 hrs 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

                          File install-run.js has 377 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          "use strict";
                          // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
                          // See the @microsoft/rush package's LICENSE file for license information.
                          var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
                              if (k2 === undefined) k2 = k;
                          Severity: Minor
                          Found in common/scripts/install-run.js - About 5 hrs to fix

                            Function getFilesFromEvent has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                            Open

                            async function getFilesFromEvent(
                              event: DragEvent,
                              log: LoggingFunction
                            ): Promise<FileEntry[]> {
                              let out: FileEntry[] = []
                            Severity: Minor
                            Found in bemuse/src/resources/dnd-resources.ts - About 4 hrs 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

                            File player-state.spec.js has 350 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import assert from 'power-assert'
                            
                            import GameInput from '../input'
                            import Player from '../player'
                            import PlayerState from './player-state'
                            Severity: Minor
                            Found in bemuse/src/game/state/player-state.spec.js - About 4 hrs to fix

                              Function TouchPlugin has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function TouchPlugin(context) {
                                let scratchStartY = null
                                let scratchY = null
                                let getInput = bench.wrap('input:touch:I', _getInput)
                                let getScratch = bench.wrap('input:touch:SC', _getScratch)
                              Severity: Major
                              Found in bemuse/src/game/input/touch-plugin.js - About 4 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language