netdata/netdata

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

Summary

Maintainability
F
5 days
Test Coverage

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

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

package nginxplus

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

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

    func (n *NginxPlus) addStreamUpstreamServerCharts(name, serverAddr, serverName, zone string) {
        charts := streamUpstreamServerChartsTmpl.Copy()
    
        for _, chart := range *charts {
            chart.ID = fmt.Sprintf(chart.ID, name, serverAddr, zone)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 1 other location - About 2 hrs to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 852..871

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

    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 (n *NginxPlus) addHTTPUpstreamServerCharts(name, serverAddr, serverName, zone string) {
        charts := httpUpstreamServerChartsTmpl.Copy()
    
        for _, chart := range *charts {
            chart.ID = fmt.Sprintf(chart.ID, name, serverAddr, zone)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 1 other location - About 2 hrs to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 925..944

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

    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 (n *NginxPlus) addHTTPUpstreamCharts(name, zone string) {
        charts := httpUpstreamChartsTmpl.Copy()
    
        for _, chart := range *charts {
            chart.ID = fmt.Sprintf(chart.ID, name, zone)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 1 other location - About 2 hrs to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 901..918

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

    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 (n *NginxPlus) addStreamUpstreamCharts(zone, name string) {
        charts := streamUpstreamChartsTmpl.Copy()
    
        for _, chart := range *charts {
            chart.ID = fmt.Sprintf(chart.ID, zone, name)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 1 other location - About 2 hrs to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 828..845

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

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

    func (n *NginxPlus) addHTTPServerZoneCharts(zone string) {
        charts := httpServerZoneChartsTmpl.Copy()
    
        for _, chart := range *charts {
            chart.ID = fmt.Sprintf(chart.ID, zone)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 22 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/fail2ban/charts.go on lines 49..65
    src/go/collectors/go.d.plugin/modules/logstash/charts.go on lines 211..227
    src/go/collectors/go.d.plugin/modules/mongodb/collect_dbstats.go on lines 73..89
    src/go/collectors/go.d.plugin/modules/mongodb/collect_sharding.go on lines 66..83
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 759..775
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 805..821
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 878..894
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 951..967
    src/go/collectors/go.d.plugin/modules/nvme/charts.go on lines 240..256
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4191..4207
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4222..4238
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4245..4261
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4316..4332
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4339..4355
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4362..4378
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4385..4401
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4408..4424
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4455..4471
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4494..4510
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4776..4792
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4799..4815
    src/go/collectors/go.d.plugin/modules/zfspool/charts.go on lines 88..104

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

    func (n *NginxPlus) addStreamServerZoneCharts(zone string) {
        charts := streamServerZoneChartsTmpl.Copy()
    
        for _, chart := range *charts {
            chart.ID = fmt.Sprintf(chart.ID, zone)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 22 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/fail2ban/charts.go on lines 49..65
    src/go/collectors/go.d.plugin/modules/logstash/charts.go on lines 211..227
    src/go/collectors/go.d.plugin/modules/mongodb/collect_dbstats.go on lines 73..89
    src/go/collectors/go.d.plugin/modules/mongodb/collect_sharding.go on lines 66..83
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 759..775
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 782..798
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 805..821
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 951..967
    src/go/collectors/go.d.plugin/modules/nvme/charts.go on lines 240..256
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4191..4207
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4222..4238
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4245..4261
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4316..4332
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4339..4355
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4362..4378
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4385..4401
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4408..4424
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4455..4471
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4494..4510
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4776..4792
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4799..4815
    src/go/collectors/go.d.plugin/modules/zfspool/charts.go on lines 88..104

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

    func (n *NginxPlus) addHTTPCacheCharts(name string) {
        charts := httpCacheChartsTmpl.Copy()
    
        for _, chart := range *charts {
            chart.ID = fmt.Sprintf(chart.ID, name)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 22 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/fail2ban/charts.go on lines 49..65
    src/go/collectors/go.d.plugin/modules/logstash/charts.go on lines 211..227
    src/go/collectors/go.d.plugin/modules/mongodb/collect_dbstats.go on lines 73..89
    src/go/collectors/go.d.plugin/modules/mongodb/collect_sharding.go on lines 66..83
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 782..798
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 805..821
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 878..894
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 951..967
    src/go/collectors/go.d.plugin/modules/nvme/charts.go on lines 240..256
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4191..4207
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4222..4238
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4245..4261
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4316..4332
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4339..4355
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4362..4378
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4385..4401
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4408..4424
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4455..4471
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4494..4510
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4776..4792
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4799..4815
    src/go/collectors/go.d.plugin/modules/zfspool/charts.go on lines 88..104

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

    func (n *NginxPlus) addHTTPLocationZoneCharts(zone string) {
        charts := httpLocationZoneChartsTmpl.Copy()
    
        for _, chart := range *charts {
            chart.ID = fmt.Sprintf(chart.ID, zone)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 22 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/fail2ban/charts.go on lines 49..65
    src/go/collectors/go.d.plugin/modules/logstash/charts.go on lines 211..227
    src/go/collectors/go.d.plugin/modules/mongodb/collect_dbstats.go on lines 73..89
    src/go/collectors/go.d.plugin/modules/mongodb/collect_sharding.go on lines 66..83
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 759..775
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 782..798
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 878..894
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 951..967
    src/go/collectors/go.d.plugin/modules/nvme/charts.go on lines 240..256
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4191..4207
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4222..4238
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4245..4261
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4316..4332
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4339..4355
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4362..4378
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4385..4401
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4408..4424
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4455..4471
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4494..4510
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4776..4792
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4799..4815
    src/go/collectors/go.d.plugin/modules/zfspool/charts.go on lines 88..104

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

    func (n *NginxPlus) addResolverZoneCharts(zone string) {
        charts := resolverZoneChartsTmpl.Copy()
    
        for _, chart := range *charts {
            chart.ID = fmt.Sprintf(chart.ID, zone)
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 22 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/fail2ban/charts.go on lines 49..65
    src/go/collectors/go.d.plugin/modules/logstash/charts.go on lines 211..227
    src/go/collectors/go.d.plugin/modules/mongodb/collect_dbstats.go on lines 73..89
    src/go/collectors/go.d.plugin/modules/mongodb/collect_sharding.go on lines 66..83
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 759..775
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 782..798
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 805..821
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 878..894
    src/go/collectors/go.d.plugin/modules/nvme/charts.go on lines 240..256
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4191..4207
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4222..4238
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4245..4261
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4316..4332
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4339..4355
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4362..4378
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4385..4401
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4408..4424
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4455..4471
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4494..4510
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4776..4792
    src/go/collectors/go.d.plugin/modules/windows/charts.go on lines 4799..4815
    src/go/collectors/go.d.plugin/modules/zfspool/charts.go on lines 88..104

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

        httpServerZoneResponsesPerCodeClassRateChartTmpl = module.Chart{
            ID:       "http_server_zone_%s_responses_per_code_class_rate",
            Title:    "HTTP Server Zone responses rate",
            Units:    "responses/s",
            Fam:      "http responses",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 3 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 147..162
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 299..314
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 402..417

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

        httpLocationZoneResponsesPerCodeClassRateChartTmpl = module.Chart{
            ID:       "http_location_zone_%s_responses_per_code_class_rate",
            Title:    "HTTP Location Zone responses rate",
            Units:    "responses/s",
            Fam:      "http responses",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 3 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 147..162
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 228..243
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 402..417

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

        httpUpstreamServerResponsesPerCodeClassRateChartTmpl = module.Chart{
            ID:       "http_upstream_%s_server_%s_zone_%s_responses_per_code_class_rate",
            Title:    "HTTP Upstream Server responses",
            Units:    "responses/s",
            Fam:      "http upstream responses",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 3 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 147..162
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 228..243
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 299..314

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

        sslVerificationErrorsRateChart = module.Chart{
            ID:       "ssl_verification_errors_rate",
            Title:    "SSL verification errors rate",
            Units:    "errors/s",
            Fam:      "ssl",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 3 other locations - About 1 hr to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 228..243
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 299..314
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 402..417

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

        resolverZoneRequestsRateChartTmpl = module.Chart{
            ID:       "resolver_zone_%s_requests_rate",
            Title:    "Resolver requests rate",
            Units:    "requests/s",
            Fam:      "resolver requests",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 5 other locations - About 55 mins to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 570..583
    src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 229..242
    src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 934..947
    src/go/collectors/go.d.plugin/modules/proxysql/charts.go on lines 233..246
    src/go/collectors/go.d.plugin/modules/proxysql/charts.go on lines 259..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 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 6 locations. Consider refactoring.
    Open

        streamServerZoneSessionsPerCodeClassRateChartTmpl = module.Chart{
            ID:       "stream_server_zone_%s_sessions_per_code_class_rate",
            Title:    "Stream Server Zone sessions rate",
            Units:    "sessions/s",
            Fam:      "stream sessions",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 5 other locations - About 55 mins to fix
    src/go/collectors/go.d.plugin/modules/nginxplus/charts.go on lines 724..737
    src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 229..242
    src/go/collectors/go.d.plugin/modules/postgres/charts.go on lines 934..947
    src/go/collectors/go.d.plugin/modules/proxysql/charts.go on lines 233..246
    src/go/collectors/go.d.plugin/modules/proxysql/charts.go on lines 259..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 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 5 locations. Consider refactoring.
    Open

        httpUpstreamServerStateChartTmpl = module.Chart{
            ID:       "http_upstream_%s_server_%s_zone_%s_state",
            Title:    "HTTP Upstream Server state",
            Units:    "state",
            Fam:      "http upstream state",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/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/mysql/charts.go on lines 776..791
    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

        streamUpstreamServerStateChartTmpl = module.Chart{
            ID:       "stream_upstream_%s_server_%s_zone_%s_state",
            Title:    "Stream Upstream Server state",
            Units:    "state",
            Fam:      "stream upstream state",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/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/mongodb/charts.go on lines 267..281
    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 7 locations. Consider refactoring.
    Open

        httpServerZoneTrafficRateChartTmpl = module.Chart{
            ID:       "http_server_zone_%s_traffic_rate",
            Title:    "HTTP Server Zone traffic",
            Units:    "bytes/s",
            Fam:      "http traffic",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 6 other locations - About 40 mins to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 892..904
    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 7 locations. Consider refactoring.
    Open

        streamServerZoneTrafficRateChartTmpl = module.Chart{
            ID:       "stream_server_zone_%s_traffic_rate",
            Title:    "Stream Server Zone traffic rate",
            Units:    "bytes/s",
            Fam:      "stream traffic",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 6 other locations - About 40 mins to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 892..904
    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 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 7 locations. Consider refactoring.
    Open

        httpUpstreamServerTrafficRateChartTmpl = module.Chart{
            ID:       "http_upstream_%s_server_%s_zone_%s_traffic_rate",
            Title:    "HTTP Upstream Server traffic rate",
            Units:    "bytes/s",
            Fam:      "http upstream traffic",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 6 other locations - About 40 mins to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 892..904
    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 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 7 locations. Consider refactoring.
    Open

        httpLocationZoneTrafficRateChartTmpl = module.Chart{
            ID:       "http_location_zone_%s_traffic_rate",
            Title:    "HTTP Location Zone traffic rate",
            Units:    "bytes/s",
            Fam:      "http traffic",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 6 other locations - About 40 mins to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 892..904
    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 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 7 locations. Consider refactoring.
    Open

        streamUpstreamServerTrafficRateChartTmpl = module.Chart{
            ID:       "stream_upstream_%s_server_%s_zone_%s_traffic_rate",
            Title:    "Stream Upstream Server traffic rate",
            Units:    "bytes/s",
            Fam:      "stream upstream traffic",
    Severity: Major
    Found in src/go/collectors/go.d.plugin/modules/nginxplus/charts.go and 6 other locations - About 40 mins to fix
    src/go/collectors/go.d.plugin/modules/mysql/charts.go on lines 892..904
    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/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

    There are no issues that match your filters.

    Category
    Status