firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

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 SecurityConst.errSSLInternal

        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 0

              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 True

                    Avoid too many return statements within this function.
                    Open

                            return response
                    Severity: Major
                    Found in src/collectors/python.d.plugin/python_modules/urllib3/connectionpool.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return False

                        Avoid too many return statements within this function.
                        Open

                                return True
                        Severity: Major
                        Found in src/collectors/python.d.plugin/python_modules/urllib3/util/connection.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 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 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 0
                                Severity: Major
                                Found in integrations/check_collector_metadata.py - About 30 mins to fix

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

                                  func (m *Manager) run(ctx context.Context) {
                                      for {
                                          select {
                                          case <-ctx.Done():
                                              return
                                  Severity: Minor
                                  Found in src/go/plugin/go.d/agent/functions/manager.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 Beanstalk.collectTubesStats has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  func (b *Beanstalk) collectTubesStats(mx map[string]int64) error {
                                      now := time.Now()
                                  
                                      if now.Sub(b.lastDiscoverTubesTime) > b.discoverTubesEvery {
                                          tubes, err := b.conn.queryListTubes()
                                  Severity: Minor
                                  Found in src/go/plugin/go.d/modules/beanstalk/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

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

                                  func (r *Rethinkdb) collectStats(mx map[string]int64) error {
                                      resp, err := r.rdb.stats()
                                      if err != nil {
                                          return err
                                      }
                                  Severity: Minor
                                  Found in src/go/plugin/go.d/modules/rethinkdb/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

                                  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/plugin/go.d/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