pambrose/prometheus-proxy

View on GitHub

Showing 30 of 30 total issues

Method assignConfigVals has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring.
Open

  override fun assignConfigVals() {
    with(configVals.proxy) {
      if (proxyHttpPort == -1)
        proxyHttpPort = PROXY_PORT.getEnv(http.port)
      logger.info { "proxyHttpPort: $proxyHttpPort" }
Severity: Minor
Found in src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt - About 5 hrs to fix

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

  override fun assignConfigVals() {
    with(configVals.proxy) {
      if (proxyHttpPort == -1)
        proxyHttpPort = PROXY_PORT.getEnv(http.port)
      logger.info { "proxyHttpPort: $proxyHttpPort" }
Severity: Minor
Found in src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt - About 1 hr to fix

    Method metricsConfigTest has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      @Test
      fun metricsConfigTest() {
        newMetricsConfig(true, 555, configVals("agent.metrics.enabled=true").agent.metrics)
          .also {
            it.enabled.shouldBeTrue()
    Severity: Minor
    Found in src/test/kotlin/io/prometheus/DataClassTest.kt - About 1 hr to fix

      Method adminConfigTest has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        @Test
        fun adminConfigTest() {
          var vals = configVals("agent.admin.enabled=true")
          newAdminConfig(vals.agent.admin.enabled, -1, vals.agent.admin)
            .also {
      Severity: Minor
      Found in src/test/kotlin/io/prometheus/DataClassTest.kt - About 1 hr to fix

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

            newMetricsConfig(true, 555, configVals("agent.metrics.path=a path val").agent.metrics)
              .also {
                it.path shouldBeEqualTo "a path val"
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 4 other locations - About 50 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 54..57
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 59..62
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 64..67
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 69..72

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

        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

            newAdminConfig(true, 444, configVals("agent.admin.pingPath=a pingpath val").agent.admin)
              .also {
                it.pingPath shouldBeEqualTo "a pingpath val"
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 4 other locations - About 50 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 59..62
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 64..67
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 69..72
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 87..90

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

        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

            newAdminConfig(true, 444, configVals("agent.admin.versionPath=a versionpath val").agent.admin)
              .also {
                it.versionPath shouldBeEqualTo "a versionpath val"
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 4 other locations - About 50 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 54..57
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 64..67
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 69..72
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 87..90

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

        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

            newAdminConfig(true, 444, configVals("agent.admin.healthCheckPath=a healthCheckPath val").agent.admin)
              .also {
                it.healthCheckPath shouldBeEqualTo "a healthCheckPath val"
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 4 other locations - About 50 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 54..57
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 59..62
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 69..72
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 87..90

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

        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

            newAdminConfig(true, 444, configVals("agent.admin.threadDumpPath=a threadDumpPath val").agent.admin)
              .also {
                it.threadDumpPath shouldBeEqualTo "a threadDumpPath val"
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 4 other locations - About 50 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 54..57
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 59..62
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 64..67
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 87..90

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

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

            newMetricsConfig(true, 555, configVals("agent.metrics.classLoadingExportsEnabled=true").agent.metrics)
              .also {
                it.classLoadingExportsEnabled.shouldBeTrue()
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 6 other locations - About 45 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 77..80
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 92..95
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 97..100
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 102..105
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 107..110
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 117..120

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

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

            newMetricsConfig(true, 555, configVals("agent.metrics.enabled=true").agent.metrics)
              .also {
                it.enabled.shouldBeTrue()
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 6 other locations - About 45 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 92..95
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 97..100
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 102..105
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 107..110
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 112..115
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 117..120

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

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

            newMetricsConfig(true, 555, configVals("agent.metrics.memoryPoolsExportsEnabled=true").agent.metrics)
              .also {
                it.memoryPoolsExportsEnabled.shouldBeTrue()
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 6 other locations - About 45 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 77..80
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 92..95
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 102..105
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 107..110
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 112..115
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 117..120

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

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

            newMetricsConfig(true, 555, configVals("agent.metrics.garbageCollectorExportsEnabled=true").agent.metrics)
              .also {
                it.garbageCollectorExportsEnabled.shouldBeTrue()
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 6 other locations - About 45 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 77..80
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 92..95
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 97..100
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 107..110
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 112..115
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 117..120

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

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

            newMetricsConfig(true, 555, configVals("agent.metrics.standardExportsEnabled=true").agent.metrics)
              .also {
                it.standardExportsEnabled.shouldBeTrue()
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 6 other locations - About 45 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 77..80
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 97..100
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 102..105
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 107..110
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 112..115
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 117..120

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

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

            newMetricsConfig(true, 555, configVals("agent.metrics.threadExportsEnabled=true").agent.metrics)
              .also {
                it.threadExportsEnabled.shouldBeTrue()
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 6 other locations - About 45 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 77..80
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 92..95
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 97..100
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 102..105
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 112..115
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 117..120

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

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

            newMetricsConfig(true, 555, configVals("agent.metrics.versionInfoExportsEnabled=true").agent.metrics)
              .also {
                it.versionInfoExportsEnabled.shouldBeTrue()
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 6 other locations - About 45 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 77..80
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 92..95
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 97..100
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 102..105
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 107..110
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 112..115

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

        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 (sdEnabled)
                require(sdTargetPrefix.isNotEmpty()) { "sdTargetPrefix is empty" }
              else
                logger.info { "sdTargetPrefix: $sdTargetPrefix" }
        Severity: Minor
        Found in src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt and 1 other location - About 45 mins to fix
        src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt on lines 69..72

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

        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 (sdEnabled)
                require(sdPath.isNotEmpty()) { "sdPath is empty" }
              else
                logger.info { "sdPath: $sdPath" }
        Severity: Minor
        Found in src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt and 1 other location - About 45 mins to fix
        src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt on lines 76..79

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

        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

            newZipkinConfig(configVals("agent.internal.zipkin.serviceName=a service name").agent.internal.zipkin)
              .also {
                it.serviceName shouldBeEqualTo "a service name"
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 2 other locations - About 40 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 130..133
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 140..143

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

        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

            newZipkinConfig(configVals("agent.internal.zipkin.path=a path val").agent.internal.zipkin)
              .also {
                it.path shouldBeEqualTo "a path val"
              }
        Severity: Major
        Found in src/test/kotlin/io/prometheus/DataClassTest.kt and 2 other locations - About 40 mins to fix
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 130..133
        src/test/kotlin/io/prometheus/DataClassTest.kt on lines 145..148

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

        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