Showing 47 of 178 total issues
File GlobalValues.kt
has 499 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.deflatedpickle.faosdance.util
import com.deflatedpickle.faosdance.*
import com.deflatedpickle.faosdance.backend.Direction
import com.deflatedpickle.faosdance.backend.NestedHashMap
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
Method addComponentRangeSliderSpinner
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
inline fun <reified T : Number> addComponentRangeSliderSpinner(
parent: Container,
gridBagLayout: GridBagLayout,
component: JComponent,
highValue: Number,
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
- Read upRead up
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
Method settings
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
def settings(panel)
@red_widgets = FAOSDanceSettings.createOptionInteger panel, "Red:", @default, 255, 0.0
@red_widgets.third.addChangeListener {|it|
@red = it.source.to_java(javax::swing::JSpinner).model.value.to_java(java::lang::Float).intValue
GlobalValues.setOption "colour_overlay-red", @red
Method addComponentSliderSpinner
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
inline fun <reified T : Number> addComponentSliderSpinner(
parent: Container,
gridBagLayout: GridBagLayout,
component: JComponent,
defaultValue: Number,
Method paintBorder
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
override fun paintBorder(
c: Component,
g: Graphics,
x: Int, y: Int,
width: Int, height: Int
Method post_draw_sprite
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def post_draw_sprite(graphics)
if @future_frame_amount > 0
for i in 0..@future_frame_amount
frame = GlobalValues.getOption "sprite.animation.frame"
action = GlobalValues.getOption "sprite.animation.action"
- Read upRead up
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
Method pre_draw_sprite
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def pre_draw_sprite(graphics)
if @past_frame_amount > 0
for i in 0..@past_frame_amount
frame = GlobalValues.getOption "sprite.animation.frame"
action = GlobalValues.getOption "sprite.animation.action"
- Read upRead up
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
Method createEnviromentFiles
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
fun createEnviromentFiles() {
homePath?.mkdir()
// It's a loop in case I decide to add more user folders, or move the lang folder out of the program
for (i in listOf(
- Read upRead up
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
Method main
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
@Suppress("KDocMissingDocumentation")
fun main() {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
if (UpdateUtil.isOutdated) {
- Read upRead up
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
Method main
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Suppress("KDocMissingDocumentation")
fun main() {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
if (UpdateUtil.isOutdated) {
Method paintBorder
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void paintBorder(Component c, Graphics g, int x, int y, int width,
int height) {
Rectangle borderR = new Rectangle(x + EDGE_SPACING, y + EDGE_SPACING,
width - (EDGE_SPACING * 2), height - (EDGE_SPACING * 2));
Insets borderInsets;
Method getComponentRect
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Rectangle getComponentRect(Rectangle rect, Insets borderInsets) {
Dimension compD = component.getPreferredSize();
Rectangle compR = new Rectangle(0, 0, compD.width, compD.height);
switch (titlePosition) {
case ABOVE_TOP:
Method settings
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def settings(panel)
shake_amount_widgets = FAOSDanceSettings.createOptionInteger(panel, "Shake Amount:", @amount, 42, 1)
grid_settings = GridBagConstraints.new GridBagConstraints::RELATIVE, GridBagConstraints::RELATIVE,
2, 1,
Method loadSpriteSheet
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
fun loadSpriteSheet(file: File) {
var path = ""
var image: InputStream? = null
var text: InputStream? = null
Method settings
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def settings(panel)
box_blur_border = FAOSDanceSettings.createBorderPanel panel, "Box Blur", true
box_blur_border.titleComponent.addActionListener {|it|
@box_blur_enabled = it.source.to_java(javax::swing::JCheckBox).isSelected
if @enabled
Method addComponentRangeSliderSpinner
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
inline fun <reified T : Number> addComponentRangeSliderSpinner(
parent: Container,
gridBagLayout: GridBagLayout,
component: JComponent,
highValue: Number,
- Read upRead up
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
Method settings
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def settings(panel)
grid_settings = GridBagConstraints.new GridBagConstraints::RELATIVE, GridBagConstraints::RELATIVE,
1, 1,
0.0, 0.0,
GridBagConstraints::EAST, GridBagConstraints::NONE,
Method getBorderInsets
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Insets getBorderInsets(Component c, Insets insets) {
Insets borderInsets;
if (border != null) {
borderInsets = border.getBorderInsets(c);
} else {