bemusic/bemuse

View on GitHub

Showing 274 of 508 total issues

Function load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export async function load(xmlPath, progress) {
  log('load XML from %s', xmlPath)
  const $xml = await loadXml(xmlPath)

  // scan all images
Severity: Minor
Found in bemuse/src/scintillator/loader.js - About 25 mins to fix

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 getBmsonBga has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function getBmsonBga(
  object: bmson.Bmson,
  options: { timing: BMS.Timing }
): BGAInfo | undefined {
  if (!object.bga) return undefined
Severity: Minor
Found in packages/bemuse-indexer/src/bmson-bga.ts - About 25 mins to fix

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 match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function match(text: string) {
  let matched = false
  return {
    when: function (
      pattern: RegExp,
Severity: Minor
Found in packages/bms/src/util/match.ts - About 25 mins to fix

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 getReleaseChangelog has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function getReleaseChangelog(changelog, version) {
  const lines = changelog.split('\n')
  /** @type {string[] | undefined} */
  let output
  for (const line of lines) {
Severity: Minor
Found in build-scripts/lib/changelog.js - About 25 mins to fix

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 hasScratch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function hasScratch(chart: BMSChart) {
  const objects = chart.objects.all()
  for (let i = 0; i < objects.length; i++) {
    const object = objects[i]
    let channel = +object.channel
Severity: Minor
Found in packages/bemuse-indexer/src/index.ts - About 25 mins to fix

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 lcs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function lcs(a: string, b: string) {
  let max = ''
  for (let i = 0; i < a.length; i++) {
    for (let j = 0; j < b.length; j++) {
      const cur = lcp(a, i, b, j)
Severity: Minor
Found in packages/bemuse-indexer/src/lcs.ts - About 25 mins to fix

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 runMocha has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function runMocha() {
  const specs = []
  mocha
    .run()
    .on('test end', function reportFailedSpec(test) {
Severity: Minor
Found in bemuse/src/test/index.js - About 25 mins to fix

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 MusicListItemChart has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const MusicListItemChart = ({
  chart,
  selected,
  onClick,
}: MusicListItemChartProps) => {
Severity: Minor
Found in bemuse/src/app/ui/MusicListItemChart.tsx - About 25 mins to fix

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 GameShellScene has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const GameShellScene = ({
  options: initOptions,
  play,
}: GameShellSceneProps) => {
  const [options, setOptions] = useState(initOptions)
Severity: Minor
Found in bemuse/src/game/ui/GameShellScene.tsx - About 25 mins to fix

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 Row has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const Row = ({
  text,
  data,
  options = {},
}: {
Severity: Minor
Found in bemuse/src/app/ui/ResultDeltasView.tsx - About 25 mins to fix

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 ModeSelectScene has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const ModeSelectScene = () => {
  const sceneManager = useContext(SceneManagerContext)
  const dispatch = useDispatch()
  const playDevice = useRef<PlayDevice>(null)

Severity: Minor
Found in bemuse/src/app/ui/ModeSelectScene.tsx - About 25 mins to fix

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 Yours has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const Yours = ({
  state,
  onResubmitScoreRequest,
  showPopup,
}: {
Severity: Minor
Found in bemuse/src/app/ui/Ranking.tsx - About 25 mins to fix

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 MusicInfoTabStats has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const MusicInfoTabStats = ({ chart }: MusicInfoTabStatsProps) => {
  const user = useCurrentUser()
  const [loading, record] = usePersonalRecord(chart)
  return (
    <div className='MusicInfoTabStats'>
Severity: Minor
Found in bemuse/src/app/ui/MusicInfoTabStats.tsx - About 25 mins to fix

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 OptionsInputField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const OptionsInputField = <T,>(
  props: OptionsInputFieldProps<T> &
    Omit<ComponentProps<'input'>, keyof OptionsInputFieldProps<T>>
) => {
  const { stringify, parse, onChange, validator, value } = props
Severity: Minor
Found in bemuse/src/app/ui/OptionsInputField.tsx - About 25 mins to fix

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

Severity
Category
Status
Source
Language