Showing 1,088 of 2,665 total issues
Function loadRequiredJs
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NETDATA.loadRequiredJs = function (index, callback) {
if (index >= NETDATA.requiredJs.length) {
if (typeof callback === 'function') {
return callback();
}
Function chartRefresherNoParallel
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NETDATA.chartRefresherNoParallel = function (index, callback) {
let targets = NETDATA.intersectionObserver.targets();
if (NETDATA.options.debug.main_loop) {
console.log('NETDATA.chartRefresherNoParallel(' + index + ')');
Function chartRefresherNoParallel
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
NETDATA.chartRefresherNoParallel = function (index, callback) {
let targets = NETDATA.intersectionObserver.targets();
if (NETDATA.options.debug.main_loop) {
console.log('NETDATA.chartRefresherNoParallel(' + index + ')');
Method API.CHART
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
typeID string,
ID string,
name string,
title string,
units string,
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, stream,
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, stream,
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, stream,
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, stream,
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, stream,
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def __init__(self, stream,
Function serialize_all
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def serialize_all(nodes, stream=None, Dumper=Dumper,
Function urlopen
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def urlopen(self, method, url, body=None, headers=None, retries=None,
Function getSnapshotData
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getSnapshotData = function (key) {
if (this.debug) {
this.log('updating from snapshot: ' + key);
}
Function getSnapshotData
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.getSnapshotData = function (key) {
if (this.debug) {
this.log('updating from snapshot: ' + key);
}
Function update_chart
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function update_chart(idx) {
if (saveSnapshotStop === true) {
saveSnapshotModalLog('info', 'Cancelled!');
saveSnapshotRestore();
return;
Function checkConflict
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
checkConflict: function(pie, currIndex, direction, size) {
var i, curr;
if (size <= 1) {
return;
Function computePieRadius
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
computePieRadius: function(pie) {
var size = pie.options.size;
var canvasPadding = pie.options.misc.canvasPadding;
// outer radius is either specified (e.g. through the generator), or omitted altogether
Function loadSnapshotPreflightFile
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loadSnapshotPreflightFile(file) {
var filename = NETDATA.xss.string(file.name);
var fr = new FileReader();
fr.onload = function (e) {
document.getElementById('loadSnapshotFilename').innerHTML = filename;
Method Postgres.doQueryQueryableDatabases
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
Open
func (p *Postgres) doQueryQueryableDatabases() error {
q := queryQueryableDatabaseList()
var dbs []string
err := p.doQuery(q, func(_, value string, _ bool) {
- 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 SquidLog.createCharts
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring. Open
Open
func (s *SquidLog) createCharts(line *logLine) error {
if line.empty() {
return errors.New("empty line")
}
charts := &Charts{
- 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"