netdata/netdata

View on GitHub
src/go/collectors/go.d.plugin/modules/cassandra/charts.go

Summary

Maintainability
C
1 day
Test Coverage

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

func (c *Cassandra) addThreadPoolCharts(pool *threadPoolMetrics) {
    charts := chartsTmplThreadPool.Copy()

    for _, chart := range *charts {
        chart.ID = fmt.Sprintf(chart.ID, pool.name)
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 1 other location - About 2 hrs to fix
src/go/collectors/go.d.plugin/modules/megacli/charts.go on lines 121..137

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

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

    chartClientRequestReadLatencyHistogram = module.Chart{
        ID:       "client_request_read_latency_histogram",
        Title:    "Client request read latency histogram",
        Units:    "seconds",
        Fam:      "latency",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 1 other location - About 1 hr to fix
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 114..129

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

    chartClientRequestWriteLatencyHistogram = module.Chart{
        ID:       "client_request_write_latency_histogram",
        Title:    "Client request write latency histogram",
        Units:    "seconds",
        Fam:      "latency",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 1 other location - About 1 hr to fix
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 98..113

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

    chartJVMGCTime = module.Chart{
        ID:       "jvm_gc_time",
        Title:    "Garbage collection time",
        Units:    "seconds",
        Fam:      "jvm runtime",
Severity: Minor
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 1 other location - About 35 mins to fix
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 130..141

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

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

    chartClientRequestsLatency = module.Chart{
        ID:       "client_requests_latency",
        Title:    "Client requests total latency",
        Units:    "seconds",
        Fam:      "latency",
Severity: Minor
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 1 other location - About 35 mins to fix
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 370..381

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

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

    chartRowCacheHitRate = module.Chart{
        ID:       "row_cache_hit_rate",
        Title:    "Row cache hit rate",
        Units:    "events/s",
        Fam:      "cache",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 5 other locations - About 35 mins to fix
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 156..168
src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 294..306
src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 190..202
src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 630..642
src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 688..700

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

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

    chartKeyCacheHitRate = module.Chart{
        ID:       "key_cache_hit_rate",
        Title:    "Key cache hit rate",
        Units:    "events/s",
        Fam:      "cache",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 5 other locations - About 35 mins to fix
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 203..215
src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 294..306
src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 190..202
src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 630..642
src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 688..700

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

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

    chartClientRequestFailuresRate = module.Chart{
        ID:       "client_requests_failures_rate",
        Title:    "Client requests failures rate",
        Units:    "failures/s",
        Fam:      "errors",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 10 other locations - About 35 mins to fix
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 83..94
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 396..407
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 408..419
src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 201..212
src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 701..712
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 536..547
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 620..631
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 667..678
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 679..690
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 691..702

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

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

    chartClientRequestsRate = module.Chart{
        ID:       "client_requests_rate",
        Title:    "Client requests rate",
        Units:    "requests/s",
        Fam:      "throughput",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 10 other locations - About 35 mins to fix
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 396..407
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 408..419
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 420..431
src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 201..212
src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 701..712
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 536..547
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 620..631
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 667..678
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 679..690
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 691..702

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

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

    chartClientRequestUnavailablesRate = module.Chart{
        ID:       "client_requests_unavailables_rate",
        Title:    "Client requests unavailable exceptions rate",
        Units:    "exceptions/s",
        Fam:      "errors",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 10 other locations - About 35 mins to fix
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 83..94
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 396..407
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 420..431
src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 201..212
src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 701..712
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 536..547
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 620..631
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 667..678
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 679..690
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 691..702

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

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

    chartClientRequestTimeoutsRate = module.Chart{
        ID:       "client_requests_timeouts_rate",
        Title:    "Client requests timeouts rate",
        Units:    "timeouts/s",
        Fam:      "errors",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/cassandra/charts.go and 10 other locations - About 35 mins to fix
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 83..94
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 408..419
src/go/collectors/go.d.plugin/modules/cassandra/charts.go on lines 420..431
src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 201..212
src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 701..712
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 536..547
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 620..631
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 667..678
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 679..690
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 691..702

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

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