pambrose/prometheus-proxy

View on GitHub

Showing 26 of 30 total issues

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

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

    newZipkinConfig(configVals("agent.internal.zipkin.hostname=testval").agent.internal.zipkin)
      .also {
        it.hostname shouldBeEqualTo "testval"
      }
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 140..143
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

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

  @Parameter(names = ["-p", "--port"], description = "Proxy listen port")
  var proxyHttpPort = -1
    private set
Severity: Minor
Found in src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt and 1 other location - About 40 mins to fix
src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt on lines 33..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 70.

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

  @Parameter(names = ["-a", "--agent_port"], description = "gRPC listen port for Agents")
  var proxyAgentPort = -1
    private set
Severity: Minor
Found in src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt and 1 other location - About 40 mins to fix
src/main/kotlin/io/prometheus/proxy/ProxyOptions.kt on lines 29..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 70.

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

  @Test
  fun addRemovePathsTest() = runBlocking { addRemovePathsTest(args.agent.pathManager, simpleClassName) }
Severity: Major
Found in src/test/kotlin/io/prometheus/CommonTests.kt and 3 other locations - About 30 mins to fix
src/test/kotlin/io/prometheus/CommonTests.kt on lines 44..45
src/test/kotlin/io/prometheus/CommonTests.kt on lines 47..48
src/test/kotlin/io/prometheus/CommonTests.kt on lines 50..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 61.

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