Showing 1,088 of 2,665 total issues
Function dygraphChartUpdate
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.dygraphChartUpdate = function (state, data) {
let dygraph = state.tmp.dygraph_instance;
if (typeof dygraph === 'undefined') {
return NETDATA.dygraphChartCreate(state, data);
Function _init
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _init = function() {
// prep-work
this.svg = helpers.addSVGSpace(this);
Function queryReplicationSlotFiles
has 104 lines of code (exceeds 50 allowed). Consider refactoring. Open
func queryReplicationSlotFiles(version int) string {
if version < pgVersion11 {
return `
WITH wal_size AS (
SELECT
Method Windows.collectIIS
has 104 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (w *Windows) collectIIS(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "iis_website_"
for _, pm := range pms.FindByName(metricIISCurrentAnonymousUsers) {
if name := cleanWebsiteName(pm.Labels.Get("site")); name != "" {
Function googleChartCreate
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.googleChartCreate = function (state, data) {
let datatable = new google.visualization.DataTable(data.result);
state.google_options = {
colors: state.chartColors(),
Function googleChartCreate
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.googleChartCreate = function (state, data) {
let datatable = new google.visualization.DataTable(data.result);
state.google_options = {
colors: state.chartColors(),
File charts.go
has 546 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package ceph
import (
Method Docker.collectContainers
has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring. Open
func (d *Docker) collectContainers(mx map[string]int64) error {
containerSet := make(map[string][]types.Container)
for _, status := range containerHealthStatuses {
if err := func() error {
- 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 handler
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
handler: function (entries, observer) {
entries.forEach(function (entry) {
let state = NETDATA.chartState(entry.target);
let idx;
- 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 setHandler
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
dimensionStatus.prototype.setHandler = function () {
if (!this.enabled) {
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 notify
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
notify: function (entry) {
// console.log('alarm ' + entry.unique_id);
if (entry.updated) {
// console.log('alarm ' + entry.unique_id + ' has been updated by another alarm');
- 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_spaces
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def scan_plain_spaces(self, indent, start_mark):
# See the specification for details.
# The specification is really confusing about tabs in plain scalars.
# We just forbid them completely. Do not use tabs in YAML!
chunks = []
- 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_document_start
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def expect_document_start(self, first=False):
if isinstance(self.event, DocumentStartEvent):
if (self.event.version or self.event.tags) and self.open_ended:
self.write_indicator('...', True)
self.write_indent()
- 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_block_scalar
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def scan_block_scalar(self, style):
# See the specification for details.
if style == '>':
folded = True
- 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 add_path_resolver
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def add_path_resolver(cls, tag, path, kind=None):
# Note: `add_path_resolver` is experimental. The API could be changed.
# `new_path` is a pattern that is matched against the path from the
# root to the node that is being considered. `node_path` elements are
# tuples `(node_check, index_check)`. `node_check` is a node class:
- 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 parse_url
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def parse_url(url):
"""
Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is
performed to parse incomplete urls. Fields not provided will be None.
- 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 renderMyNetdataMenu
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderMyNetdataMenu(machinesArray) {
const el = document.getElementById('my-netdata-dropdown-content');
el.classList.add(`theme-${netdataTheme}`);
if (machinesArray == registryAgents) {
File d3pie.js
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
// d3pie
NETDATA.d3pieInitialize = function (callback) {
if (typeof netdataNoD3pie === 'undefined' || !netdataNoD3pie) {
Function add
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function(pie, section, sectionDisplayType) {
var include = labels.getIncludes(sectionDisplayType);
var settings = pie.options.labels;
// group the label groups (label, percentage, value) into a single element for simpler positioning
HTTPResponse
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class HTTPResponse(io.IOBase):
"""
HTTP Response container.
Backwards-compatible to httplib's HTTPResponse but the response ``body`` is