Showing 274 of 508 total issues
Function update
has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring. Open
update(time, gameTime, playerState) {
const touch3dMode = this._touch3dMode
const player = this._player
const noteArea = this._noteArea
const stateful = this._stateful
- Read upRead up
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 323 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tests(onlineServiceOptions) {
const storage = {
map: new Map(),
getItem(key) {
return this.map.get(key) ?? null
Function TouchPlugin
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
export function TouchPlugin(context) {
let scratchStartY = null
let scratchY = null
const getInput = bench.wrap('input:touch:I', _getInput)
const getScratch = bench.wrap('input:touch:SC', _getScratch)
- Read upRead up
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 182 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(time, gameTime, playerState) {
const touch3dMode = this._touch3dMode
const player = this._player
const noteArea = this._noteArea
const stateful = this._stateful
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,
Function createMusicPreviewer
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
function createMusicPreviewer() {
let enabled = false
let currentUrl = null
let backgroundLoaded = false
let backgroundPlayed = false
- Read upRead up
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 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
Function createFakeScoreboardClient
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createFakeScoreboardClient(): ScoreboardClient {
let submissions: Submission[] = []
let nextId = 1
const chart = (md5: string, playMode: MappingMode) => {
Function MusicSelectScene
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MusicSelectScene = () => {
const sceneManager = useContext(SceneManagerContext)
const musicSelect = useSelector(selectMusicSelectState)
const collectionUrl = useSelector(selectCurrentCollectionUrl)
const options = useSelector(selectOptions)
Function generateLoadersConfig
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateLoadersConfig() {
return [
...(Env.coverageEnabled()
? [
{
File NotechartPreview.ts
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
import Notechart, {
GameLandmine,
GameNote,
SoundedEvent,
} from 'bemuse-notechart'
Function AboutScene
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AboutScene = () => {
const sceneManager = useContext(SceneManagerContext)
const [artists, setArtists] = useState<{ name: string; url: string }[]>([])
useEffect(() => {
Function PreviewCanvas
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const PreviewCanvas: FC<PreviewCanvas> = (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)
File install-run.js
has 395 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;
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
- Read upRead up
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 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createMusicPreviewer() {
let enabled = false
let currentUrl = null
let backgroundLoaded = false
let backgroundPlayed = false
Function AuthenticationPanel
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
const AuthenticationPanel = ({ onFinish }: AuthenticationPanelProps) => {
const online = useContext(OnlineContext)
const [mode, setMode] = useState<AuthMode>('logIn')
const [auth, setAuth] = useState<AuthState>({ status: 'idle', message: '' })
- Read upRead up
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 OptionsInput
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
const OptionsInput = () => {
const dispatch = useDispatch()
const { scratch, texts, mode, isContinuous, sensitivity } =
useSelector(extractState)
const [editing, setEditing] = useState<string | null>(null)
File index.spec.js
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { filter, first, firstValueFrom } from 'rxjs'
import Online from '.'
import OnlineService from './scoreboard-system/OnlineService'
import assert from 'power-assert'
File createLegacyScoreboardClient.ts
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
import axios from 'axios'
import invariant from 'invariant'
import * as authenticationFlow from './authenticationFlow'
import { ScoreboardClient } from './ScoreboardClient'