galarant/domless

View on GitHub
src/components/input/keyboard.js

Summary

Maintainability
F
1 wk
Test Coverage

Function constructor has 288 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  constructor(
    scene,
    {
      x=scene.game.config.width/2,
      y=scene.game.config.height/2,
Severity: Major
Found in src/components/input/keyboard.js - About 1 day to fix

File keyboard.js has 365 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Phaser from "phaser"
import Button from "./button"
import _ from "lodash"

/**
Severity: Minor
Found in src/components/input/keyboard.js - About 4 hrs to fix

Function constructor has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(
    scene,
    {
      x=scene.game.config.width/2,
      y=scene.game.config.height/2,
Severity: Minor
Found in src/components/input/keyboard.js - About 1 hr 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 initializeKeys has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  initializeKeys(keyModeConfig) {
    let keyContainer = this.scene.add.container(0, 0)
    let keyConfigRowCounter = 0
    let keyboard = this
    this.add(keyContainer)
Severity: Minor
Found in src/components/input/keyboard.js - About 1 hr to fix

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

    let numberRowConfig = [
      ["1", Phaser.Input.Keyboard.KeyCodes.ONE],
      ["2", Phaser.Input.Keyboard.KeyCodes.TWO],
      ["3", Phaser.Input.Keyboard.KeyCodes.THREE],
      ["4", Phaser.Input.Keyboard.KeyCodes.FOUR],
Severity: Major
Found in src/components/input/keyboard.js and 2 other locations - About 1 day to fix
src/components/input/keyboard.js on lines 94..105
src/components/input/keyboard.js on lines 129..140

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

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

    let lowercaseLettersRowOneConfig = [
      ["q", Phaser.Input.Keyboard.KeyCodes.Q],
      ["w", Phaser.Input.Keyboard.KeyCodes.W],
      ["e", Phaser.Input.Keyboard.KeyCodes.E],
      ["r", Phaser.Input.Keyboard.KeyCodes.R],
Severity: Major
Found in src/components/input/keyboard.js and 2 other locations - About 1 day to fix
src/components/input/keyboard.js on lines 81..92
src/components/input/keyboard.js on lines 129..140

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

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

    let uppercaseLettersRowOneConfig = [
      ["Q", Phaser.Input.Keyboard.KeyCodes.Q],
      ["W", Phaser.Input.Keyboard.KeyCodes.W],
      ["E", Phaser.Input.Keyboard.KeyCodes.E],
      ["R", Phaser.Input.Keyboard.KeyCodes.R],
Severity: Major
Found in src/components/input/keyboard.js and 2 other locations - About 1 day to fix
src/components/input/keyboard.js on lines 81..92
src/components/input/keyboard.js on lines 94..105

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

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

    let uppercaseLettersRowTwoConfig = [
      ["A", Phaser.Input.Keyboard.KeyCodes.A],
      ["S", Phaser.Input.Keyboard.KeyCodes.S],
      ["D", Phaser.Input.Keyboard.KeyCodes.D],
      ["F", Phaser.Input.Keyboard.KeyCodes.F],
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 7 hrs to fix
src/components/input/keyboard.js on lines 107..117

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

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

    let lowercaseLettersRowTwoConfig = [
      ["a", Phaser.Input.Keyboard.KeyCodes.A],
      ["s", Phaser.Input.Keyboard.KeyCodes.S],
      ["d", Phaser.Input.Keyboard.KeyCodes.D],
      ["f", Phaser.Input.Keyboard.KeyCodes.F],
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 7 hrs to fix
src/components/input/keyboard.js on lines 142..152

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

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

    let mobileLowercaseConfig = [
      numberRowConfig,
      lowercaseLettersRowOneConfig,
      lowercaseLettersRowTwoConfig,
      _.concat(
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 5 hrs to fix
src/components/input/keyboard.js on lines 183..199

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

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

    let mobileUppercaseConfig = [
      numberRowConfig,
      uppercaseLettersRowOneConfig,
      uppercaseLettersRowTwoConfig,
      _.concat(
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 5 hrs to fix
src/components/input/keyboard.js on lines 165..181

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

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

    let uppercaseLettersRowThreeConfig = [
      ["Z", Phaser.Input.Keyboard.KeyCodes.Z],
      ["X", Phaser.Input.Keyboard.KeyCodes.X],
      ["C", Phaser.Input.Keyboard.KeyCodes.C],
      ["V", Phaser.Input.Keyboard.KeyCodes.V],
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 5 hrs to fix
src/components/input/keyboard.js on lines 119..127

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

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

    let lowercaseLettersRowThreeConfig = [
      ["z", Phaser.Input.Keyboard.KeyCodes.Z],
      ["x", Phaser.Input.Keyboard.KeyCodes.X],
      ["c", Phaser.Input.Keyboard.KeyCodes.C],
      ["v", Phaser.Input.Keyboard.KeyCodes.V],
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 5 hrs to fix
src/components/input/keyboard.js on lines 154..162

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

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

      [
        ["|", Phaser.Input.Keyboard.KeyCodes.BACK_SLASH, 1.5],
        ["<", Phaser.Input.Keyboard.KeyCodes.COMMA],
        ["", Phaser.Input.Keyboard.KeyCodes.SPACE, 4, " "],
        [">", Phaser.Input.Keyboard.KeyCodes.PERIOD],
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 3 hrs to fix
src/components/input/keyboard.js on lines 269..275

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

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

      [
        ["\\", Phaser.Input.Keyboard.KeyCodes.BACK_SLASH, 1.5],
        [",", Phaser.Input.Keyboard.KeyCodes.COMMA],
        ["", Phaser.Input.Keyboard.KeyCodes.SPACE, 4, " "],
        [".", Phaser.Input.Keyboard.KeyCodes.PERIOD],
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 3 hrs to fix
src/components/input/keyboard.js on lines 309..315

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

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

      _.concat(
        [["\u21E7", Phaser.Input.Keyboard.KeyCodes.CAPS_LOCK, 1.5, "", false, desktopCapsButtonCallback, keyboard]], // unicode uppercase arrow white
        lowercaseLettersRowThreeConfig,
        [["/", Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH]],
        [["\u232B", Phaser.Input.Keyboard.KeyCodes.BACKSPACE, 1.5]] // unicode backspace symbol
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 2 hrs to fix
src/components/input/keyboard.js on lines 303..308

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

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

      _.concat(
        [["\u2B06", Phaser.Input.Keyboard.KeyCodes.CAPS_LOCK, 1.5, "", false, desktopCapsButtonCallback, keyboard]], // unicode uppercase arrow white
        uppercaseLettersRowThreeConfig,
        [["?", Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH]],
        [["\u232B", Phaser.Input.Keyboard.KeyCodes.BACKSPACE, 1.5]] // unicode backspace symbol
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 2 hrs to fix
src/components/input/keyboard.js on lines 263..268

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

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

      this.scene.input.keyboard.on("keydown_SHIFT", function() {
        if (this.mode !== "desktopuppercase" && !this.capslock) {
          this.setMode("desktopuppercase")
        }
      }, this)
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 1 hr to fix
src/components/input/keyboard.js on lines 345..349

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

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

      this.scene.input.keyboard.on("keyup_SHIFT", function() {
        if (this.mode !== "desktoplowercase" && !this.capslock) {
          this.setMode("desktoplowercase")
        }
      }, this)
Severity: Major
Found in src/components/input/keyboard.js and 1 other location - About 1 hr to fix
src/components/input/keyboard.js on lines 339..343

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

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

      _.concat(
        uppercaseLettersRowTwoConfig,
        [[":", Phaser.Input.Keyboard.KeyCodes.SEMICOLON]],
        [["\"", Phaser.Input.Keyboard.KeyCodes.QUOTES]]
      ),
Severity: Major
Found in src/components/input/keyboard.js and 4 other locations - About 55 mins to fix
src/components/input/keyboard.js on lines 248..252
src/components/input/keyboard.js on lines 253..257
src/components/input/keyboard.js on lines 258..262
src/components/input/keyboard.js on lines 293..297

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

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

      _.concat(
        lowercaseLettersRowTwoConfig,
        [[";", Phaser.Input.Keyboard.KeyCodes.SEMICOLON]],
        [["'", Phaser.Input.Keyboard.KeyCodes.QUOTES]]
      ),
Severity: Major
Found in src/components/input/keyboard.js and 4 other locations - About 55 mins to fix
src/components/input/keyboard.js on lines 248..252
src/components/input/keyboard.js on lines 253..257
src/components/input/keyboard.js on lines 293..297
src/components/input/keyboard.js on lines 298..302

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

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

      _.concat(
        uppercaseLettersRowOneConfig,
        [["{", Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET]],
        [["}", Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET]]
      ),
Severity: Major
Found in src/components/input/keyboard.js and 4 other locations - About 55 mins to fix
src/components/input/keyboard.js on lines 248..252
src/components/input/keyboard.js on lines 253..257
src/components/input/keyboard.js on lines 258..262
src/components/input/keyboard.js on lines 298..302

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

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

      _.concat(
        numberRowConfig,
        [["-", Phaser.Input.Keyboard.KeyCodes.MINUS]],
        [["=", Phaser.Input.Keyboard.KeyCodes.PLUS]]
      ),
Severity: Major
Found in src/components/input/keyboard.js and 4 other locations - About 55 mins to fix
src/components/input/keyboard.js on lines 253..257
src/components/input/keyboard.js on lines 258..262
src/components/input/keyboard.js on lines 293..297
src/components/input/keyboard.js on lines 298..302

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

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

      _.concat(
        lowercaseLettersRowOneConfig,
        [["[", Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET]],
        [["]", Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET]]
      ),
Severity: Major
Found in src/components/input/keyboard.js and 4 other locations - About 55 mins to fix
src/components/input/keyboard.js on lines 248..252
src/components/input/keyboard.js on lines 258..262
src/components/input/keyboard.js on lines 293..297
src/components/input/keyboard.js on lines 298..302

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

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

    let mobileSymbolsButtonCallback = function() {
      if (this.mode === "mobilesymbols") {
        this.setMode("mobileuppercase")
      } else {
        this.setMode("mobilesymbols")
Severity: Minor
Found in src/components/input/keyboard.js and 1 other location - About 50 mins to fix
src/components/input/keyboard.js on lines 55..61

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

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

    let mobileCapsButtonCallback = function() {
      if (this.mode === "mobileuppercase") {
        this.setMode("mobilelowercase")
      } else {
        this.setMode("mobileuppercase")
Severity: Minor
Found in src/components/input/keyboard.js and 1 other location - About 50 mins to fix
src/components/input/keyboard.js on lines 63..69

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

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