Showing 47 of 178 total issues
Method createEnviromentFiles
has 36 lines of code (exceeds 25 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(
Method settings
has a Cognitive Complexity of 12 (exceeds 5 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
- 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 resize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
fun resize(direction: Direction? = null) {
if (sheet != null) {
val width = ((((sheet!!.spriteWidth
* optionsMap.getMap("sprite")!!.getMap("size")!!.getOption<Double>("width")!!)
* 2)
Method loadSpriteSheet
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
fun loadSpriteSheet(file: File) {
var path = ""
var image: InputStream? = null
var text: InputStream? = null
- 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 a Cognitive Complexity of 11 (exceeds 5 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
- 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 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def settings(panel)
opacity_multiplier_widgets = FAOSDanceSettings.createOptionDouble(panel, "Opacity Multiplier:", @opacity_multiplier, 1, 0.1)
opacity_multiplier_widgets.third.addChangeListener {|it|
@opacity_multiplier = it.source.to_java(javax::swing::JSpinner).model.value.to_java(java::lang::Float).floatValue
if @enabled
Method loadAndUseConfig
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
fun loadAndUseConfig(): Boolean {
fun recursiveCast(value: Any): Any {
val newV: Any
if (value is HashMap<*, *>) {
Method pre_draw_sprite
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def pre_draw_sprite(graphics)
if @counter == 0
@counter = @amount
@x = @speed_max_x
- 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 a Cognitive Complexity of 9 (exceeds 5 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,
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def settings(panel)
opacity_multiplier_widgets = FAOSDanceSettings.createOptionDouble(panel, "Opacity Multiplier:", @opacity_multiplier, 1, 0.1)
opacity_multiplier_widgets.third.addChangeListener {|it|
@opacity_multiplier = it.source.to_java(javax::swing::JSpinner).model.value.to_java(java::lang::Float).floatValue
if @enabled
- 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 addLabelRangeSliderSpinnerDouble
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
parent: Container,
gridBagLayout: GridBagLayout,
name: String,
highValue: Number,
lowValue: Number,
Method addComponentRangeSliderSpinner
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
parent: Container,
gridBagLayout: GridBagLayout,
component: JComponent,
highValue: Number,
lowValue: Number,
Method addLabelRangeSliderSpinnerInteger
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
parent: Container,
gridBagLayout: GridBagLayout,
name: String,
highValue: Number,
lowValue: Number,
Method addComponentSliderSpinner
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
parent: Container,
gridBagLayout: GridBagLayout,
component: JComponent,
defaultValue: Number,
maxNumber: Number,
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) {
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
- 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
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,
Avoid deeply nested control flow statements. Open
if (!fileList.contains(name)) {
File(i, name).apply {
this.createNewFile()
Files.write(this.toPath(), text)
}
Method paintBorder
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
c: Component,
g: Graphics,
x: Int, y: Int,
width: Int, height: Int