Showing 274 of 508 total issues
Function exports
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) {
config.set({
// Make Karma work with pnpm.
// See: https://github.com/pnpm/pnpm/issues/720#issuecomment-954120387
plugins: Object.keys(require('./package').devDependencies).flatMap(
Function play
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function play(callbacks: { a: () => void }) {
master.unmute()
const BPM = 148
const time = new AudioTime(context, -1)
File index.spec.ts
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { BPMInfo, OutputSongInfo } from './types'
import { expect } from 'chai'
import * as indexer from '.'
describe('getFileInfo (bms)', function () {
Function PreviewFileDropHandler
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const PreviewFileDropHandler: FC<PreviewFileDropHandler> = (props) => {
useEffect(() => {
const onDragOver = (e: DragEvent) => {
e.preventDefault()
}
Function OmniInputPlugin
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function OmniInputPlugin(game) {
const input = new OmniInput(window, {
exclusive: true,
continuous: game.players[0].options.input.continuous,
sensitivity: game.players[0].options.input.sensitivity,
Function HomePage
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const HomePage = () => {
return (
<Page>
<Heading>What is Bemuse?</Heading>
<p>Bemuse is an online, web-based rhythm game.</p>
Function getSong
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getSong = async function (): Promise<GameLoader.LoadSpec> {
const kbm = (query.keyboard || '').split(',').map((x) => +x)
const options: OptionsDraft = {
url: query.bms || '/music/[snack]dddd/dddd_sph.bme',
game: {
Function getKeys
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export function getKeys(chart: BMS.BMSChart): Keys {
const objects = chart.objects.all()
const stat: { [channel: number]: number } = {}
for (let i = 0; i < objects.length; i++) {
const object = objects[i]
- 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 MusicListItem
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MusicListItem = (props: MusicListItemProps) => {
const { song, selected, onSelect, highlight } = props
const handleClick = (e: MouseEvent<HTMLLIElement>) => {
onSelect(e, song)
}
Function runMocha
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runMocha() {
const specs = []
mocha
.run()
.on('test end', function reportFailedSpec(test) {
Function loadFromBmsFileList
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function loadFromBmsFileList(bmsFileList: string[]) {
onMessage(bmsFileList.length + ' file(s) found. Reading them...')
const files = await Promise.all(
bmsFileList.map(async (filename) => {
const start = Date.now()
Function _judgeNote
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_judgeNote(note: GameNote) {
let delta = this._gameTime - note.time
let judgment = judgeTime(this._gameTime, note.time, this._judge)
let result = this._noteResult.get(note)
const isDown = !result || result.status === 'unjudged'
Function getSongInfo
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
async function getSongInfo(
files: IndexingInputFile[],
options?: {
cache?: {
get(md5: string): OutputFileInfo
- 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 notesDataAndKeysoundsDataForBmsonAndTiming
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function notesDataAndKeysoundsDataForBmsonAndTiming(
bmson: Bmson,
timing: BMS.Timing,
options: MusicalScoreOptions
) {
- 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 OmniInputPlugin
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function OmniInputPlugin(game) {
const input = new OmniInput(window, {
exclusive: true,
continuous: game.players[0].options.input.continuous,
sensitivity: game.players[0].options.input.sensitivity,
- 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 _preTransform
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
_preTransform(
bmsNotes: BMS.BMSNote[],
playerOptions: Partial<PlayerOptions>
) {
let chain = _.chain(bmsNotes)
- 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 _advance
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private _advance() {
const currentTime =
this._samplingMaster.currentTime -
this._startAudioTime +
this._startSongTime
- 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 _shouldJudge
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
_shouldJudge(note: GameNote, control: Control, buffer: NoteBuffer) {
const status = this.getNoteStatus(note)
if (status === 'unjudged') {
if (this._shouldAutoplay() && this._gameTime >= note.time) {
this.tainted = true
- 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 loadSongFromResources
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function loadSongFromResources(
resources: ICustomSongResources,
options: LoadSongOptions = {}
) {
const onMessage = options.onMessage || (() => {})
- 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 a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const OptionsInput = () => {
const dispatch = useDispatch()
const { scratch, texts, mode, isContinuous, sensitivity } =
useSelector(extractState)
const [editing, setEditing] = useState<string | null>(null)
- 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"