Showing 1,242 of 2,966 total issues
Function render_collectors
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def render_collectors(categories, collectors, ids):
debug('Computing default categories.')
default_cats, valid_cats = get_category_sets(categories)
- 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 charts.go
has 628 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package pulsar
import (
Function get
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
get: function (uuid, min, max, units, desired_units, common_units_name, switch_units_callback) {
// validate the parameters
if (typeof units === 'undefined') {
units = 'undefined';
}
Function get
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
get: function (uuid, min, max, units, desired_units, common_units_name, switch_units_callback) {
// validate the parameters
if (typeof units === 'undefined') {
units = 'undefined';
}
Function dashboardSettingsSetup
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dashboardSettingsSetup() {
var update_options_modal = function () {
// console.log('update_options_modal');
var sync_option = function (option) {
Method Bind.collectServerStats
has 147 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (b *Bind) collectServerStats(metrics map[string]int64, stats *serverStats) {
var chart *Chart
for k, v := range stats.NSStats {
var (
File boinc_client.py
has 368 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# client.py - Somewhat higher-level GUI_RPC API for BOINC core client
#
Function matchChunk
has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring. Open
func matchChunk(chunk, s string) (rest string, ok bool, err error) {
for len(chunk) > 0 {
if len(s) == 0 {
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 chartRefresher
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.chartRefresher = function () {
// console.log('chartRefresher() begin ' + (Date.now() - NETDATA.chartRefresherLastRun).toString() + ' ms since last run');
if (NETDATA.options.page_is_visible === false
&& NETDATA.options.current.stop_updates_when_focus_is_lost
- 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 parseHash
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
parseHash: function () {
var variables = document.location.hash.split(';');
var len = variables.length;
while (len--) {
if (len !== 0) {
- 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 _get_data
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def _get_data(self):
# pull data from self.url
raw_data = self._get_raw_data()
if raw_data is 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 renderPage
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderPage(menus, data) {
var div = document.getElementById('charts_div');
var pcent_width = Math.floor(100 / chartsPerRow($(div).width()));
// find the proper duration for per-second updates
Function urlopen
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def urlopen(self, method, url, body=None, headers=None, retries=None,
redirect=True, assert_same_host=True, timeout=_Default,
pool_timeout=None, release_conn=None, chunked=False,
body_pos=None, **response_kw):
"""
- 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 dyncfg.go
has 606 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package jobmgr
import (
File representer.py
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
Method KubeState.updatePodState
has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring. Open
func (ks *KubeState) updatePodState(r resource) {
if r.value() == nil {
if ps, ok := ks.state.pods[r.source()]; ok {
ps.deleted = 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 updateChartWithData
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.updateChartWithData = function (data) {
if (this.debug) {
this.log('updateChartWithData() called.');
}
Function updateChartWithData
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.updateChartWithData = function (data) {
if (this.debug) {
this.log('updateChartWithData() called.');
}
File anomalies.chart.py
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Description: anomalies netdata python.d module
# Author: andrewm4894
# SPDX-License-Identifier: GPL-3.0-or-later
Function sparklineChartCreate
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.sparklineChartCreate = function (state, data) {
let type = NETDATA.dataAttribute(state.element, 'sparkline-type', 'line');
let lineColor = NETDATA.dataAttribute(state.element, 'sparkline-linecolor', state.chartCustomColors()[0]);
let fillColor = NETDATA.dataAttribute(state.element, 'sparkline-fillcolor', ((state.chart.chart_type === 'line') ? NETDATA.themes.current.background : NETDATA.colorLuminance(lineColor, NETDATA.chartDefaults.fill_luminance)));
let chartRangeMin = NETDATA.dataAttribute(state.element, 'sparkline-chartrangemin', undefined);