netdata/netdata

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

Summary

Maintainability
F
5 days
Test Coverage

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

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

package mongo

import (
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go - About 1 day to fix

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

        chartAssertsRate = module.Chart{
            ID:       "asserts_rate",
            Title:    "Raised assertions",
            Units:    "asserts/s",
            Fam:      "asserts",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 1 other location - About 2 hrs to fix
    src/go/collectors/go.d.plugin/modules/elasticsearch/charts.go on lines 517..533

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

    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

        chartOperationsByTypeRate = module.Chart{
            ID:       "operations_by_type_rate",
            Title:    "Operations by type",
            Units:    "operations/s",
            Fam:      "operations",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 1 other location - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 492..507

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

    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

        chartMutexLockAcquisitionsRate = module.Chart{
            ID:       "mutex_lock_acquisitions_rate",
            Title:    "Mutex lock acquisitions",
            Units:    "acquisitions/s",
            Fam:      "locks",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 594..608
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 609..623
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 624..638
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 654..668
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 669..683

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

    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

        chartMetadataLockAcquisitionsRate = module.Chart{
            ID:       "metadata_lock_acquisitions_rate",
            Title:    "Metadata lock acquisitions",
            Units:    "acquisitions/s",
            Fam:      "locks",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 594..608
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 609..623
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 624..638
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 639..653
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 669..683

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

    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

        chartGlobalLockAcquisitionsRate = module.Chart{
            ID:       "global_lock_acquisitions_rate",
            Title:    "Global lock acquisitions",
            Units:    "acquisitions/s",
            Fam:      "locks",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 609..623
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 624..638
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 639..653
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 654..668
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 669..683

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

    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

        chartCollectionLockAcquisitionsRate = module.Chart{
            ID:       "collection_lock_acquisitions_rate",
            Title:    "Collection lock acquisitions",
            Units:    "acquisitions/s",
            Fam:      "locks",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 594..608
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 609..623
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 639..653
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 654..668
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 669..683

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

    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

        chartOpLogLockAcquisitionsRate = module.Chart{
            ID:       "oplog_lock_acquisitions_rate",
            Title:    "Operations log lock acquisitions",
            Units:    "acquisitions/s",
            Fam:      "locks",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 594..608
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 609..623
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 624..638
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 639..653
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 654..668

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

    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

        chartDatabaseLockAcquisitionsRate = module.Chart{
            ID:       "database_lock_acquisitions_rate",
            Title:    "Database lock acquisitions",
            Units:    "acquisitions/s",
            Fam:      "locks",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 594..608
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 624..638
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 639..653
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 654..668
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 669..683

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

    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

        chartTransactionsRate = module.Chart{
            ID:       "transactions_rate",
            Title:    "Transactions rate",
            Units:    "transactions/s",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 2 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/envoy/charts.go on lines 506..519
    src/go/collectors/go.d.plugin/modules/envoy/charts.go on lines 541..554

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

    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

        chartTransactionsSingleWriteShardCommitsRate = module.Chart{
            ID:       "transactions_single_write_shard_commits_rate",
            Title:    "Transactions commits",
            Units:    "commits/s",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 437..450
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 463..476
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 515..528
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 541..554
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 567..580

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

    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

        chartTransactionsReadOnlyCommitsRate = module.Chart{
            ID:       "transactions_read_only_commits_rate",
            Title:    "Transactions commits",
            Units:    "commits/s",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 437..450
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 463..476
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 489..502
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 541..554
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 567..580

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

    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

        chartTransactionsTwoPhaseCommitCommitsRate = module.Chart{
            ID:       "transactions_two_phase_commit_commits_rate",
            Title:    "Transactions commits",
            Units:    "commits/s",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 437..450
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 463..476
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 489..502
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 515..528
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 567..580

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

    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

        chartTransactionsNoShardsCommitsRate = module.Chart{
            ID:       "transactions_no_shards_commits_rate",
            Title:    "Transactions commits",
            Units:    "commits/s",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 463..476
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 489..502
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 515..528
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 541..554
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 567..580

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

    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

        chartTransactionsSingleShardCommitsRate = module.Chart{
            ID:       "transactions_single_shard_commits_rate",
            Title:    "Transactions commits",
            Units:    "commits/s",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 437..450
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 489..502
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 515..528
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 541..554
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 567..580

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

    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

        chartTransactionsRecoverWithTokenCommitsRate = module.Chart{
            ID:       "transactions_recover_with_token_commits_rate",
            Title:    "Transactions commits",
            Units:    "commits/s",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 437..450
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 463..476
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 489..502
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 515..528
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 541..554

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

    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

        chartMemoryTCMallocStatsChart = module.Chart{
            ID:       "memory_tcmalloc_stats",
            Title:    "TCMalloc statistics",
            Units:    "bytes",
            Fam:      "memory",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 4 other locations - About 55 mins to fix
    src/go/collectors/go.d.plugin/modules/elasticsearch/charts.go on lines 570..585
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 776..791
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 453..468
    src/go/collectors/go.d.plugin/modules/nvme/charts.go on lines 120..135

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

    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

        chartConnectionsByStateCount = module.Chart{
            ID:       "connections_by_state_count",
            Title:    "Connections By State",
            Units:    "connections",
            Fam:      "connections",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 6 other locations - About 45 mins to fix
    src/go/collectors/go.d.plugin/modules/docker/charts.go on lines 47..61
    src/go/collectors/go.d.plugin/modules/docker/charts.go on lines 115..129
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 680..694
    src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 305..319
    src/go/collectors/go.d.plugin/modules/rabbitmq/charts.go on lines 100..114
    src/go/collectors/go.d.plugin/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 6 locations. Consider refactoring.
    Open

        chartTransactionsReadOnlyCommitsDurationTime = module.Chart{
            ID:       "transactions_read_only_commits_duration_time",
            Title:    "Transactions successful commits duration",
            Units:    "milliseconds",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 451..462
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 477..488
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 503..514
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 555..566
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 581..592

    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

        chartTransactionsTwoPhaseCommitCommitsDurationTime = module.Chart{
            ID:       "transactions_two_phase_commit_commits_duration_time",
            Title:    "Transactions successful commits duration",
            Units:    "milliseconds",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 451..462
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 477..488
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 503..514
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 529..540
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 581..592

    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

        chartTransactionsSingleShardCommitsDurationTime = module.Chart{
            ID:       "transactions_single_shard_commits_duration_time",
            Title:    "Transactions successful commits duration",
            Units:    "milliseconds",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 451..462
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 503..514
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 529..540
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 555..566
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 581..592

    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

        chartTransactionsSingleWriteShardCommitsDurationTime = module.Chart{
            ID:       "transactions_single_write_shard_commits_duration_time",
            Title:    "Transactions successful commits duration",
            Units:    "milliseconds",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 451..462
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 477..488
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 529..540
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 555..566
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 581..592

    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

        chartTransactionsRecoverWithTokenCommitsDurationTime = module.Chart{
            ID:       "transactions_recover_with_token_commits_duration_time",
            Title:    "Transactions successful commits duration",
            Units:    "milliseconds",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 451..462
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 477..488
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 503..514
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 529..540
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 555..566

    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

        chartTransactionsNoShardsCommitsDurationTime = module.Chart{
            ID:       "transactions_no_shards_commits_duration_time",
            Title:    "Transactions successful commits duration",
            Units:    "milliseconds",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 5 other locations - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 477..488
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 503..514
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 529..540
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 555..566
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 581..592

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

        chartWiredTigerCacheEvictionsRate = module.Chart{
            ID:       "wiredtiger_cache_eviction_rate",
            Title:    "Wired Tiger cache evictions",
            Units:    "pages/s",
            Fam:      "wiredtiger",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 7 other locations - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/elasticsearch/charts.go on lines 145..157
    src/go/collectors/go.d.plugin/modules/elasticsearch/charts.go on lines 171..183
    src/go/collectors/go.d.plugin/modules/elasticsearch/charts.go on lines 400..412
    src/go/collectors/go.d.plugin/modules/elasticsearch/charts.go on lines 413..425
    src/go/collectors/go.d.plugin/modules/elasticsearch/charts.go on lines 666..678
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 1067..1079
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 1105..1117

    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

        chartNetworkTrafficRate = module.Chart{
            ID:       "network_traffic",
            Title:    "Network traffic",
            Units:    "bytes/s",
            Fam:      "network",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/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/cassandra/charts.go on lines 203..215
    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 2 locations. Consider refactoring.
    Open

    var chartsServerStatus = module.Charts{
        chartOperationsByTypeRate.Copy(),
        chartDocumentOperationsRate.Copy(),
        chartScannedIndexesRate.Copy(),
        chartScannedDocumentsRate.Copy(),
    Severity: Minor
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 1 other location - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 685..699

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

        chartTransactionsCount = module.Chart{
            ID:       "transactions_count",
            Title:    "Current transactions",
            Units:    "transactions",
            Fam:      "transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mongodb/charts.go and 11 other locations - About 30 mins to fix
    src/go/collectors/go.d.plugin/modules/consul/charts.go on lines 246..259
    src/go/collectors/go.d.plugin/modules/consul/charts.go on lines 530..543
    src/go/collectors/go.d.plugin/modules/consul/charts.go on lines 544..557
    src/go/collectors/go.d.plugin/modules/envoy/charts.go on lines 92..105
    src/go/collectors/go.d.plugin/modules/nvidia_smi/charts.go on lines 221..234
    src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 503..516
    src/go/collectors/go.d.plugin/modules/proxysql/charts.go on lines 617..630
    src/go/collectors/go.d.plugin/modules/redis/charts.go on lines 88..101
    src/go/collectors/go.d.plugin/modules/vsphere/charts.go on lines 86..99
    src/go/collectors/go.d.plugin/modules/vsphere/charts.go on lines 188..201
    src/go/collectors/go.d.plugin/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