Showing 274 of 508 total issues
Function PreviewFileDropHandler
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export const PreviewFileDropHandler: FC<PreviewFileDropHandler> = (props) => {
useEffect(() => {
const onDragOver = (e: DragEvent) => {
e.preventDefault()
}
- 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 keysForBmson
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
export function keysForBmson(bmson: Bmson) {
const soundChannels = soundChannelsForBmson(bmson)
let hasKeys = false
let hasSecondPlayer = false
let hasDeluxeKeys = 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
File index.spec.js
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as Scintillator from './'
const fixture = (file) => `/base/src/scintillator/test-fixtures/${file}`
describe('Scintillator', function () {
Function loadSongFromResources
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function loadSongFromResources(
resources: ICustomSongResources,
options: LoadSongOptions = {}
) {
const onMessage = options.onMessage || (() => {})
Function _judgeNote
has a Cognitive Complexity of 22 (exceeds 5 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'
- 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 launchGame
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
async function launchGame(
{
server,
song,
chart,
- 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 loadPreview
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function loadPreview(loadOptions: LoadPreviewOptions) {
const log =
loadOptions.log ||
((message: string) => console.log(`[PreviewLoader] ${message}`))
Function generateBaseConfig
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateBaseConfig() {
const config = {
mode: Env.production() ? 'production' : 'development',
context: path('src'),
resolve: webpackResolve,
Function main
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function main() {
// iOS
window.addEventListener('touchstart', function unmute() {
unmuteAudio(audioContext)
window.removeEventListener('touchstart', unmute)
Online
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
export class Online {
constructor(private readonly service: InternetRankingService) {}
/** @deprecated */
private user口 = new Subject<UserInfo | null>()
Function ModeSelectScene
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ModeSelectScene = () => {
const sceneManager = useContext(SceneManagerContext)
const dispatch = useDispatch()
const playDevice = useRef<PlayDevice>(null)
Function ChildManager
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function ChildManager(expr, child, poolSize) {
return {
instantiate(context, subject) {
const instances = new Map()
const pool = []
- 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 _judgeColumn
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
_judgeColumn(buffer: NoteBuffer, control: Control, column: string) {
let judgedNote
let judgment
const notes = buffer.notes
let autoPlayed = 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 getFilesFromEvent
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function getFilesFromEvent(
event: DragEvent,
log: LoggingFunction
): Promise<FileEntry[]> {
const out: FileEntry[] = []
Function update
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public update(axis: number, threshold: number = 3) {
if (this.previous === false) {
this.previous = axis
return 0
}
- 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 main
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function main(bootContext: {
setStatus: (status: string) => void
}) {
bootContext.setStatus('Loading song')
const state口 = new Subject<ExperimentState>()
Function updateVisibleNotes
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateVisibleNotes() {
const entities = noteArea.getVisibleNotes(position, getUpperBound(), 1)
if (touch3dMode) {
const putNote = (id, noteY, column, scale = 1) => {
const row = touch3d.getRow(noteY - 0.01)
Function main
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function main() {
const chart = BMS.Compiler.compile(`
#TITLE ทดสอบ Bemuse
#ARTIST ฟหกด
#00111:01
Function getName
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function getName(key: string) {
if (+key) {
return _.capitalize(keycode(+key))
}
{
- 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 TitleScene
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TitleScene = () => {
const sceneManager = useContext(SceneManagerContext)
const dispatch = useDispatch()
const options = useSelector(selectOptions)