DeflatedPickle/Quiver

View on GitHub

Showing 35 of 96 total issues

Method getTreeCellRendererComponent has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

                tree: JTree?,
                value: Any?,
                selected: Boolean,
                expanded: Boolean,
                leaf: Boolean,

    Avoid deeply nested control flow statements.
    Open

                                if (ps.assets.minecraft.textures.gui.container != null) dir("container") {
                                    if (ps.assets.minecraft.textures.gui.container.creativeInventory) dir("creative_inventory") {}
                                }
    Severity: Major
    Found in core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if (ps.assets.minecraft.textures.gui.title != null) dir("title") {
                                      if (ps.assets.minecraft.textures.gui.title.background) dir("background") {}
                                  }
      Severity: Major
      Found in core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (ps.assets.minecraft.textures.gui.presets) dir("presets") {}
        Severity: Major
        Found in core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if (ps.assets.minecraft.textures.gui.advancements != null) dir("advancements") {
                                          if (ps.assets.minecraft.textures.gui.advancements.backgrounds) dir("backgrounds") {}
                                      }
          Severity: Major
          Found in core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                                models = if (isSelected("assets/minecraft/models")) PackUtil.PackStructure.Minecraft.Models(
                                                    block = isSelected("assets/minecraft/models/block"),
                                                    item = isSelected("assets/minecraft/models/item")
                                                ) else null,

              Avoid deeply nested control flow statements.
              Open

                                                  shaders = if (isSelected("assets/minecraft/shaders")) PackUtil.PackStructure.Minecraft.Shaders(
                                                      post = isSelected("assets/minecraft/shaders/post"),
                                                      program = isSelected("assets/minecraft/shaders/program")
                                                  ) else null,

                Avoid deeply nested control flow statements.
                Open

                                                    textures = if (isSelected("assets/minecraft/textures")) PackUtil.PackStructure.Minecraft.Textures(
                                                        block = isSelected("assets/minecraft/textures/block"),
                                                        colourmap = isSelected("assets/minecraft/textures/colourmap"),
                                                        effect = isSelected("assets/minecraft/textures/effect"),
                                                        entity = isSelected("assets/minecraft/textures/entity"),

                  Avoid deeply nested control flow statements.
                  Open

                                              if (ps.assets.minecraft.textures.models.armor) dir("armor") {}
                  Severity: Major
                  Found in core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt - About 45 mins to fix

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

                                        table: JTable,
                                        value: Any,
                                        isSelected: Boolean,
                                        hasFocus: Boolean,
                                        row: Int,

                      Avoid deeply nested control flow statements.
                      Open

                                              if (image.width == image.height) {
                                                  return image.width
                                              }
                      Severity: Major
                      Found in core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt - About 45 mins to fix

                        Method getListCellRendererComponent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                            list: JList<*>,
                                            value: Any,
                                            index: Int,
                                            isSelected: Boolean,
                                            cellHasFocus: Boolean

                          Method search has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  string: String,
                                  caseInsensitive: Boolean = true,
                                  comments: Boolean = false,
                                  start: Int = -1,
                                  backwards: Boolean = false

                            Method getListCellRendererComponent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                            list: JList<*>?,
                                            value: Any?,
                                            index: Int,
                                            isSelected: Boolean,
                                            cellHasFocus: Boolean

                              Method addDropTarget has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
                              Open

                                  private fun addDropTarget() {
                                      this.dropTarget = object : DropTarget() {
                                          @Suppress("UNCHECKED_CAST")
                                          override fun dragEnter(dtde: DropTargetDragEvent) {
                                              val file = Quiver.selectedFile

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language