Showing 274 of 508 total issues
Function _SoX
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async _SoX(path, type) {
let typeArgs = []
try {
const fd = await fs.promises.open(path, 'r')
const buffer = Buffer.alloc(4)
Function as
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
async as(type, progress) {
let shouldGiveUp = false
for (let i = 1; ; i++) {
try {
return await attempt()
Function OptionsAdvanced
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const OptionsAdvanced = () => {
const dispatch = useDispatch()
const options = useSelector(selectOptions)
const handleAudioInputLatencyChange = (value: number) => {
Function main
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function main() {
sceneRoot.render(
<QueryClientProvider client={queryClient}>
<div style={{ margin: '0 auto', maxWidth: '32em', padding: '0 1em' }}>
<h1>Bemuse custom songs folder console</h1>
Function createNullNotechartPreview
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createNullNotechartPreview(): NotechartPreview {
const warning =
location.hostname !== 'bemuse.ninja'
? ' [NOTE: Do not bookmark this URL because it is a preview and this URL will stop working in the future.]'
: ''
Function fakeWindow
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fakeWindow() {
const events = new EventEmitter()
const gamepads = []
const noop = () => {}
return {
Function notesDataAndKeysoundsDataForBmsonAndTiming
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function notesDataAndKeysoundsDataForBmsonAndTiming(
bmson: Bmson,
timing: BMS.Timing,
options: MusicalScoreOptions
) {
Function CollectionViewer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CollectionViewer = () => {
const [status, setStatus] = useState('Loading')
const [data, setData] = useState<MusicServerIndex | null>(null)
const url = query.server || OFFICIAL_SERVER_URL
Function findVideoUrl
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function findVideoUrl(song: Song, assets: LoadSpec['assets']) {
if (song.video_url) {
return song.video_url
}
if (song.video_file) {
Function handleClipboardPaste
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
(dispatch: Dispatch<AnyAction>) => (e: ClipboardEvent) => {
const text = e.clipboardData?.getData('text/plain')
if (!text) {
return
}
Function get
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
get() {
const data = input.update()
const result = {
p1_1: data[kbm['1'] || '83'],
Function Benchmarker
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Benchmarker() {
const stats = {}
const bench = {
enabled: true,
stats,
Function showAlert
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function showAlert(title: string, message: ReactNode) {
await registerActiveModal(
new Promise<void>((resolve) => {
const container = document.createElement('div')
const root = createRoot(container)
Function _resolvePackageVersion
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function _resolvePackageVersion(logger, rushCommonFolder, { name, version }) {
if (!version) {
version = '*'; // If no version is specified, use the latest version
}
if (version.match(/^[a-zA-Z0-9\-\+\.]+$/)) {
- 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 constructor
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
constructor (options) {
this._context = options.context
this._object = options.object
this._children = options.children
this._bindings = []
- 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 fromBMSChart
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
static fromBMSChart(chart: BMSChart) {
void BMSChart
const info: Partial<ISongInfoData> = {}
let title = chart.headers.get('title')
const artist = chart.headers.get('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 _run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function _run() {
const [nodePath /* Ex: /bin/node */, scriptPath /* /repo/common/scripts/install-run-rush.js */, ...packageBinArgs /* [build, --to, myproject] */] = process.argv;
// Detect if this script was directly invoked, or if the install-run-rushx script was invokved to select the
// appropriate binary inside the rush package to run
const scriptName = path.basename(scriptPath);
- 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 getTouchedColumn
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function getTouchedColumn(x, y) {
let min = 0.75
let max = 1
let mid
let row
- 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 compile
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function compile(text: string, options?: Partial<BMSCompileOptions>) {
options = options || {}
const chart = new BMSChart()
- 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 Buttons
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const Buttons = ({ song }: MusicInfoTabInformationProps) => {
const buttons = []
if (song.bms_url) {
buttons.push(<Link text='Download BMS' url={song.bms_url} />)
}
- 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"