Showing 1,088 of 2,665 total issues
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',
Function loadSnapshot
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadSnapshot() {
$('#loadSnapshotImport').addClass('disabled');
if (tmpSnapshotData === null) {
loadSnapshotPreflightEmpty();
File __init__.py
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
from .error import *
from .tokens import *
Config
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
type Config map[string]any
Function init
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (timezone) {
//console.log('init with timezone: ' + timezone);
// detect browser timezone
try {
Function init
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function (timezone) {
//console.log('init with timezone: ' + timezone);
// detect browser timezone
try {
File representer.py
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer',
'RepresenterError']
Method NvidiaSmi.collectGPUInfo
has 90 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (nv *NvidiaSmi) collectGPUInfo(mx map[string]int64) error {
bs, err := nv.exec.queryGPUInfo()
if err != nil {
return fmt.Errorf("error on quering XML GPU info: %v", err)
}
Method VerneMQ.getNodesStats
has a Cognitive Complexity of 34 (exceeds 20 allowed). Consider refactoring. Open
func (v *VerneMQ) getNodesStats(mfs prometheus.MetricFamilies) map[string]*nodeStats {
nodes := make(map[string]*nodeStats)
for _, mf := range mfs {
name, _ := strings.CutPrefix(mf.Name(), v.namespace.name+"_")
- 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 easypiechartPercentFromValueMinMax
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.easypiechartPercentFromValueMinMax = function (state, value, min, max) {
if (typeof value !== 'number') {
value = 0;
}
if (typeof min !== 'number') {
- 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 chartRefresherNoParallel
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.chartRefresherNoParallel = function (index, callback) {
let targets = NETDATA.intersectionObserver.targets();
if (NETDATA.options.debug.main_loop) {
console.log('NETDATA.chartRefresherNoParallel(' + index + ')');
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
def _get_data(self):
if not self.is_alive():
return None
data = {}
- 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 descend_resolver
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def descend_resolver(self, current_node, current_index):
if not self.yaml_path_resolvers:
return
exact_paths = {}
prefix_paths = []
- 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_indicators
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def scan_block_scalar_indicators(self, start_mark):
# See the specification for details.
chomping = None
increment = None
ch = self.peek()
- 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 create
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def create(self):
for chart_name in self.order:
chart_config = self.definitions.get(chart_name)
if not chart_config:
- 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 _write_callback
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def _write_callback(connection_id, data_buffer, data_length_pointer):
"""
SecureTransport write callback. This is called by ST to request that data
actually be sent on the network.
"""
- 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 cleanup
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def cleanup():
"""
clean directories that are either data collection or exporting integrations
"""
for element in Path("src/go/plugin/go.d/modules").glob('**/*/'):
- 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 chartURL
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.chartURL = function () {
let after, before, points_multiplier = 1;
if (NETDATA.globalPanAndZoom.isActive()) {
if (this.current.force_before_ms !== null && this.current.force_after_ms !== null) {
this.tm.pan_and_zoom_seq = 0;
Function chartURL
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.chartURL = function () {
let after, before, points_multiplier = 1;
if (NETDATA.globalPanAndZoom.isActive()) {
if (this.current.force_before_ms !== null && this.current.force_after_ms !== null) {
this.tm.pan_and_zoom_seq = 0;
Function renderChartsAndMenu
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderChartsAndMenu(data) {
options.menus = {};
options.submenu_names = {};
var menus = options.menus;