galarant/domless

View on GitHub

Showing 122 of 124 total issues

Function addHeader has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  addHeader() {
    let
      xPos = 0,
      yPos = 0

Severity: Minor
Found in src/components/input/form_drawer.js - About 1 hr to fix

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

  constructor(
    scene,
    {
      x, y,
      width=400, height=400,
Severity: Minor
Found in src/components/display/dialogue.js - About 1 hr to fix

Function activate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  activate() {
    if (this.inputField) {
      let tweenTimeline = this.tweens.timeline({
        duration: 500,
        ease: Phaser.Math.Easing.Cubic.InOut,
Severity: Minor
Found in src/components/input/input_modal.js - About 1 hr to fix

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

      this.content = this.scene.add.text(-this.width / 2, -this.height / 2, "", this.styles)
Severity: Major
Found in src/components/display/text_display.js and 2 other locations - About 55 mins to fix
src/components/input/dropdown_field.js on lines 127..127
src/components/input/text_field.js on lines 112..112

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

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

      this.cursor = this.scene.add.text(-this.width / 2, -this.height / 2, "_", this.styles)
Severity: Major
Found in src/components/input/text_field.js and 2 other locations - About 55 mins to fix
src/components/display/text_display.js on lines 100..100
src/components/input/dropdown_field.js on lines 127..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 54.

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

      this.selectedOptionElement = this.scene.add.text(-this.width / 2, -this.height / 2, "", this.styles)
Severity: Major
Found in src/components/input/dropdown_field.js and 2 other locations - About 55 mins to fix
src/components/display/text_display.js on lines 100..100
src/components/input/text_field.js on lines 112..112

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

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

  addText(extraText, keyCode) {

    this.pageDownButton.deactivate(true)

    if (keyCode === Phaser.Input.Keyboard.KeyCodes.BACKSPACE) {
Severity: Minor
Found in src/components/input/text_field.js - About 55 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 handleGameObjectUp has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  handleGameObjectUp(pointer, currentlyOver, event) {
    // don't bother with the rest if I have no handlers
    if (!this.handleGameObjectUpIn && !this.handleGameObjectUpOut) {
      return
    }
Severity: Minor
Found in src/components/element.js - About 55 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 deactivate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  deactivate(hide=false, disableInteractive=false, force=false) {
    if (this.active || force) {
      // hide the element if desired
      if (hide) {
        this.setAlpha(0)
Severity: Minor
Found in src/components/element.js - About 55 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 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(
        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

  get lastField() {
    if (this.fields.length) {
      return this.fields[this.fields.length - 1]
    } else {
      return null
Severity: Minor
Found in src/components/input/form.js and 1 other location - About 55 mins to fix
src/components/input/form.js on lines 196..202

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

  get lastRow() {
    if (this.rows.length) {
      return this.rows[this.rows.length - 1]
    } else {
      return null
Severity: Minor
Found in src/components/input/form.js and 1 other location - About 55 mins to fix
src/components/input/form.js on lines 234..240

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(
        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

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

    _.forEach(this.updateOn, (key) => { this.updateTriggers.push({[key]: _.get(this, key)}) })
Severity: Minor
Found in src/components/element.js and 1 other location - About 50 mins to fix
src/components/element.js on lines 111..111

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

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

      _.forEach(this.updateOn, (key) => { this.updateTriggers.push({[key]: _.get(this, key)}) })
Severity: Minor
Found in src/components/element.js and 1 other location - About 50 mins to fix
src/components/element.js on lines 92..92

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

Severity
Category
Status
Source
Language