Showing 274 of 508 total issues
Function handleClipboardPaste
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
(dispatch: Dispatch<AnyAction>) => (e: ClipboardEvent) => {
const text = e.clipboardData?.getData('text/plain')
if (!text) {
return
}
- 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 Help
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Help = () => {
const supportLinks = [
{
content: (
<>
Function exports
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function () {
const World = this.World
World.plug(function () {
this.parseOptions = {}
Function createInstance
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createInstance(songUrl) {
const audio = document.createElement('audio')
audio.src = songUrl
let played = false
Function createSongServer
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createSongServer(dir) {
const promise = glob('**/*.{wav,ogg,mp3,m4a,flac}', { cwd: dir })
.map((name) =>
stat(path.join(dir, name)).then((stats) => ({
name: name,
Function installAndRun
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function installAndRun(logger, packageName, packageVersion, packageBinName, packageBinArgs, lockFilePath = process.env[INSTALL_RUN_LOCKFILE_PATH_VARIABLE]) {
const rushJsonFolder = findRushJsonFolder();
const rushCommonFolder = path.join(rushJsonFolder, 'common');
const rushTempFolder = _getRushTempFolder(rushCommonFolder);
const packageInstallFolder = _ensureAndJoinPath(rushTempFolder, 'install-run', `${packageName}@${packageVersion}`);
Function createFader
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createFader(audio, initialVolume, onTargetReached) {
let targetVolume = 0
let currentSpeed = 0
let requested = false
let volumeChanged
Function constructor
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(samplingMaster, buffer, delay, options = {}) {
delay = delay || 0
this._master = samplingMaster
// Connect all the stuff...
Function GenericErrorScene
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function GenericErrorScene(props: {
preamble: string
error: Error
onContinue: () => void
}) {
Function songInfoForBmson
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function songInfoForBmson(bmson: Bmson) {
const bmsonInfo = bmson.info
const info: Partial<BMS.ISongInfoData> = {}
if (bmsonInfo.title) info.title = bmsonInfo.title
if (bmsonInfo.artist) info.artist = bmsonInfo.artist
- 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 Scratch
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const Scratch = ({
active,
value,
}: {
active: boolean
- 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 CustomFolderTester
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const CustomFolderTester = () => {
const context = getDefaultCustomFolderContext()
const { isLoading, error, data } = useQuery('customFolder', async () => {
const result = await getCustomFolderState(context)
return result
- 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 groupSongsIntoCategories
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function groupSongsIntoCategories(
songs: readonly Song[],
{ songOfTheDayEnabled = false } = {}
) {
const context = {
- 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 validateSong
has a Cognitive Complexity of 13 (exceeds 5 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) {
- 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 getColumn
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getColumn(x: any, options: MusicalScoreOptions) {
switch (x) {
case 1:
return '1'
case 2:
Function _advance
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private _advance() {
const currentTime =
this._samplingMaster.currentTime -
this._startAudioTime +
this._startSongTime
Function slicesForNotesAndTiming
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function slicesForNotesAndTiming(
notes: Note[],
timing: BMS.Timing,
options: { beatForPulse: (pulse: number) => number }
) {
Function constructor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
data: NotechartInput,
playerOptions: Partial<PlayerOptions> = {}
) {
let {
Function _judgeColumn
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
_judgeColumn(buffer: NoteBuffer, control: Control, column: string) {
let judgedNote
let judgment
const notes = buffer.notes
let autoPlayed = false
Function KBGraphics
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function KBGraphics() {
const children = []
for (let i = 0; i < 7; i++) {
if (i === 3) {
children.push(