netdata/netdata

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

Summary

Maintainability
D
2 days
Test Coverage

File charts.go has 800 lines of code (exceeds 500 allowed). Consider refactoring.
Open

// SPDX-License-Identifier: GPL-3.0-or-later

package cockroachdb

import "github.com/netdata/netdata/go/go.d.plugin/agent/module"
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go - About 1 day to fix

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

        chartSQLExecutedTCLStatements = Chart{
            ID:    "sql_executed_tcl_statements",
            Title: "SQL Executed TCL Statements",
            Units: "statements",
            Fam:   "sql",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go and 1 other location - About 2 hrs to fix
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 394..410

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

    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

        chartSQLStartedTCLStatements = Chart{
            ID:    "sql_started_tcl_statements",
            Title: "SQL Started TCL Statements",
            Units: "statements",
            Fam:   "sql",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go and 1 other location - About 2 hrs to fix
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 411..427

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

    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

        chartSQLExecutedDMLStatements = Chart{
            ID:    "sql_executed_dml_statements",
            Title: "SQL Executed DML Statements",
            Units: "statements",
            Fam:   "sql",
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 366..379
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 552..565
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 566..579

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

    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

        chartRangesEvents = Chart{
            ID:    "range_events",
            Title: "Range Events",
            Units: "events",
            Fam:   "ranges",
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 366..379
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 380..393
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 566..579

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

    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

        chartRangesSnapshotEvents = Chart{
            ID:    "range_snapshot_events",
            Title: "Range Snapshot Events",
            Units: "events",
            Fam:   "ranges",
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 366..379
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 380..393
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 552..565

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

    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

        chartSQLStartedDMLStatements = Chart{
            ID:    "sql_started_dml_statements",
            Title: "SQL Started DML Statements",
            Units: "statements",
            Fam:   "sql",
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 380..393
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 552..565
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 566..579

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

    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

        chartKVTransactions = Chart{
            ID:    "kv_transactions",
            Title: "KV Transactions",
            Units: "transactions",
            Fam:   "kv transactions",
    Severity: Minor
    Found in src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go and 1 other location - About 45 mins to fix
    src/go/collectors/go.d.plugin/modules/vernemq/charts.go on lines 194..206

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

    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

        chartHostNetworkBandwidth = Chart{
            ID:    "host_network_bandwidth",
            Title: "Host Network Cumulative Bandwidth",
            Units: "kilobits",
            Fam:   "host",
    Severity: Minor
    Found in src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go and 2 other locations - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 166..177
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 311..322

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

    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

        chartSQLTraffic = Chart{
            ID:    "sql_bandwidth",
            Title: "SQL Bandwidth",
            Units: "KiB",
            Fam:   "sql",
    Severity: Minor
    Found in src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go and 2 other locations - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 166..177
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 199..210

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

    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

        chartHostDiskBandwidth = Chart{
            ID:    "host_disk_bandwidth",
            Title: "Host Disk Cumulative Bandwidth",
            Units: "KiB",
            Fam:   "host",
    Severity: Minor
    Found in src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go and 2 other locations - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 199..210
    src/go/collectors/go.d.plugin/modules/cockroachdb/charts.go on lines 311..322

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

    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