andrewinci/Insulator

View on GitHub

Showing 77 of 88 total issues

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

                and(focused) {
                    backgroundRadius = multi(box(0.0.px))
                    backgroundInsets = multi(box(0.px, (-2).px, (-2).px, (-2).px), box(0.0.px), box(0.px, (-2).px, 0.px, (-2).px))
                    backgroundColor = multi(theme.mainColorDark, theme.backgroundColor, theme.backgroundColor)
                }
Severity: Major
Found in app/src/main/kotlin/insulator/ui/style/TextStyle.kt and 1 other location - About 3 hrs to fix
app/src/main/kotlin/insulator/ui/style/TextStyle.kt on lines 70..74

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

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

                content {
                    backgroundRadius = multi(box(0.0.px))
                    backgroundInsets = multi(box(0.px, (-2).px, (-2).px, (-2).px), box(0.0.px), box(0.px, (-2).px, 0.px, (-2).px))
                    backgroundColor = multi(theme.mainColorDark, theme.backgroundColor, theme.backgroundColor)
                }
Severity: Major
Found in app/src/main/kotlin/insulator/ui/style/TextStyle.kt and 1 other location - About 3 hrs to fix
app/src/main/kotlin/insulator/ui/style/TextStyle.kt on lines 65..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 264.

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

    fun createNewSchema(owner: Window?) = windowsManager.openWindow("new-schema", owner) {
        subjectComponentFactory.build(Subject.empty())
            .getCreateSchemaView()
            .also { it.whenUndockedOnce { dispatch { refresh() } } }
    }
app/src/main/kotlin/insulator/viewmodel/main/topic/ListTopicViewModel.kt on lines 73..77

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

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

    fun createNewTopic(owner: Window?) = windowsManager.openWindow("create-new-topic", owner) {
        topicComponentFactory.build(Topic.empty())
            .getCreateTopicView()
            .also { it.whenUndockedOnce { dispatch { refresh() } } }
    }
app/src/main/kotlin/insulator/viewmodel/main/schemaregistry/ListSchemaViewModel.kt on lines 77..81

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

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

        humanReadableLogicalType && schema.objectProps["logicalType"] == "time-micros" && field is Long -> {
            val instant = Instant.EPOCH.plus(field.toLong(), ChronoUnit.MICROS)
            timeFormatter.format(instant).right()
        }
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 27..30
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 37..40
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 45..48

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

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

            readonlyColumn("Configuration Name", Pair<String, String>::first) {
                prefWidthProperty().bind(this.tableView.widthProperty().divide(2).minus(10))
                isReorderable = false
            }
app/src/main/kotlin/insulator/views/main/topic/TopicInfoView.kt on lines 32..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 133.

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

        humanReadableLogicalType && schema.objectProps["logicalType"] == "date" && field is Int -> {
            val instant = Instant.EPOCH.plus(field.toLong(), ChronoUnit.DAYS)
            dateFormatter.format(instant).right()
        }
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 37..40
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 41..44
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 45..48

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

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

            readonlyColumn("Value", Pair<String, String>::second) {
                prefWidthProperty().bind(this.tableView.widthProperty().divide(2).minus(10))
                isReorderable = false
            }
app/src/main/kotlin/insulator/views/main/topic/TopicInfoView.kt on lines 28..31

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

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

        humanReadableLogicalType && schema.objectProps["logicalType"] == "local-timestamp-micros" && field is Long -> {
            val instant = Instant.EPOCH.plus(field.toLong(), ChronoUnit.MICROS)
            timeFormatter.format(instant).right()
        }
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 27..30
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 37..40
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 41..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 133.

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

        humanReadableLogicalType && schema.objectProps["logicalType"] == "time-millis" && field is Int -> {
            val instant = Instant.EPOCH.plus(field.toLong(), ChronoUnit.MILLIS)
            timeFormatter.format(instant).right()
        }
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 27..30
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 41..44
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 45..48

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

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

                incrementButton {
                    backgroundColor = multi(Color.TRANSPARENT)
                    backgroundRadius = multi(box(0.0.em))
                    padding = box(0.0.px, 0.0.px, 0.0.px, 0.0.px)
                }
Severity: Major
Found in app/src/main/kotlin/insulator/ui/style/ScrollBarStyle.kt and 1 other location - About 1 hr to fix
app/src/main/kotlin/insulator/ui/style/ScrollBarStyle.kt on lines 29..33

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

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

                decrementButton {
                    backgroundColor = multi(Color.TRANSPARENT)
                    backgroundRadius = multi(box(0.0.em))
                    padding = box(0.0.px, 0.0.px, 0.0.px, 0.0.px)
                }
Severity: Major
Found in app/src/main/kotlin/insulator/ui/style/ScrollBarStyle.kt and 1 other location - About 1 hr to fix
app/src/main/kotlin/insulator/ui/style/ScrollBarStyle.kt on lines 23..27

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

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

class ConsumerGroupComponentFactory @Inject constructor(clusterComponent: ClusterComponent) :
    CachedFactory<ConsumerGroupId, ConsumerGroupComponent>({ consumerGroup: ConsumerGroupId ->
        DaggerConsumerGroupComponent.factory().build(clusterComponent, consumerGroup)
    })
Severity: Major
Found in app/src/main/kotlin/insulator/di/ConsumerGroupComponent.kt and 2 other locations - About 1 hr to fix
app/src/main/kotlin/insulator/di/SubjectComponent.kt on lines 16..19
app/src/main/kotlin/insulator/di/TopicComponent.kt on lines 19..22

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

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

class TopicComponentFactory @Inject constructor(clusterComponent: ClusterComponent) :
    CachedFactory<Topic, TopicComponent>({ topic: Topic ->
        DaggerTopicComponent.factory().build(clusterComponent, topic)
    })
Severity: Major
Found in app/src/main/kotlin/insulator/di/TopicComponent.kt and 2 other locations - About 1 hr to fix
app/src/main/kotlin/insulator/di/ConsumerGroupComponent.kt on lines 15..18
app/src/main/kotlin/insulator/di/SubjectComponent.kt on lines 16..19

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

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

class SubjectComponentFactory @Inject constructor(clusterComponent: ClusterComponent) :
    CachedFactory<Subject, SubjectComponent>({ subject: Subject ->
        DaggerSubjectComponent.factory().build(clusterComponent, subject)
    })
Severity: Major
Found in app/src/main/kotlin/insulator/di/SubjectComponent.kt and 2 other locations - About 1 hr to fix
app/src/main/kotlin/insulator/di/ConsumerGroupComponent.kt on lines 15..18
app/src/main/kotlin/insulator/di/TopicComponent.kt on lines 19..22

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

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

        humanReadableLogicalType && schema.objectProps["logicalType"] == "timestamp-millis" && field is Long -> {
            Instant.EPOCH.plus(field, ChronoUnit.MILLIS).toString().right()
        }
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 34..36
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 49..51

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

        humanReadableLogicalType && schema.objectProps["logicalType"] == "local-timestamp-millis" && field is Long -> {
            Instant.EPOCH.plus(field, ChronoUnit.MILLIS).toString().right()
        }
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 31..33
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 34..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 3 locations. Consider refactoring.
Open

        humanReadableLogicalType && schema.objectProps["logicalType"] == "timestamp-micros" && field is Long -> {
            Instant.EPOCH.plus(field, ChronoUnit.MICROS).toString().right()
        }
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 31..33
lib/jsonhelper/src/main/kotlin/insulator/jsonhelper/avrotojson/PrimitiveTypeParsers.kt on lines 49..51

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

    @Provides
    @TopicScope
    fun providesConsumer(cluster: Cluster, converter: AvroToJsonConverter) =
        consumer(cluster) { converter.parse(it, GlobalState.humanReadableAvroProperty.value) }
Severity: Major
Found in app/src/main/kotlin/insulator/di/modules/TopicModule.kt and 1 other location - About 1 hr to fix
app/src/main/kotlin/insulator/di/modules/ClusterModule.kt on lines 24..27

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

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

    @Provides
    @ClusterScope
    fun providesConsumer(cluster: Cluster, converter: AvroToJsonConverter) =
        consumer(cluster) { converter.parse(it, GlobalState.humanReadableAvroProperty.value) }
Severity: Major
Found in app/src/main/kotlin/insulator/di/modules/ClusterModule.kt and 1 other location - About 1 hr to fix
app/src/main/kotlin/insulator/di/modules/TopicModule.kt on lines 14..17

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

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