Showing 274 of 508 total issues
Function scanFolder
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export async function scanFolder(
context: CustomFolderContext,
io: CustomFolderScanIO
) {
let state = await getCustomFolderState(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 use
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
use(plugin: IGameInputPlugin) {
const state: { [key: string]: number } = {}
const name = 'input:' + plugin.name
this._plugins.push({
get: bench.wrap(name, function () {
- 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 updateFolders
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function updateFolders(
state: CustomFolderState,
handle: FileSystemDirectoryHandle,
io: CustomFolderScanIO
): Promise<ScanIterationResult | undefined> {
- 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 getTweetLink
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const getTweetLink = ({ chart, result }: { chart: Chart; result: Result }) => {
const title = chart.info.title
let subtitle = chart.info.subtitles[0] || ''
const score = result.score
const grade = result.grade
- 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 ComboBox
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function ComboBox<T extends ComboBoxItem>(props: {
items: T[]
onSelect: (item: T) => void
}) {
const [inputItems, setInputItems] = useState(props.items)
- 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 instantiate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
instantiate(context, container) {
let text
if (this.ttf) {
text = new PIXI.Text(this.text, {
font: this.font,
Function fromBMSChart
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fromBMSChart(bms: BMS.BMSChart, playerOptions: PlayerOptions) {
const notes = BMS.Notes.fromBMSChart(bms, {
mapping: playerOptions.double
? BMS.Notes.CHANNEL_MAPPING.IIDX_DP
: BMS.Notes.CHANNEL_MAPPING.IIDX_P1,
Function doSignUp
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const doSignUp = async (formData: AuthenticationFormData) => {
if (!formData.username.trim()) {
throw new Error('Please enter a username.')
}
if (!formData.username.match(/^\S+$/)) {
Function showQuickPick
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function showQuickPick<T extends QuickPickItem>(
items: T[],
options: QuickPickOptions
) {
return registerActiveModal(
Function main
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function main() {
const renderer = PIXI.autoDetectRenderer(640, 480)
const stage = new PIXI.Stage(0x8b8685)
const loader = new PIXI.loaders.Loader()
const urls = [
Function send
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function send(category, action, label, value, extra) {
console.log('[Analytics]', category, action, label, value, extra)
ga('send', 'event', category, action, label, value)
try {
if (window.ga) {
Function searchForChartFiles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function searchForChartFiles(
directoryHandle: FileSystemDirectoryHandle,
chartFileScanner: ChartFileScanner,
io: CustomFolderScanIO,
parentPath: string[] = []
Function load
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
load(md5: string): Promise<T[]> {
if (!this.pending) {
const set = new Set<string>()
this.pending = {
set,
Function scanAllChartFiles
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function scanAllChartFiles(
state: CustomFolderState,
handle: FileSystemDirectoryHandle,
io: CustomFolderScanIO
): Promise<ScanIterationResult | undefined> {
Consider simplifying this complex logical expression. Open
if (params.score > (+gameScore.get('score') || -1)) {
gameScore.set('recordedAt', new Date())
gameScore.set('score', params.score)
gameScore.set('combo', params.combo)
gameScore.set('total', params.total)
Function findRushJsonFolder
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function findRushJsonFolder() {
if (!_rushJsonFolder) {
let basePath = __dirname;
let tempPath = __dirname;
do {
- 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 installAndRun
has a Cognitive Complexity of 9 (exceeds 5 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}`);
- 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 instantiate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
instantiate(context, container) {
const object = new PIXI.Container()
const expr = this.key
const value = this.value
const childNode = this.child
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
constructor(samplingMaster, buffer, delay, options = {}) {
delay = delay || 0
this._master = samplingMaster
// Connect all the stuff...
- 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 BarDots
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const BarDots: FC<BarDots> = (props) => {
const { measureInfo } = props
if (!measureInfo.measureEndBeat) return null
const measureSize = measureInfo.measureEndBeat - measureInfo.measureStartBeat
if (!measureSize) return 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"