bemusic/bemuse

View on GitHub

Showing 508 of 508 total issues

Function show has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function show(message, e, url, line, col) {
Severity: Minor
Found in bemuse/src/boot/ui/ErrorDialog.js - About 35 mins to fix

    Function createNotechartPreview has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      notechart: Notechart,
      filename: string,
      samplingMaster: SamplingMaster,
      soundGroup: SoundGroup,
      samples: PreviewSoundSample[]
    Severity: Minor
    Found in bemuse/src/previewer/NotechartPreview.ts - About 35 mins to fix

      Function describeArc has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        x: number,
        y: number,
        radius: number,
        startAngle: number,
        endAngle: number
      Severity: Minor
      Found in bemuse/src/previewer/BarDot.tsx - About 35 mins to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

          await expect
            .poll(() => page.evaluate(() => navigator.serviceWorker.controller?.state))
            .toBe('activated')
        Severity: Minor
        Found in e2e/tests/gameplay.spec.ts and 1 other location - About 35 mins to fix
        e2e/tests/project-site.spec.ts on lines 21..23

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 47.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

          await expect
            .poll(() => page.evaluate(() => navigator.serviceWorker.controller?.state))
            .toBe('activated')
        Severity: Minor
        Found in e2e/tests/project-site.spec.ts and 1 other location - About 35 mins to fix
        e2e/tests/gameplay.spec.ts on lines 105..107

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 47.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function __createBinding has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
            if (k2 === undefined) k2 = k;
            var desc = Object.getOwnPropertyDescriptor(m, k);
            if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
              desc = { enumerable: true, get: function() { return m[k]; } };
        Severity: Minor
        Found in common/scripts/install-run.js - About 35 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 __createBinding has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
            if (k2 === undefined) k2 = k;
            var desc = Object.getOwnPropertyDescriptor(m, k);
            if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
              desc = { enumerable: true, get: function() { return m[k]; } };
        Severity: Minor
        Found in common/scripts/install-run-rush.js - About 35 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 go has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        async function go(loader, element) {
          const master = new SamplingMaster(ctx)
          const $log = element.find('.js-log')
          const $play = element.find('.js-play').hide()
          const $sampler = element.find('.js-sampler')
        Severity: Minor
        Found in bemuse/src/coming-soon/demo/index.js - About 35 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 add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          add(object: BMSObject) {
            if (object.channel !== '01') {
              for (let i = 0; i < this._objects.length; i++) {
                const test = this._objects[i]
                if (
        Severity: Minor
        Found in packages/bms/src/bms/objects.ts - About 35 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 judgeTimeWith has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export function judgeTimeWith(f: (timegate: Timegate) => number) {
          return function judgeTimeWithF(
            gameTime: number,
            noteTime: number,
            judge: IJudge = NORMAL_JUDGE
        Severity: Minor
        Found in bemuse/src/game/judgments.ts - About 35 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 main has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export async function main(bootContext: {
          setStatus: (status: string) => void
        }) {
          bootContext.setStatus('Loading song')
          const state口 = new Subject<ExperimentState>()
        Severity: Minor
        Found in bemuse/src/auto-synchro/index.tsx - About 35 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 update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          update() {
            const changes = new Map()
            for (const [name, control] of this._controls) {
              void name
              control.changed = false
        Severity: Minor
        Found in bemuse/src/game/input/index.ts - About 35 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 getToolbarItems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const getToolbarItems = ({
          online,
          user,
          handleCustomBMSOpen,
          handleAuthenticate,
        Severity: Minor
        Found in bemuse/src/app/ui/MusicSelectScene.tsx - About 35 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 unarchive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export async function unarchive(file: File): Promise<FileEntry[]> {
          const out: FileEntry[] = []
          const archive = await Archive.open(file)
          const extracted = await archive.extractFiles()
          const traverse = (tree: any, prefix = '') => {
        Severity: Minor
        Found in bemuse/src/resources/unarchiver.ts - About 35 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 getJudgeForNotechart has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export function getJudgeForNotechart(
          notechart: Notechart,
          { tutorial = false }
        ): IJudge {
          const info = notechart.songInfo
        Severity: Minor
        Found in bemuse/src/game/judgments.ts - About 35 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 NewRankingContainer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        export const NewRankingContainer = ({
          chart,
          playMode,
          result,
        }: RankingContainerProps) => {
        Severity: Minor
        Found in bemuse/src/app/ui/RankingContainer.tsx - About 35 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 _updateSpeed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          _updateSpeed() {
            if (this.getPlayerInput('speedup').justPressed) {
              this._modifySpeed(+1)
            }
            if (this.getPlayerInput('speeddown').justPressed) {
        Severity: Minor
        Found in bemuse/src/game/state/player-state.ts - About 35 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 searchForChartFiles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        async function searchForChartFiles(
          directoryHandle: FileSystemDirectoryHandle,
          chartFileScanner: ChartFileScanner,
          io: CustomFolderScanIO,
          parentPath: string[] = []
        Severity: Minor
        Found in bemuse/src/custom-folder/index.ts - About 35 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

        Similar blocks of code found in 9 locations. Consider refactoring.
        Open

            it('zeroes out when user cannot attain A rank anymore', () => {
              const gauge = setup(449999, [40, 100])
              assert(gauge.getSecondary() === 0)
            })
        Severity: Major
        Found in bemuse/src/game/display/Gauge.spec.js and 8 other locations - About 35 mins to fix
        bemuse/src/game/display/Gauge.spec.js on lines 33..36
        bemuse/src/game/display/Gauge.spec.js on lines 37..40
        bemuse/src/game/display/Gauge.spec.js on lines 46..49
        bemuse/src/game/display/Gauge.spec.js on lines 52..55
        bemuse/src/game/display/Gauge.spec.js on lines 56..59
        bemuse/src/game/display/Gauge.spec.js on lines 66..69
        bemuse/src/game/display/Gauge.spec.js on lines 70..73
        bemuse/src/game/display/Gauge.spec.js on lines 74..77

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 46.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 9 locations. Consider refactoring.
        Open

            it('completely fills in if player finishes with ≥520000', () => {
              const gauge = setup(555555, [100, 100])
              assert(gauge.getPrimary() === 1)
            })
        Severity: Major
        Found in bemuse/src/game/display/Gauge.spec.js and 8 other locations - About 35 mins to fix
        bemuse/src/game/display/Gauge.spec.js on lines 33..36
        bemuse/src/game/display/Gauge.spec.js on lines 46..49
        bemuse/src/game/display/Gauge.spec.js on lines 52..55
        bemuse/src/game/display/Gauge.spec.js on lines 56..59
        bemuse/src/game/display/Gauge.spec.js on lines 60..63
        bemuse/src/game/display/Gauge.spec.js on lines 66..69
        bemuse/src/game/display/Gauge.spec.js on lines 70..73
        bemuse/src/game/display/Gauge.spec.js on lines 74..77

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 46.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language