DeflatedPickle/FAOSDance

View on GitHub
src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt

Summary

Maintainability
F
4 days
Test Coverage

Method paintComponent has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    override fun paintComponent(g: Graphics) {
        super.paintComponent(g)

        if (GlobalValues.sheet == null) return

Severity: Major
Found in src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt - About 4 hrs to fix

    Method paintComponent has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring.
    Open

        override fun paintComponent(g: Graphics) {
            super.paintComponent(g)
    
            if (GlobalValues.sheet == null) return
    
    
    Severity: Minor
    Found in src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt - About 3 hrs 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 2 locations. Consider refactoring.
    Open

            g2D.scale(GlobalValues.optionsMap.getMap("sprite")!!.getMap("size")!!.getOption<Double>("width")!!, GlobalValues.optionsMap.getMap("sprite")!!.getMap("size")!!.getOption<Double>("height")!!)
    src/main/kotlin/com/deflatedpickle/faosdance/main.kt on lines 69..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 185.

    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.height - GlobalValues.sheet!!.spriteHeight * GlobalValues.optionsMap.getMap("sprite")!!.getMap("size")!!.getOption<Double>("height")!!) / 2
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 96..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 134.

    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.width - GlobalValues.sheet!!.spriteWidth * GlobalValues.optionsMap.getMap("sprite")!!.getMap("size")!!.getOption<Double>("width")!!) / 2,
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 97..97

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

    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

            GlobalValues.timer = Timer(1000 / GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.getOption<Int>("fps")!!, ActionListener {
    src/main/kotlin/com/deflatedpickle/faosdance/gui/settings/general/AnimationCategory.kt on lines 66..66

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

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

                            val frame = GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.getOption<Int>("frame")!!
    src/main/kotlin/com/deflatedpickle/faosdance/gui/ApplicationWindow.kt on lines 50..50
    src/main/kotlin/com/deflatedpickle/faosdance/gui/ApplicationWindow.kt on lines 53..53
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 44..44

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

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

                            val frame = GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.getOption<Int>("frame")!!
    src/main/kotlin/com/deflatedpickle/faosdance/gui/ApplicationWindow.kt on lines 50..50
    src/main/kotlin/com/deflatedpickle/faosdance/gui/ApplicationWindow.kt on lines 53..53
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 37..37

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

    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<Boolean>("rewind")!!) {
    Severity: Minor
    Found in src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt and 1 other location - About 55 mins to fix
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 35..35

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

    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.mutableSprite = GlobalValues.sheet!!.spriteMap[GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.getOption<String>("action")!!]!![GlobalValues.optionsMap.getMap("sprite")!!.getMap("animation")!!.getOption<Int>("frame")!!]
    Severity: Minor
    Found in src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt and 1 other location - About 55 mins to fix
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 55..55

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

    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<Boolean>("play")!!) {
    Severity: Minor
    Found in src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt and 1 other location - About 55 mins to fix
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 36..36

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

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

                for (i in RubyThread.extensions) {
                    if (GlobalValues.isEnabled(i)) {
                        RubyThread.rubyContainer.callMethod(i, "post_draw_sprite", g2D)
                    }
                }
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 78..82
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 119..123
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 130..134
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 163..167
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 175..179
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 195..199
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 202..206

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

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

                for (i in RubyThread.extensions) {
                    if (GlobalValues.isEnabled(i)) {
                        RubyThread.rubyContainer.callMethod(i, "pre_draw_sprite", spriteGraphics)
                    }
                }
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 78..82
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 130..134
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 139..143
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 163..167
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 175..179
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 195..199
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 202..206

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

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

            for (i in RubyThread.extensions) {
                if (GlobalValues.isEnabled(i)) {
                    RubyThread.rubyContainer.callMethod(i, "pre_draw", g2D)
                }
            }
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 119..123
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 130..134
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 139..143
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 163..167
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 175..179
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 195..199
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 202..206

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

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

                for (i in RubyThread.extensions) {
                    if (GlobalValues.isEnabled(i)) {
                        RubyThread.rubyContainer.callMethod(i, "during_draw_reflection", reflectionGraphics)
                    }
                }
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 78..82
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 119..123
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 130..134
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 139..143
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 163..167
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 195..199
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 202..206

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

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

                for (i in RubyThread.extensions) {
                    if (GlobalValues.isEnabled(i)) {
                        RubyThread.rubyContainer.callMethod(i, "during_draw_sprite", spriteGraphics)
                    }
                }
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 78..82
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 119..123
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 139..143
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 163..167
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 175..179
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 195..199
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 202..206

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

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

                for (i in RubyThread.extensions) {
                    if (GlobalValues.isEnabled(i)) {
                        RubyThread.rubyContainer.callMethod(i, "post_draw_reflection", g2D)
                    }
                }
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 78..82
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 119..123
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 130..134
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 139..143
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 163..167
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 175..179
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 202..206

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

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

                for (i in RubyThread.extensions) {
                    if (GlobalValues.isEnabled(i)) {
                        RubyThread.rubyContainer.callMethod(i, "pre_draw_reflection", reflectionGraphics)
                    }
                }
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 78..82
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 119..123
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 130..134
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 139..143
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 175..179
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 195..199
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 202..206

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

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

            for (i in RubyThread.extensions) {
                if (GlobalValues.isEnabled(i)) {
                    RubyThread.rubyContainer.callMethod(i, "post_draw", g2D)
                }
            }
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 78..82
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 119..123
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 130..134
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 139..143
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 163..167
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 175..179
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 195..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 83.

    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

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

            if (GlobalValues.optionsMap.getMap("reflection")!!.getOption<Boolean>("visible")!!) {
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 111..111
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 155..155
    src/main/kotlin/com/deflatedpickle/faosdance/main.kt on lines 71..71

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

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

            if (GlobalValues.optionsMap.getMap("sprite")!!.getOption<Boolean>("visible")!!) {
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 101..101
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 155..155
    src/main/kotlin/com/deflatedpickle/faosdance/main.kt on lines 71..71

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

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

            if (GlobalValues.optionsMap.getMap("reflection")!!.getOption<Boolean>("visible")!!) {
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 101..101
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 111..111
    src/main/kotlin/com/deflatedpickle/faosdance/main.kt on lines 71..71

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

    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

                val sprite = BufferedImage(
                    GlobalValues.sheet!!.spriteWidth,
                    GlobalValues.sheet!!.spriteHeight,
                    BufferedImage.TYPE_INT_ARGB
                )
    Severity: Minor
    Found in src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt and 1 other location - About 35 mins to fix
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 156..160

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

    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

                val reflection = BufferedImage(
                    GlobalValues.sheet!!.spriteWidth,
                    GlobalValues.sheet!!.spriteHeight,
                    BufferedImage.TYPE_INT_ARGB
                )
    Severity: Minor
    Found in src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt and 1 other location - About 35 mins to fix
    src/main/kotlin/com/deflatedpickle/faosdance/gui/SpritePanel.kt on lines 112..116

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

    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