netdata/netdata

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

Summary

Maintainability
F
4 days
Test Coverage

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

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

package mysql

import (
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go - About 2 days to fix

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

    var baseCharts = module.Charts{
        chartBandwidth.Copy(),
        chartQueries.Copy(),
        chartQueriesType.Copy(),
        chartHandlers.Copy(),
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go and 1 other location - About 2 hrs to fix
    src/go/collectors/go.d.plugin/modules/pulsar/charts.go on lines 231..269

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

    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

        chartConnectionErrors = module.Chart{
            ID:       "connection_errors",
            Title:    "Connection Errors",
            Units:    "errors/s",
            Fam:      "connections",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go and 1 other location - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 175..190

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

        chartQueriesType = module.Chart{
            ID:       "queries_type",
            Title:    "Queries By Type",
            Units:    "queries/s",
            Fam:      "queries",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go and 1 other location - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 1051..1066

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

    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

        chartTmplUserStatsRowsOperations = module.Chart{
            ID:       "userstats_rows_%s",
            Title:    "User Rows Operations",
            Units:    "operations/s",
            Fam:      "user operations",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go and 1 other location - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 150..165

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

    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

        chartTableJoinIssues = module.Chart{
            ID:       "join_issues",
            Title:    "Table Select Join Issues",
            Units:    "joins/s",
            Fam:      "issues",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go and 1 other location - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 748..762

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

    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

    func newMariaDBUserStatisticsCharts(user string) *module.Charts {
        lcUser := strings.ToLower(user)
        charts := chartsTmplUserStats.Copy()
        for _, c := range *charts {
            c.ID = fmt.Sprintf(c.ID, lcUser)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go and 1 other location - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 999..1012

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

    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

    func newPerconaUserStatisticsCharts(user string) *module.Charts {
        lcUser := strings.ToLower(user)
        charts := chartsTmplPerconaUserStats.Copy()
        for _, c := range *charts {
            c.ID = fmt.Sprintf(c.ID, lcUser)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go and 1 other location - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 984..997

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

    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

        chartGaleraClusterState = module.Chart{
            ID:       "galera_cluster_state",
            Title:    "Cluster Component State",
            Units:    "state",
            Fam:      "galera",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/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/mongodb/charts.go on lines 374..389
    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 2 locations. Consider refactoring.
    Open

        chartGaleraBytes = module.Chart{
            ID:       "galera_bytes",
            Title:    "Replicated Bytes",
            Units:    "KiB/s",
            Fam:      "galera",
    Severity: Minor
    Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go and 1 other location - About 50 mins to fix
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 654..666

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

    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

        chartMyISAMKeyCacheDiskOperations = module.Chart{
            ID:       "key_disk_ops",
            Title:    "MyISAM Key Cache Disk Operations",
            Units:    "operations/s",
            Fam:      "myisam",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go and 6 other locations - About 40 mins to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 244..256
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 315..327
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 440..452
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 584..596
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 667..679
    src/go/collectors/go.d.plugin/modules/pgbouncer/charts.go on lines 202..214

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

    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

        chartTmplUserStatsTransactions = module.Chart{
            ID:       "userstats_transactions_%s",
            Title:    "User Transactions",
            Units:    "transactions/s",
            Fam:      "user transactions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/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/mongodb/charts.go on lines 809..821
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 1067..1079

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

        chartTmplPerconaUserStatsRowsOperations = module.Chart{
            ID:       "userstats_rows_%s",
            Title:    "User Rows Operations",
            Units:    "operations/s",
            Fam:      "user operations",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/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/mongodb/charts.go on lines 809..821
    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 2 locations. Consider refactoring.
    Open

    var chartsGalera = module.Charts{
        chartGaleraWriteSets.Copy(),
        chartGaleraBytes.Copy(),
        chartGaleraQueue.Copy(),
        chartGaleraConflicts.Copy(),
    Severity: Minor
    Found in src/go/collectors/go.d.plugin/modules/mysql/charts.go and 1 other location - About 35 mins to fix
    src/go/collectors/go.d.plugin/modules/mongodb/charts.go on lines 99..117

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

        chartTableLocks = module.Chart{
            ID:       "table_locks",
            Title:    "Table Locks",
            Units:    "locks/s",
            Fam:      "locks",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/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/cassandra/charts.go on lines 420..431
    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

        chartGaleraWriteSets = module.Chart{
            ID:       "galera_writesets",
            Title:    "Replicated Writesets",
            Units:    "writesets/s",
            Fam:      "galera",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/mysql/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/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/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