DeflatedPickle/Quiver

View on GitHub

Showing 96 of 96 total issues

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

                    if (ps.assets.minecraft.models != null) dir("models") {
                        if (ps.assets.minecraft.models.block) dir("block") {}
                        if (ps.assets.minecraft.models.item) dir("item") {}
                    }
core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt on lines 129..132

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

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 (ps.assets.minecraft.shaders != null) dir("shaders") {
                        if (ps.assets.minecraft.shaders.post) dir("post") {}
                        if (ps.assets.minecraft.shaders.program) dir("program") {}
                    }
core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt on lines 123..126

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

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

@Suppress("unused")
@Plugin(
    value = "$[name]",
    author = "$[author]",
    version = "$[version]",
docxviewer/src/main/kotlin/com/deflatedpickle/docxviewer/DocXViewerPlugin.kt on lines 15..28
imageviewer/src/main/kotlin/com/deflatedpickle/imageviewer/ImageViewerPlugin.kt on lines 12..25
markdownviewer/src/main/kotlin/com/deflatedpickle/markdownviewer/MarkdownViewerPlugin.kt on lines 12..25
spritesheetviewer/src/main/kotlin/com/deflatedpickle/spritesheetviewer/SpriteSheetViewerPlugin.kt on lines 24..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 149.

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

@Suppress("unused")
@Plugin(
    value = "$[name]",
    author = "$[author]",
    version = "$[version]",
imageviewer/src/main/kotlin/com/deflatedpickle/imageviewer/ImageViewerPlugin.kt on lines 12..25
markdownviewer/src/main/kotlin/com/deflatedpickle/markdownviewer/MarkdownViewerPlugin.kt on lines 12..25
spritesheetviewer/src/main/kotlin/com/deflatedpickle/spritesheetviewer/SpriteSheetViewerPlugin.kt on lines 24..37
tableviewer/src/main/kotlin/com/deflatedpickle/tableviewer/TableViewerPlugin.kt on lines 12..25

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

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

@Suppress("unused")
@Plugin(
    value = "$[name]",
    author = "$[author]",
    version = "$[version]",
docxviewer/src/main/kotlin/com/deflatedpickle/docxviewer/DocXViewerPlugin.kt on lines 15..28
markdownviewer/src/main/kotlin/com/deflatedpickle/markdownviewer/MarkdownViewerPlugin.kt on lines 12..25
spritesheetviewer/src/main/kotlin/com/deflatedpickle/spritesheetviewer/SpriteSheetViewerPlugin.kt on lines 24..37
tableviewer/src/main/kotlin/com/deflatedpickle/tableviewer/TableViewerPlugin.kt on lines 12..25

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

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

@Suppress("unused")
@Plugin(
    value = "$[name]",
    author = "$[author]",
    version = "$[version]",
docxviewer/src/main/kotlin/com/deflatedpickle/docxviewer/DocXViewerPlugin.kt on lines 15..28
imageviewer/src/main/kotlin/com/deflatedpickle/imageviewer/ImageViewerPlugin.kt on lines 12..25
spritesheetviewer/src/main/kotlin/com/deflatedpickle/spritesheetviewer/SpriteSheetViewerPlugin.kt on lines 24..37
tableviewer/src/main/kotlin/com/deflatedpickle/tableviewer/TableViewerPlugin.kt on lines 12..25

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

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

@Suppress("unused")
@Plugin(
    value = "$[name]",
    author = "$[author]",
    version = "$[version]",
docxviewer/src/main/kotlin/com/deflatedpickle/docxviewer/DocXViewerPlugin.kt on lines 15..28
imageviewer/src/main/kotlin/com/deflatedpickle/imageviewer/ImageViewerPlugin.kt on lines 12..25
markdownviewer/src/main/kotlin/com/deflatedpickle/markdownviewer/MarkdownViewerPlugin.kt on lines 12..25
tableviewer/src/main/kotlin/com/deflatedpickle/tableviewer/TableViewerPlugin.kt on lines 12..25

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

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 processFile has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    override fun processFile(
        file: File,
        progressMonitor: ProgressMonitor
    ) {
        progressMonitor.maximum = 100

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

            EventProgramFinishSetup.addListener {
                val exportStepRegistry = RegistryUtil.get("export")
    
                @Suppress("UNCHECKED_CAST")
                (exportStepRegistry as Registry<String, ExportStep>?)?.register("zip", ZipStep)
    packsquashstep/src/main/kotlin/com/deflatedpickle/quiver/packsquashstep/PackSquashStepPlugin.kt on lines 39..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 131.

    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

            EventProgramFinishSetup.addListener {
                val exportStepRegistry = RegistryUtil.get("export")
    
                @Suppress("UNCHECKED_CAST")
                (exportStepRegistry as Registry<String, ExportStep>?)?.register("packsquash", PackSquashStep)
    zipstep/src/main/kotlin/com/deflatedpickle/quiver/zipstep/ZipStepPlugin.kt on lines 29..34

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

    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 search has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private fun search(
            string: String,
            caseInsensitive: Boolean = true,
            comments: Boolean = false,
            start: Int = -1,

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

                                  if (ps.assets.minecraft.textures.gui.advancements != null) dir("advancements") {
                                      if (ps.assets.minecraft.textures.gui.advancements.backgrounds) dir("backgrounds") {}
                                  }
      core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt on lines 145..147
      core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt on lines 149..151

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

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

                                  if (ps.assets.minecraft.textures.gui.container != null) dir("container") {
                                      if (ps.assets.minecraft.textures.gui.container.creativeInventory) dir("creative_inventory") {}
                                  }
      core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt on lines 142..144
      core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt on lines 149..151

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

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

                                  if (ps.assets.minecraft.textures.gui.title != null) dir("title") {
                                      if (ps.assets.minecraft.textures.gui.title.background) dir("background") {}
                                  }
      core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt on lines 142..144
      core/src/main/kotlin/com/deflatedpickle/quiver/backend/util/PackUtil.kt on lines 145..147

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

      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 addNBT has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private fun addNBT(tag: Tag<*>, parent: DefaultMutableTreeNode, name: String = "") {
              val keyNode = DefaultMutableTreeNode(
                  (if (name != "") "$name " else "") +
                      (if (name != "") "(" else "") +
                      "${tag::class.simpleName}" +

        Method handleJSON has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private fun handleJSON(file: File) {
                val jsonObject = this.json
                    .load(file)
                    .getObject("textures")
        
        

          Method setVisible has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              override fun setVisible(b: Boolean) {
                  // Disable everything before we validate
                  this.disableAll()
          
                  if (Quiver.packDirectory != null && Quiver.selectedDir != null) {

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

                        @Suppress("UNCHECKED_CAST")
                        val registry = RegistryUtil.get("viewer") as Registry<String, MutableList<Viewer<Any>>>?
            spritesheetviewer/src/main/kotlin/com/deflatedpickle/spritesheetviewer/SpriteSheetViewerPlugin.kt on lines 137..138

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

            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

                        @Suppress("UNCHECKED_CAST")
                        val registry = RegistryUtil.get("viewer") as Registry<String, MutableList<Viewer<Any>>>?
            imageviewer/src/main/kotlin/com/deflatedpickle/imageviewer/ImageViewerPlugin.kt on lines 35..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 111.

            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.add(extraResourceCollapsable.apply {
                            this.add(JXTitledSeparator("Extra Vanilla Data"), FillHorizontalFinishLine)
            
                            this.add(JScrollPane(extraResourceTree), FillBothFinishLine)
                        }, FillBothFinishLine)
            core/src/main/kotlin/com/deflatedpickle/quiver/frontend/dialog/NewDialog.kt on lines 372..376

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

            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