firehol/netdata

View on GitHub
src/go/plugin/go.d/modules/riakkv/charts.go

Summary

Maintainability
D
1 day
Test Coverage

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

var charts = module.Charts{
    kvNodeOperationsChart.Copy(),
    dtVnodeUpdatesChart.Copy(),
    searchQueriesChart.Copy(),
    searchDocumentsChart.Copy(),
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 1 other location - About 1 hr to fix
src/go/plugin/go.d/modules/cassandra/charts.go on lines 49..80

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

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

    searchLatencyQueryChart = module.Chart{
        ID:       "search_latency_query",
        Title:    "Search query latency",
        Units:    "ms",
        Fam:      "latency",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 3 other locations - About 1 hr to fix
src/go/plugin/go.d/modules/cassandra/charts.go on lines 98..113
src/go/plugin/go.d/modules/cassandra/charts.go on lines 114..129
src/go/plugin/go.d/modules/riakkv/charts.go on lines 238..253

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

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

    searchLatencyIndexChart = module.Chart{
        ID:       "search_latency_index",
        Title:    "Time it takes Search to index a new document",
        Units:    "ms",
        Fam:      "latency",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 3 other locations - About 1 hr to fix
src/go/plugin/go.d/modules/cassandra/charts.go on lines 98..113
src/go/plugin/go.d/modules/cassandra/charts.go on lines 114..129
src/go/plugin/go.d/modules/riakkv/charts.go on lines 222..237

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

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

    dtLatencyMapChart = module.Chart{
        ID:       "dt_latency_map",
        Title:    "Time it takes to perform an Update Map operation",
        Units:    "ms",
        Fam:      "latency",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 6 other locations - About 1 hr to fix
src/go/plugin/go.d/modules/riakkv/charts.go on lines 147..161
src/go/plugin/go.d/modules/riakkv/charts.go on lines 162..176
src/go/plugin/go.d/modules/riakkv/charts.go on lines 177..191
src/go/plugin/go.d/modules/riakkv/charts.go on lines 192..206
src/go/plugin/go.d/modules/riakkv/charts.go on lines 254..268
src/go/plugin/go.d/modules/riakkv/charts.go on lines 269..283

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

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

    consistentLatencyPutChart = module.Chart{
        ID:       "consistent_latency_put",
        Title:    "Strongly consistent write latency",
        Units:    "ms",
        Fam:      "latency",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 6 other locations - About 1 hr to fix
src/go/plugin/go.d/modules/riakkv/charts.go on lines 147..161
src/go/plugin/go.d/modules/riakkv/charts.go on lines 162..176
src/go/plugin/go.d/modules/riakkv/charts.go on lines 177..191
src/go/plugin/go.d/modules/riakkv/charts.go on lines 192..206
src/go/plugin/go.d/modules/riakkv/charts.go on lines 207..221
src/go/plugin/go.d/modules/riakkv/charts.go on lines 254..268

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

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

    consistentLatencyGetChart = module.Chart{
        ID:       "consistent_latency_get",
        Title:    "Strongly consistent read latency",
        Units:    "ms",
        Fam:      "latency",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 6 other locations - About 1 hr to fix
src/go/plugin/go.d/modules/riakkv/charts.go on lines 147..161
src/go/plugin/go.d/modules/riakkv/charts.go on lines 162..176
src/go/plugin/go.d/modules/riakkv/charts.go on lines 177..191
src/go/plugin/go.d/modules/riakkv/charts.go on lines 192..206
src/go/plugin/go.d/modules/riakkv/charts.go on lines 207..221
src/go/plugin/go.d/modules/riakkv/charts.go on lines 269..283

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

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

    dtLatencyCounterChart = module.Chart{
        ID:       "dt_latency_counter",
        Title:    "Time it takes to perform an Update Counter operation",
        Units:    "ms",
        Fam:      "latency",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 6 other locations - About 1 hr to fix
src/go/plugin/go.d/modules/riakkv/charts.go on lines 147..161
src/go/plugin/go.d/modules/riakkv/charts.go on lines 162..176
src/go/plugin/go.d/modules/riakkv/charts.go on lines 192..206
src/go/plugin/go.d/modules/riakkv/charts.go on lines 207..221
src/go/plugin/go.d/modules/riakkv/charts.go on lines 254..268
src/go/plugin/go.d/modules/riakkv/charts.go on lines 269..283

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

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

    kvLatencyGetChart = module.Chart{
        ID:       "kv_latency_get",
        Title:    "Time between reception of a client GET request and subsequent response to client",
        Units:    "ms",
        Fam:      "latency",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 6 other locations - About 1 hr to fix
src/go/plugin/go.d/modules/riakkv/charts.go on lines 162..176
src/go/plugin/go.d/modules/riakkv/charts.go on lines 177..191
src/go/plugin/go.d/modules/riakkv/charts.go on lines 192..206
src/go/plugin/go.d/modules/riakkv/charts.go on lines 207..221
src/go/plugin/go.d/modules/riakkv/charts.go on lines 254..268
src/go/plugin/go.d/modules/riakkv/charts.go on lines 269..283

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

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

    kvLatencyPutChart = module.Chart{
        ID:       "kv_latency_put",
        Title:    "Time between reception of a client PUT request and subsequent response to client",
        Units:    "ms",
        Fam:      "latency",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 6 other locations - About 1 hr to fix
src/go/plugin/go.d/modules/riakkv/charts.go on lines 147..161
src/go/plugin/go.d/modules/riakkv/charts.go on lines 177..191
src/go/plugin/go.d/modules/riakkv/charts.go on lines 192..206
src/go/plugin/go.d/modules/riakkv/charts.go on lines 207..221
src/go/plugin/go.d/modules/riakkv/charts.go on lines 254..268
src/go/plugin/go.d/modules/riakkv/charts.go on lines 269..283

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

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

    dtLatencySetChart = module.Chart{
        ID:       "dt_latency_counter",
        Title:    "Time it takes to perform an Update Set operation",
        Units:    "ms",
        Fam:      "latency",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 6 other locations - About 1 hr to fix
src/go/plugin/go.d/modules/riakkv/charts.go on lines 147..161
src/go/plugin/go.d/modules/riakkv/charts.go on lines 162..176
src/go/plugin/go.d/modules/riakkv/charts.go on lines 177..191
src/go/plugin/go.d/modules/riakkv/charts.go on lines 207..221
src/go/plugin/go.d/modules/riakkv/charts.go on lines 254..268
src/go/plugin/go.d/modules/riakkv/charts.go on lines 269..283

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

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

    kvObjectSizeGetChart = module.Chart{
        ID:       "kv_siblings_encountered_get",
        Title:    "Object size encountered by this node during the past minute",
        Units:    "bytes",
        Fam:      "load",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 11 other locations - About 45 mins to fix
src/go/plugin/go.d/modules/clickhouse/charts.go on lines 171..185
src/go/plugin/go.d/modules/docker/charts.go on lines 47..61
src/go/plugin/go.d/modules/docker/charts.go on lines 115..129
src/go/plugin/go.d/modules/mongodb/charts.go on lines 267..281
src/go/plugin/go.d/modules/nginxplus/charts.go on lines 680..694
src/go/plugin/go.d/modules/postgres/charts.go on lines 305..319
src/go/plugin/go.d/modules/rabbitmq/charts.go on lines 100..114
src/go/plugin/go.d/modules/riakkv/charts.go on lines 328..342
src/go/plugin/go.d/modules/riakkv/charts.go on lines 358..372
src/go/plugin/go.d/modules/uwsgi/charts.go on lines 182..196
src/go/plugin/go.d/modules/vsphere/charts.go on lines 258..272

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

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

    kvSiblingsEncounteredGetChart = module.Chart{
        ID:       "kv_siblings_encountered_get",
        Title:    "Siblings encountered during GET operations by this node during the past minute",
        Units:    "siblings",
        Fam:      "load",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 11 other locations - About 45 mins to fix
src/go/plugin/go.d/modules/clickhouse/charts.go on lines 171..185
src/go/plugin/go.d/modules/docker/charts.go on lines 47..61
src/go/plugin/go.d/modules/docker/charts.go on lines 115..129
src/go/plugin/go.d/modules/mongodb/charts.go on lines 267..281
src/go/plugin/go.d/modules/nginxplus/charts.go on lines 680..694
src/go/plugin/go.d/modules/postgres/charts.go on lines 305..319
src/go/plugin/go.d/modules/rabbitmq/charts.go on lines 100..114
src/go/plugin/go.d/modules/riakkv/charts.go on lines 343..357
src/go/plugin/go.d/modules/riakkv/charts.go on lines 358..372
src/go/plugin/go.d/modules/uwsgi/charts.go on lines 182..196
src/go/plugin/go.d/modules/vsphere/charts.go on lines 258..272

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

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

    searchVnodeqSizeChart = module.Chart{
        ID:       "kv_siblings_encountered_get",
        Title:    "Unprocessed messages in the vnode message queues of Search in the past minute",
        Units:    "messages",
        Fam:      "load",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 11 other locations - About 45 mins to fix
src/go/plugin/go.d/modules/clickhouse/charts.go on lines 171..185
src/go/plugin/go.d/modules/docker/charts.go on lines 47..61
src/go/plugin/go.d/modules/docker/charts.go on lines 115..129
src/go/plugin/go.d/modules/mongodb/charts.go on lines 267..281
src/go/plugin/go.d/modules/nginxplus/charts.go on lines 680..694
src/go/plugin/go.d/modules/postgres/charts.go on lines 305..319
src/go/plugin/go.d/modules/rabbitmq/charts.go on lines 100..114
src/go/plugin/go.d/modules/riakkv/charts.go on lines 328..342
src/go/plugin/go.d/modules/riakkv/charts.go on lines 343..357
src/go/plugin/go.d/modules/uwsgi/charts.go on lines 182..196
src/go/plugin/go.d/modules/vsphere/charts.go on lines 258..272

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

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

    coreFsmActiveChart = module.Chart{
        ID:       "core_fsm_active",
        Title:    "Active finite state machines by kind",
        Units:    "fsms",
        Fam:      "load",
Severity: Major
Found in src/go/plugin/go.d/modules/riakkv/charts.go and 14 other locations - About 30 mins to fix
src/go/plugin/go.d/modules/chrony/charts.go on lines 183..196
src/go/plugin/go.d/modules/consul/charts.go on lines 246..259
src/go/plugin/go.d/modules/consul/charts.go on lines 530..543
src/go/plugin/go.d/modules/consul/charts.go on lines 544..557
src/go/plugin/go.d/modules/envoy/charts.go on lines 92..105
src/go/plugin/go.d/modules/mongodb/charts.go on lines 409..422
src/go/plugin/go.d/modules/monit/charts.go on lines 40..53
src/go/plugin/go.d/modules/nvidia_smi/charts.go on lines 211..224
src/go/plugin/go.d/modules/postgres/charts.go on lines 503..516
src/go/plugin/go.d/modules/proxysql/charts.go on lines 617..630
src/go/plugin/go.d/modules/redis/charts.go on lines 88..101
src/go/plugin/go.d/modules/vsphere/charts.go on lines 86..99
src/go/plugin/go.d/modules/vsphere/charts.go on lines 188..201
src/go/plugin/go.d/modules/vsphere/charts.go on lines 362..375

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

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

There are no issues that match your filters.

Category
Status