netdata/netdata

View on GitHub

Showing 1,247 of 3,008 total issues

Avoid too many return statements within this function.
Open

            return True

    Avoid too many return statements within this function.
    Open

                return sign*int(value)
    Severity: Major
    Found in src/collectors/python.d.plugin/python_modules/pyyaml2/constructor.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return ExecutableService.check(self)
      Severity: Major
      Found in src/collectors/python.d.plugin/samba/samba.chart.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return True

          Avoid too many return statements within this function.
          Open

                  return False

            Avoid too many return statements within this function.
            Open

                    return False

              Avoid too many return statements within this function.
              Open

                      return 1
              Severity: Major
              Found in integrations/check_collector_metadata.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return 0
                Severity: Major
                Found in integrations/check_collector_metadata.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return 2
                  Severity: Major
                  Found in integrations/check_collector_metadata.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return 1
                    Severity: Major
                    Found in integrations/check_collector_metadata.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return False
                      Severity: Major
                      Found in src/collectors/python.d.plugin/ceph/ceph.chart.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return False
                        Severity: Major
                        Found in src/collectors/python.d.plugin/ceph/ceph.chart.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return True
                          Severity: Major
                          Found in src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return True
                            Severity: Major
                            Found in src/collectors/python.d.plugin/ceph/ceph.chart.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return False
                              Severity: Major
                              Found in src/collectors/python.d.plugin/ceph/ceph.chart.py - About 30 mins to fix

                                Method Job.processMetrics has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                                Open

                                func (j *Job) processMetrics(metrics map[string]int64, startTime time.Time, sinceLastRun int) bool {
                                    if !vnodes.Disabled {
                                        if !j.vnodeCreated && j.vnodeGUID != "" {
                                            _ = j.api.HOSTINFO(j.vnodeGUID, j.vnodeHostname, j.vnodeLabels)
                                            j.vnodeCreated = true
                                Severity: Minor
                                Found in src/go/collectors/go.d.plugin/agent/module/job.go - About 25 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Function localStorageTest has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                NETDATA.localStorageTest = function () {
                                    if (NETDATA.localStorageTested !== -1) {
                                        return NETDATA.localStorageTested;
                                    }
                                
                                
                                Severity: Minor
                                Found in src/web/gui/src/dashboard.js/localstorage.js - About 25 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Method Windows.collectCPU has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                                Open

                                func (w *Windows) collectCPU(mx map[string]int64, pms prometheus.Series) {
                                    if !w.cache.collection[collectorCPU] {
                                        w.cache.collection[collectorCPU] = true
                                        w.addCPUCharts()
                                    }
                                Severity: Minor
                                Found in src/go/collectors/go.d.plugin/modules/windows/collect_cpu.go - About 25 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Function loadCookieJar has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                                Open

                                func loadCookieJar(path string) (http.CookieJar, error) {
                                    file, err := os.Open(path)
                                    if err != nil {
                                        return nil, err
                                    }
                                Severity: Minor
                                Found in src/go/collectors/go.d.plugin/modules/httpcheck/cookiejar.go - About 25 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Method Traefik.collectEntrypointRequestDuration has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                                Open

                                func (t *Traefik) collectEntrypointRequestDuration(mx map[string]int64, pms prometheus.Series) {
                                    if pms = pms.FindByNames(
                                        metricEntrypointRequestDurationSecondsCount,
                                        metricEntrypointRequestDurationSecondsSum,
                                    ); pms.Len() == 0 {
                                Severity: Minor
                                Found in src/go/collectors/go.d.plugin/modules/traefik/collect.go - About 25 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Severity
                                Category
                                Status
                                Source
                                Language