netdata/netdata

View on GitHub
src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go

Summary

Maintainability
D
1 day
Test Coverage

File dyncfg.go has 613 lines of code (exceeds 500 allowed). Consider refactoring.
Open

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

package jobmgr

import (
Severity: Minor
Found in src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go - About 4 hrs to fix

    Method Manager.dyncfgConfigUpdate has 73 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (m *Manager) dyncfgConfigUpdate(fn functions.Function) {
        id := fn.Args[0]
        mn, jn, ok := extractModuleJobName(id)
        if !ok {
            m.Warningf("dyncfg: update: could not extract module from id (%s)", id)
    Severity: Minor
    Found in src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go - About 1 hr to fix

      Method Manager.dyncfgConfigEnable has 65 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (m *Manager) dyncfgConfigEnable(fn functions.Function) {
          id := fn.Args[0]
          mn, jn, ok := extractModuleJobName(id)
          if !ok {
              m.Warningf("dyncfg: enable: could not extract module and job from id (%s)", id)
      Severity: Minor
      Found in src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go - About 1 hr to fix

        Method Manager.dyncfgConfigRestart has 53 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func (m *Manager) dyncfgConfigRestart(fn functions.Function) {
            id := fn.Args[0]
            mn, jn, ok := extractModuleJobName(id)
            if !ok {
                m.Warningf("dyncfg: restart: could not extract module from id (%s)", id)
        Severity: Minor
        Found in src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go - About 1 hr to fix

          Method Manager.dyncfgConfigUpdate has 9 return statements (exceeds 4 allowed).
          Open

          func (m *Manager) dyncfgConfigUpdate(fn functions.Function) {
              id := fn.Args[0]
              mn, jn, ok := extractModuleJobName(id)
              if !ok {
                  m.Warningf("dyncfg: update: could not extract module from id (%s)", id)
          Severity: Major
          Found in src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go - About 55 mins to fix

            Method Manager.dyncfgConfigTest has 7 return statements (exceeds 4 allowed).
            Open

            func (m *Manager) dyncfgConfigTest(fn functions.Function) {
                id := fn.Args[0]
                mn, ok := extractModuleName(id)
                if !ok {
                    m.Warningf("dyncfg: test: could not extract module and job from id (%s)", id)
            Severity: Major
            Found in src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go - About 45 mins to fix

              Method Manager.dyncfgConfigEnable has 6 return statements (exceeds 4 allowed).
              Open

              func (m *Manager) dyncfgConfigEnable(fn functions.Function) {
                  id := fn.Args[0]
                  mn, jn, ok := extractModuleJobName(id)
                  if !ok {
                      m.Warningf("dyncfg: enable: could not extract module and job from id (%s)", id)
              Severity: Major
              Found in src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go - About 40 mins to fix

                Method Manager.dyncfgConfigRestart has 6 return statements (exceeds 4 allowed).
                Open

                func (m *Manager) dyncfgConfigRestart(fn functions.Function) {
                    id := fn.Args[0]
                    mn, jn, ok := extractModuleJobName(id)
                    if !ok {
                        m.Warningf("dyncfg: restart: could not extract module from id (%s)", id)
                Severity: Major
                Found in src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go - About 40 mins to fix

                  Method Manager.dyncfgConfigGet has 6 return statements (exceeds 4 allowed).
                  Open

                  func (m *Manager) dyncfgConfigGet(fn functions.Function) {
                      id := fn.Args[0]
                      mn, jn, ok := extractModuleJobName(id)
                      if !ok {
                          m.Warningf("dyncfg: get: could not extract module and job from id (%s)", id)
                  Severity: Major
                  Found in src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go - About 40 mins to fix

                    Method Manager.dyncfgConfigAdd has 5 return statements (exceeds 4 allowed).
                    Open

                    func (m *Manager) dyncfgConfigAdd(fn functions.Function) {
                        if len(fn.Args) < 3 {
                            m.Warningf("dyncfg: add: missing required arguments, want 3 got %d", len(fn.Args))
                            m.dyncfgRespf(fn, 400, "Missing required arguments. Need at least 3, but got %d.", len(fn.Args))
                            return
                    Severity: Major
                    Found in src/go/collectors/go.d.plugin/agent/jobmgr/dyncfg.go - About 35 mins to fix

                      There are no issues that match your filters.

                      Category
                      Status