Showing 274 of 508 total issues
Function _run
has 37 lines of code (exceeds 25 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);
Function _doSoX
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_doSoX(path, type, inputTypeArgs) {
return throat(
() =>
new Promise((resolve, reject) => {
const sox = spawn('sox', [
Function start
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function start(callback) {
const tasks = {}
const running = {}
const taskList = []
Function userSignUp
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function userSignUp(
username: string,
email: string,
password: string,
playerName: string
Function onDrop
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onDrop = async (e: DragEvent) => {
e.preventDefault()
const items = e.dataTransfer!.items
if (items.length !== 1) {
alert('Please drop only one folder.')
Function validateSong
has 36 lines of code (exceeds 25 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) {
Function getVisibleNotes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
getVisibleNotes(lower, upper, headroom) {
const out = []
const notes = this._notes
if (!headroom) headroom = 0
for (let i = 0; i < notes.length; 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 loginByUsernamePassword
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export async function loginByUsernamePassword(
username,
password,
{
log = (message) => console.log('[loginByUsernamePassword]', 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 loadPreview
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export async function loadPreview(loadOptions: LoadPreviewOptions) {
const log =
loadOptions.log ||
((message: string) => console.log(`[PreviewLoader] ${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 previewStateReducer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function previewStateReducer(
state: PreviewState,
action: PreviewAction
) {
let nextState = state
- 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 combine
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public combine(...input: [boolean, boolean]) {
for (let i = 0; i < 2; ++i) {
if (input[i] && this.input[i] <= 0) {
this.input[i] = 1
this.last = 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 simultaneous
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function simultaneous(target: Progress) {
const queue: Progress[] = []
let current: Progress | undefined
let unsubscribe: (() => void) | null = null
function update() {
- 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 bmp2png
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function bmp2png(file) {
return throat(
() =>
new Promise((resolve, reject) => {
const convert = spawn('convert', [realpathSync(file.path), 'png:-'])
Function getFileInfo
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function getFileInfo(
data: Buffer,
meta: InputMeta,
options?: { extensions?: ExtensionMap }
): Promise<OutputFileInfo> {
Function hopeGauge
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function hopeGauge() {
let primary
let secondary
let extra
return {
Function update
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update() {
if (!enabled) {
if (backgroundPlayed) {
backgroundFader.fadeTo(0, 100)
backgroundPlayed = false
Function _preTransform
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_preTransform(
bmsNotes: BMS.BMSNote[],
playerOptions: Partial<PlayerOptions>
) {
let chain = _.chain(bmsNotes)
Function main
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function main() {
const props = {
result: {
1: 9999,
2: 999,
Function update
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public update(axis: number, threshold: number = 3) {
if (this.previous === false) {
this.previous = axis
return 0
}
Function OptionsInputField
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const OptionsInputField = <T,>(
props: OptionsInputFieldProps<T> &
Omit<ComponentProps<'input'>, keyof OptionsInputFieldProps<T>>
) => {
const { stringify, parse, onChange, validator, value } = props