Showing 1,088 of 2,665 total issues
Manager
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
func (m *Manager) dyncfgModuleCreate(name string) {
id := dyncfgModID(name)
path := dyncfgPath
cmds := dyncfgModCmds()
typ := "template"
HTTPHeaderDict
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class HTTPHeaderDict(MutableMapping):
"""
:param headers:
An iterable of field-value pairs. Must not contain multiple field names
when compared case-insensitively.
Method Cassandra.processMetric
has 79 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c *Cassandra) processMetric(mx map[string]int64) {
c.mx.clientReqTotalLatencyReads.write(mx, "client_request_total_latency_reads")
c.mx.clientReqTotalLatencyWrites.write(mx, "client_request_total_latency_writes")
c.mx.clientReqLatencyReads.write(mx, "client_request_latency_reads")
c.mx.clientReqLatencyWrites.write(mx, "client_request_latency_writes")
File registry.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Registry of netdata hosts
NETDATA.registry = {
server: null, // the netdata registry server
Function parseSsacliControllersInfo
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
func parseSsacliControllersInfo(data []byte) (map[string]*hpssaController, error) {
var (
cntrl *hpssaController
arr *hpssaArray
ld *hpssaLogicalDrive
Function access
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
access: function (max_redirects, callback) {
let name = NETDATA.registry.MASKED_DATA;
let url = NETDATA.registry.MASKED_DATA;
if (!NETDATA.registry.isUsingGlobalRegistry()) {
Method SystemdUnits.collectUnits
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
func (s *SystemdUnits) collectUnits(mx map[string]int64, conn systemdConnection) error {
var units []dbus.UnitStatus
var err error
if s.systemdVersion >= 230 {
- Read upRead up
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.collectProcess
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
func (w *Windows) collectProcess(mx map[string]int64, pms prometheus.Series) {
if !w.cache.collection[collectorProcess] {
w.cache.collection[collectorProcess] = true
w.addProcessesCharts()
}
- Read upRead up
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 morrisInitialize
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.morrisInitialize = function(callback) {
if (typeof netdataNoMorris === 'undefined' || !netdataNoMorris) {
// morris requires raphael
if (!NETDATA.chartLibraries.raphael.initialized) {
- Read upRead up
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 c3Initialize
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.c3Initialize = function(callback) {
if (typeof netdataNoC3 === 'undefined' || !netdataNoC3) {
// C3 requires D3
if (!NETDATA.chartLibraries.d3.initialized) {
- Read upRead up
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 d3pieInitialize
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.d3pieInitialize = function (callback) {
if (typeof netdataNoD3pie === 'undefined' || !netdataNoD3pie) {
// d3pie requires D3
if (!NETDATA.chartLibraries.d3.initialized) {
- Read upRead up
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 expect_node
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def expect_node(self, root=False, sequence=False, mapping=False,
simple_key=False):
self.root_context = root
self.sequence_context = sequence
self.mapping_context = mapping
- Read upRead up
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 select
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def select(self, timeout=None):
# Selecting on empty lists on Windows errors out.
if not len(self._readers) and not len(self._writers):
return []
- Read upRead up
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 parseStatusLine
has 77 lines of code (exceeds 50 allowed). Consider refactoring. Open
func parseStatusLine(line string, lineFormat []string) (*metric, error) {
parts := strings.Split(line, ",")
// NOTE: only default line format is supported
// TODO: custom line format?
Method nvidiaSmiLoopExec.run
has 76 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (e *nvidiaSmiLoopExec) run() error {
secs := 5
if e.updateEvery < secs {
secs = e.updateEvery
}
Method Envoy.collectClusterUpstreamStats
has 75 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (e *Envoy) collectClusterUpstreamStats(mx map[string]int64, mfs prometheus.MetricFamilies) {
seen := make(map[string]bool)
for _, n := range []string{
"envoy_cluster_upstream_cx_total",
"envoy_cluster_upstream_cx_http1_total",
Function computeLinePosition
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
computeLinePosition: function(pie, i) {
var angle = segments.getSegmentAngle(i, pie.options.data.content, pie.totalSize, { midpoint: true });
var originCoords = math.rotate(pie.pieCenter.x, pie.pieCenter.y - pie.outerRadius, pie.pieCenter.x, pie.pieCenter.y, angle);
var heightOffset = pie.outerLabelGroupData[i].h / 5; // TODO check
var labelXMargin = 6; // the x-distance of the label from the end of the line [TODO configurable]
Function mousedown
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
mousedown: function (event, dygraph, context) {
if (NETDATA.options.debug.dygraph || state.debug) {
state.log('interactionModel.mousedown()');
}
Function access
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
access: function (max_redirects, callback) {
let name = NETDATA.registry.hostname;
let url = NETDATA.serverDefault;
console.log("ACCESS", name, url);
Function mousedown
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
mousedown: function (event, dygraph, context) {
if (NETDATA.options.debug.dygraph || state.debug) {
state.log('interactionModel.mousedown()');
}