netdata/netdata

View on GitHub

Showing 1,761 of 3,008 total issues

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

    adfsOAuthClientAuthenticationsChart = module.Chart{
        OverModule: "adfs",
        ID:         "adfs_oauth_client_authentications",
        Title:      "OAuth client authentications",
        Units:      "authentications/s",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/windows/charts.go and 20 other locations - About 30 mins to fix
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 941..953
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2012..2024
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2075..2087
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2088..2100
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2101..2113
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2114..2126
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2127..2139
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2140..2152
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2153..2165
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2203..2215
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2240..2252
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2265..2277
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3929..3941
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3978..3990
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3991..4003
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4049..4061
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4062..4074
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4075..4087
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4088..4100
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4101..4113

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

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

    hypervVswitchDirectedPacketsChartTmpl = module.Chart{
        OverModule: "hyperv",
        ID:         "vswitch_%s_directed_packets",
        Title:      "Virtual switch directed packets",
        Units:      "packets/s",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/windows/charts.go and 20 other locations - About 30 mins to fix
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 941..953
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2012..2024
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2062..2074
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2075..2087
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2088..2100
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2101..2113
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2114..2126
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2127..2139
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2140..2152
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2153..2165
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2203..2215
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2240..2252
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2265..2277
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3929..3941
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3978..3990
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3991..4003
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4062..4074
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4075..4087
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4088..4100
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4101..4113

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

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

    hypervVswitchDroppedPacketsChartTmpl = module.Chart{
        OverModule: "hyperv",
        ID:         "vswitch_%s_dropped_packets",
        Title:      "Virtual switch dropped packets",
        Units:      "drops/s",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/windows/charts.go and 20 other locations - About 30 mins to fix
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 941..953
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2012..2024
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2062..2074
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2075..2087
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2088..2100
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2101..2113
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2114..2126
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2127..2139
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2140..2152
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2153..2165
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2203..2215
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2240..2252
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2265..2277
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3929..3941
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3978..3990
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3991..4003
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4049..4061
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4062..4074
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4075..4087
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4101..4113

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

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

    adfsOAuthPasswordGrantRequestsChart = module.Chart{
        OverModule: "adfs",
        ID:         "adfs_oauth_password_grant_requests",
        Title:      "OAuth password grant requests",
        Units:      "requests/s",
Severity: Major
Found in src/go/collectors/go.d.plugin/modules/windows/charts.go and 20 other locations - About 30 mins to fix
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 941..953
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2012..2024
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2062..2074
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2075..2087
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2088..2100
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2101..2113
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2114..2126
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2127..2139
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2140..2152
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2203..2215
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2240..2252
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 2265..2277
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3929..3941
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3978..3990
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 3991..4003
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4049..4061
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4062..4074
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4075..4087
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4088..4100
src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4101..4113

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

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 (f *Filecheck) removeFileOtherCharts(filePath string) {
    px := fmt.Sprintf("file_%s_", cleanPath(filePath))
    f.removeCharts(func(id string) bool {
        return strings.HasPrefix(id, px) && !strings.HasSuffix(id, "existence_status")
    })
Severity: Minor
Found in src/go/collectors/go.d.plugin/modules/filecheck/charts.go and 1 other location - About 30 mins to fix
src/go/collectors/go.d.plugin/modules/filecheck/charts.go on lines 246..251

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

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 (f *Filecheck) removeDirOtherCharts(dirPath string) {
    px := fmt.Sprintf("dir_%s_", cleanPath(dirPath))
    f.removeCharts(func(id string) bool {
        return strings.HasPrefix(id, px) && !strings.HasSuffix(id, "existence_status")
    })
Severity: Minor
Found in src/go/collectors/go.d.plugin/modules/filecheck/charts.go and 1 other location - About 30 mins to fix
src/go/collectors/go.d.plugin/modules/filecheck/charts.go on lines 232..237

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 101.

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 sessionsStateChart = module.Chart{
    ID:       "sessions_state",
    Title:    "Logind Sessions By State",
    Units:    "sessions",
    Fam:      "sessions",
Severity: Minor
Found in src/go/collectors/go.d.plugin/modules/logind/charts.go and 1 other location - About 30 mins to fix
src/go/collectors/go.d.plugin/modules/logind/charts.go on lines 38..51

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

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 sessionsTypeChart = module.Chart{
    ID:       "sessions_type",
    Title:    "Logind Sessions By Type",
    Units:    "sessions",
    Fam:      "sessions",
Severity: Minor
Found in src/go/collectors/go.d.plugin/modules/logind/charts.go and 1 other location - About 30 mins to fix
src/go/collectors/go.d.plugin/modules/logind/charts.go on lines 53..66

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

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

    _, _ = pod.AddEventHandler(cache.ResourceEventHandlerFuncs{
        AddFunc:    func(obj any) { enqueue(queue, obj) },
        UpdateFunc: func(_, obj any) { enqueue(queue, obj) },
        DeleteFunc: func(obj any) { enqueue(queue, obj) },
    })
src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/service.go on lines 65..69

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

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

    _, _ = inf.AddEventHandler(cache.ResourceEventHandlerFuncs{
        AddFunc:    func(obj any) { enqueue(queue, obj) },
        UpdateFunc: func(_, obj any) { enqueue(queue, obj) },
        DeleteFunc: func(obj any) { enqueue(queue, obj) },
    })
src/go/collectors/go.d.plugin/agent/discovery/sd/discoverer/kubernetes/pod.go on lines 63..67

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

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

    'nginx.requests': {
        colors: NETDATA.colors[0],
        mainheads: [
            netdataDashboard.gaugeChart('Requests', '12%', '', NETDATA.colors[0])
        ]
Severity: Major
Found in src/web/gui/dashboard_info.js and 4 other locations - About 30 mins to fix
src/web/gui/dashboard_info.js on lines 4696..4701
src/web/gui/dashboard_info.js on lines 4703..4708
src/web/gui/dashboard_info.js on lines 4757..4762
src/web/gui/dashboard_info.js on lines 4764..4769

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

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

    'apache.net': {
        colors: NETDATA.colors[3],
        mainheads: [
            netdataDashboard.gaugeChart('Bandwidth', '12%', '', NETDATA.colors[3])
        ]
Severity: Major
Found in src/web/gui/dashboard_info.js and 4 other locations - About 30 mins to fix
src/web/gui/dashboard_info.js on lines 4696..4701
src/web/gui/dashboard_info.js on lines 4757..4762
src/web/gui/dashboard_info.js on lines 4764..4769
src/web/gui/dashboard_info.js on lines 4817..4822

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

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

    'apache.requests': {
        colors: NETDATA.colors[0],
        mainheads: [
            netdataDashboard.gaugeChart('Requests', '12%', '', NETDATA.colors[0])
        ]
Severity: Major
Found in src/web/gui/dashboard_info.js and 4 other locations - About 30 mins to fix
src/web/gui/dashboard_info.js on lines 4703..4708
src/web/gui/dashboard_info.js on lines 4757..4762
src/web/gui/dashboard_info.js on lines 4764..4769
src/web/gui/dashboard_info.js on lines 4817..4822

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

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

    'lighttpd.requests': {
        colors: NETDATA.colors[0],
        mainheads: [
            netdataDashboard.gaugeChart('Requests', '12%', '', NETDATA.colors[0])
        ]
Severity: Major
Found in src/web/gui/dashboard_info.js and 4 other locations - About 30 mins to fix
src/web/gui/dashboard_info.js on lines 4696..4701
src/web/gui/dashboard_info.js on lines 4703..4708
src/web/gui/dashboard_info.js on lines 4764..4769
src/web/gui/dashboard_info.js on lines 4817..4822

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

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

    'lighttpd.net': {
        colors: NETDATA.colors[3],
        mainheads: [
            netdataDashboard.gaugeChart('Bandwidth', '12%', '', NETDATA.colors[3])
        ]
Severity: Major
Found in src/web/gui/dashboard_info.js and 4 other locations - About 30 mins to fix
src/web/gui/dashboard_info.js on lines 4696..4701
src/web/gui/dashboard_info.js on lines 4703..4708
src/web/gui/dashboard_info.js on lines 4757..4762
src/web/gui/dashboard_info.js on lines 4817..4822

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

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

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

    def construct_yaml_seq(self, node):
        data = []
        yield data
        data.extend(self.construct_sequence(node))
src/collectors/python.d.plugin/python_modules/pyyaml3/constructor.py on lines 391..394

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

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

                stat_data['_'.join(['backend', metric, idx])] = backend.get(metric) or 0
Severity: Minor
Found in src/collectors/python.d.plugin/haproxy/haproxy.chart.py and 2 other locations - About 30 mins to fix
src/collectors/python.d.plugin/haproxy/haproxy.chart.py on lines 267..267
src/collectors/python.d.plugin/haproxy/haproxy.chart.py on lines 278..279

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

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

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

    def represent_bool(self, data):
        if data:
            value = 'true'
        else:
            value = 'false'
src/collectors/python.d.plugin/python_modules/pyyaml2/representer.py on lines 171..176

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

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

def handle_attr_error(method):
    def on_call(*args, **kwargs):
        try:
            return method(*args, **kwargs)
        except AttributeError:
Severity: Minor
Found in src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py and 1 other location - About 30 mins to fix
src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py on lines 281..288

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

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

function loadClipboard(callback) {
    if (clipboardLoaded === false) {
        clipboardLoaded = true;
        loadJs('lib/clipboard-polyfill-be05dad.js', callback);
    } else {
Severity: Minor
Found in src/web/gui/main.js and 1 other location - About 30 mins to fix
src/web/gui/main.js on lines 2010..2017

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

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

Severity
Category
Status
Source
Language