DeflatedPickle/FAOSDance

View on GitHub

Showing 178 of 178 total issues

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

        optionsMap.getMap("window")!!.getMap("location")!!["y"] = effectiveSize!!.height / 2
src/main/kotlin/com/deflatedpickle/faosdance/util/GlobalValues.kt on lines 193..193

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

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

                GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.setOption("play", this.isSelected)
src/main/kotlin/com/deflatedpickle/faosdance/gui/settings/general/AnimationCategory.kt on lines 87..87

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

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

                GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.setOption("rewind", this.isSelected)
src/main/kotlin/com/deflatedpickle/faosdance/gui/settings/general/AnimationCategory.kt on lines 78..78

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

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

            selectedIndex = scalingValues.indexOf(GlobalValues.optionsMap.getMap("sprite")!!.getOption<String>("scaling_type")!!)
src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 71..72

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

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

            GlobalValues.unsanatizeEnumValue(
                GlobalValues.optionsMap.getMap("sprite")!!.getOption<String>("scaling_type")!!))) {
Severity: Minor
Found in src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt and 1 other location - About 45 mins to fix
src/main/kotlin/com/deflatedpickle/faosdance/gui/settings/general/SpriteCategory.kt on lines 166..166

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

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

                        if (GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.getOption<Int>("frame")!! >= 8) {
                            GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.setOption("frame", 0)
                        }
Severity: Minor
Found in src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt and 1 other location - About 45 mins to fix
src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 40..42

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

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

                        if (GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.getOption<Int>("frame")!! <= 0) {
                            GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.setOption("frame", 7)
                        }
Severity: Minor
Found in src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt and 1 other location - About 45 mins to fix
src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 47..49

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

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

Method addComponentSliderSpinner has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        parent: Container,
        gridBagLayout: GridBagLayout,
        component: JComponent,
        defaultValue: Number,
        maxNumber: Number,
Severity: Minor
Found in src/main/kotlin/com/deflatedpickle/faosdance/util/GlobalValues.kt - About 45 mins to fix

    Method createOptionRangeDouble has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static Triple<JButton, RangeSlider, Pair<JSpinner, JSpinner>> createOptionRangeDouble(Container parent, String name, Double highNumber, Double lowNumber, Double maxNumber, Double minNumber) {
    Severity: Minor
    Found in src/main/java/com/deflatedpickle/faosdance/FAOSDanceSettings.java - About 45 mins to fix

      Method pre_draw has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def pre_draw(graphics)
          if @wait > 0.0
            @wait -= 1
            @progress_bar.setValue @wait
          else
      Severity: Minor
      Found in src/main/resources/scripts/auto_action_extension.rb - About 45 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

      Avoid deeply nested control flow statements.
      Open

                                  for (ch in c.panel.components) {
                                      ch.isEnabled = false
                                  }

        Method addLabelSliderSpinnerInteger has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                parent: Container,
                gridBagLayout: GridBagLayout,
                name: String,
                defaultValue: Int,
                maxNumber: Int,
        Severity: Minor
        Found in src/main/kotlin/com/deflatedpickle/faosdance/util/GlobalValues.kt - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if (!fileList.contains(name)) {
                                          File(i, name).apply {
                                              this.createNewFile()
                                              Files.write(this.toPath(), text)
                                          }
          Severity: Major
          Found in src/main/kotlin/com/deflatedpickle/faosdance/util/GlobalValues.kt - About 45 mins to fix

            Method paintBorder has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    c: Component,
                    g: Graphics,
                    x: Int, y: Int,
                    width: Int, height: Int

              Method paintBorder has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public void paintBorder(Component c, Graphics g, int x, int y, int width,
                                          int height) {

                Method createOptionRangeInteger has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static Triple<JButton, RangeSlider, Pair<JSpinner, JSpinner>> createOptionRangeInteger(Container parent, String name, Double highNumber, Double lowNumber, Double maxNumber, Double minNumber) {
                Severity: Minor
                Found in src/main/java/com/deflatedpickle/faosdance/FAOSDanceSettings.java - About 45 mins to fix

                  Method addLabelSliderSpinnerDouble has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          parent: Container,
                          gridBagLayout: GridBagLayout,
                          name: String,
                          defaultValue: Double,
                          maxNumber: Double,
                  Severity: Minor
                  Found in src/main/kotlin/com/deflatedpickle/faosdance/util/GlobalValues.kt - About 45 mins to fix

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

                                            if (image == null && i.name == "$name.png") {
                                                image = zipFile.getInputStream(i)
                                            }
                    src/main/kotlin/com/deflatedpickle/faosdance/gui/settings/general/SpriteCategory.kt on lines 54..56

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

                    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

                                            if (text == null && i.name == "$name.txt") {
                                                text = zipFile.getInputStream(i)
                                            }
                    src/main/kotlin/com/deflatedpickle/faosdance/gui/settings/general/SpriteCategory.kt on lines 50..52

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

                    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.addWindowListener(object : WindowAdapter() {
                                override fun windowClosed(e: WindowEvent) {
                                    GlobalValues.settingsDialog = null
                                }
                            })
                    src/main/kotlin/com/deflatedpickle/faosdance/autoupdate/UpdateDialog.kt on lines 92..96

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

                    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