Showing 1,088 of 2,665 total issues
File dashboard-react.js
has 453 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable */
/**
* after react-dashboard refractor, this file can be renamed to 'dashboard.js'
* and it will:
File response.py
has 452 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
from __future__ import absolute_import
from contextlib import contextmanager
import zlib
import io
File selectors.py
has 448 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
# Backport of selectors.py from Python 3.5+ to support Python < 3.4
# Also has the behavior specified in PEP 475 which is to retry syscalls
# in the case of an EINTR error. This module is required because selectors34
# does not follow this behavior and instead returns that no dile descriptor
Function saveSnapshot
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
function saveSnapshot() {
loadPako(function () {
loadLzString(function () {
saveSnapshotStop = false;
$('#saveSnapshotModalProgressSection').show();
Function renderPage
has a Cognitive Complexity of 42 (exceeds 5 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
- 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 683 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package proxysql
import (
Function enrichChartData
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function enrichChartData(chart) {
var parts = chart.type.split('_');
var tmp = parts[0];
switch (tmp) {
- 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 dashboardSettingsSetup
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
function dashboardSettingsSetup() {
var update_options_modal = function () {
// console.log('update_options_modal');
var sync_option = function (option) {
- 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 charting.js
has 427 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Charts Libraries Registration
NETDATA.chartLibraries = {
"dygraph": {
Function d3pieChartCreate
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.d3pieChartCreate = function (state, data) {
state.element_chart.id = 'd3pie-' + state.uuid;
// console.log('id = ' + state.element_chart.id);
Function d3pieChartCreate
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.d3pieChartCreate = function (state, data) {
state.element_chart.id = 'd3pie-' + state.uuid;
// console.log('id = ' + state.element_chart.id);
File charts.go
has 664 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package consul
import (
Method SNMP.collectNetworkInterfaces
has 173 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (s *SNMP) collectNetworkInterfaces(mx map[string]int64) error {
if s.checkMaxReps {
ok, err := s.adjustMaxRepetitions()
if err != nil {
return err
Method Bind.collectServerStats
has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring. Open
func (b *Bind) collectServerStats(metrics map[string]int64, stats *serverStats) {
var chart *Chart
for k, v := range stats.NSStats {
var (
- 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 parser.py
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
# The following YAML grammar is LL(1) and is parsed by a recursive descent
# parser.
#
Function gaugeChartCreate
has 147 lines of code (exceeds 25 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);
Function gaugeChartCreate
has 147 lines of code (exceeds 25 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);
Function write_literal
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
def write_literal(self, text):
hints = self.determine_block_hints(text)
self.write_indicator('|'+hints, True)
if hints[-1:] == '+':
self.open_ended = 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
File promport.go
has 653 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package pipeline
// https://github.com/prometheus/prometheus/wiki/Default-port-allocations
Method StorCli.collectMegaRaidDrives
has a Cognitive Complexity of 52 (exceeds 20 allowed). Consider refactoring. Open
func (s *StorCli) collectMegaRaidDrives(mx map[string]int64, resp *drivesInfoResponse) error {
if resp == nil {
return nil
}
- 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"