Showing 1,088 of 2,665 total issues
File job.go
has 541 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package module
import (
File retry.py
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
from __future__ import absolute_import
import time
import logging
from collections import namedtuple
Function alarm_to_html
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function alarm_to_html(alarm, full) {
var chart = options.data.charts[alarm.chart];
if (typeof (chart) === 'undefined') {
chart = options.data.charts_by_name[alarm.chart];
if (typeof (chart) === 'undefined') {
Function seconds4human
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.seconds4human = function (seconds, options) {
let defaultOptions = {
now: 'now',
space: ' ',
negative_suffix: 'ago',
- 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 gaugeChartCreate
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.gaugeChartCreate = function (state, data) {
// let chart = $(state.element_chart);
let value = data.result[0];
let min = NETDATA.dataAttribute(state.element, 'gauge-min-value', null);
- 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 renderStreamedHosts
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function renderStreamedHosts(options) {
let html = `<div class="info-item">Databases streamed to this agent</div>`;
var base = document.location.origin.toString() +
document.location.pathname.toString()
- 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 fetch_more_tokens
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def fetch_more_tokens(self):
# Eat whitespaces and comments until we reach the next token.
self.scan_to_next_token()
- 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 scan_plain
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def scan_plain(self):
# See the specification for details.
# We add an additional restriction for the flow context:
# plain scalars in the flow context cannot contain ',', ':' and '?'.
# We also keep track of the `allow_simple_key` flag here.
- 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 prepare_tag
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def prepare_tag(self, tag):
if not tag:
raise EmitterError("tag must not be empty")
if tag == '!':
return tag
- 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
File alarms.js
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Registry of netdata hosts
NETDATA.alarms = {
onclick: null, // the callback to handle the click - it will be called with the alarm log entry
File SocketService.py
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Description:
# Author: Pawel Krupa (paulfantom)
# Author: Ilya Mashchenko (ilyam8)
# SPDX-License-Identifier: GPL-3.0-or-later
Function wheel
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
wheel: function (event, dygraph, context) {
void(context);
if (NETDATA.options.debug.dygraph || state.debug) {
state.log('interactionModel.wheel()');
Function wheel
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
wheel: function (event, dygraph, context) {
void(context);
if (NETDATA.options.debug.dygraph || state.debug) {
state.log('interactionModel.wheel()');
OrderedDict
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class OrderedDict(dict):
'Dictionary that remembers insertion order'
# An inherited dict maps keys to values.
# The inherited dict provides __getitem__, __len__, __contains__, and get.
# The remaining methods are order-aware.
File filelock.py
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
Function addSegmentEventHandlers
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
addSegmentEventHandlers: function(pie) {
var arc = pie.svg.selectAll("." + pie.cssPrefix + "arc");
arc = arc.merge(pie.__labels.inner.merge(pie.__labels.outer));
arc.on("click", function() {
Function parseZpoolListVdevOutput
has a Cognitive Complexity of 35 (exceeds 20 allowed). Consider refactoring. Open
func parseZpoolListVdevOutput(bs []byte) ([]vdevEntry, error) {
var headers []string
var vdevs []vdevEntry
sc := bufio.NewScanner(bytes.NewReader(bs))
- 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 selected_server_timezone
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
var selected_server_timezone = function (timezone, status) {
//console.log('called with timezone: ' + timezone + ", status: " + ((typeof status === 'undefined')?'undefined':status).toString());
// clear the error
document.getElementById('timezone_error_message').innerHTML = '';
- 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 process_tag
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def process_tag(self):
tag = self.event.tag
if isinstance(self.event, ScalarEvent):
if self.style is None:
self.style = self.choose_scalar_style()
- 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 seconds4human
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.seconds4human = function (seconds, options) {
let defaultOptions = {
now: 'now',
space: ' ',
negative_suffix: 'ago',