bemusic/bemuse

View on GitHub
bemuse/src/online/index.spec.js

Summary

Maintainability
F
3 days
Test Coverage

Function tests has 323 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function tests(onlineServiceOptions) {
  const storage = {
    map: new Map(),
    getItem(key) {
      return this.map.get(key) ?? null
Severity: Major
Found in bemuse/src/online/index.spec.js - About 1 day to fix

    File index.spec.js has 361 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { filter, first, firstValueFrom } from 'rxjs'
    
    import Online from '.'
    import OnlineService from './scoreboard-system/OnlineService'
    import assert from 'power-assert'
    Severity: Minor
    Found in bemuse/src/online/index.spec.js - About 4 hrs to fix

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

              step('submit score2...', function () {
                return online.submitScore({
                  md5: prefix + 'song1',
                  playMode: 'BM',
                  score: 555555,
      Severity: Major
      Found in bemuse/src/online/index.spec.js and 1 other location - About 1 hr to fix
      bemuse/src/online/index.spec.js on lines 261..271

      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 70.

      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 2 locations. Consider refactoring.
      Open

              step('submit score1...', function () {
                return online.submitScore({
                  md5: prefix + 'song1',
                  playMode: 'BM',
                  score: 222222,
      Severity: Major
      Found in bemuse/src/online/index.spec.js and 1 other location - About 1 hr to fix
      bemuse/src/online/index.spec.js on lines 275..285

      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 70.

      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 5 locations. Consider refactoring.
      Open

                const record = await online.submitScore({
                  md5: prefix + 'song',
                  playMode: 'KB',
                  score: 123210,
                  combo: 124,
      Severity: Major
      Found in bemuse/src/online/index.spec.js and 4 other locations - About 1 hr to fix
      bemuse/src/online/index.spec.js on lines 158..166
      bemuse/src/online/index.spec.js on lines 176..184
      bemuse/src/online/index.spec.js on lines 194..202
      bemuse/src/online/index.spec.js on lines 228..236

      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 63.

      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 5 locations. Consider refactoring.
      Open

                const record = await online.submitScore({
                  md5: prefix + 'song',
                  playMode: 'BM',
                  score: 123210,
                  combo: 124,
      Severity: Major
      Found in bemuse/src/online/index.spec.js and 4 other locations - About 1 hr to fix
      bemuse/src/online/index.spec.js on lines 158..166
      bemuse/src/online/index.spec.js on lines 176..184
      bemuse/src/online/index.spec.js on lines 194..202
      bemuse/src/online/index.spec.js on lines 212..220

      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 63.

      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 5 locations. Consider refactoring.
      Open

                  const record = await online.submitScore({
                    md5: prefix + 'song',
                    playMode: 'BM',
                    score: 123210,
                    combo: 124,
      Severity: Major
      Found in bemuse/src/online/index.spec.js and 4 other locations - About 1 hr to fix
      bemuse/src/online/index.spec.js on lines 158..166
      bemuse/src/online/index.spec.js on lines 194..202
      bemuse/src/online/index.spec.js on lines 212..220
      bemuse/src/online/index.spec.js on lines 228..236

      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 63.

      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 5 locations. Consider refactoring.
      Open

                const record = await online.submitScore({
                  md5: prefix + 'song',
                  playMode: 'BM',
                  score: 555555,
                  combo: 456,
      Severity: Major
      Found in bemuse/src/online/index.spec.js and 4 other locations - About 1 hr to fix
      bemuse/src/online/index.spec.js on lines 158..166
      bemuse/src/online/index.spec.js on lines 176..184
      bemuse/src/online/index.spec.js on lines 212..220
      bemuse/src/online/index.spec.js on lines 228..236

      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 63.

      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 5 locations. Consider refactoring.
      Open

                const record = await online.submitScore({
                  md5: prefix + 'song',
                  playMode: 'BM',
                  score: 123456,
                  combo: 123,
      Severity: Major
      Found in bemuse/src/online/index.spec.js and 4 other locations - About 1 hr to fix
      bemuse/src/online/index.spec.js on lines 176..184
      bemuse/src/online/index.spec.js on lines 194..202
      bemuse/src/online/index.spec.js on lines 212..220
      bemuse/src/online/index.spec.js on lines 228..236

      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 63.

      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 2 locations. Consider refactoring.
      Open

                return when(
                  (state) =>
                    state.meta.scoreboard.status === 'completed' &&
                    state.meta.submission.status === 'completed'
                ).then(function (state) {
      Severity: Minor
      Found in bemuse/src/online/index.spec.js and 1 other location - About 45 mins to fix
      bemuse/src/online/index.spec.js on lines 320..326

      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 50.

      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 2 locations. Consider refactoring.
      Open

                return when(
                  (state) =>
                    state.meta.scoreboard.status === 'completed' &&
                    state.meta.submission.status === 'unauthenticated'
                ).then((state) => {
      Severity: Minor
      Found in bemuse/src/online/index.spec.js and 1 other location - About 45 mins to fix
      bemuse/src/online/index.spec.js on lines 358..365

      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 50.

      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

      There are no issues that match your filters.

      Category
      Status