Showing 1,088 of 2,665 total issues
Function hideChart
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.hideChart = function () {
// hide it, if it is not already hidden
if (isHidden()) {
return;
}
Function dump_all
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
def dump_all(documents, stream=None, Dumper=Dumper,
Method Discoverer.parseLocalListeners
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (d *Discoverer) parseLocalListeners(bs []byte) ([]model.Target, error) {
const (
local4 = "127.0.0.1"
local6 = "::1"
)
Method Windows.collectLogicalDisk
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (w *Windows) collectLogicalDisk(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "logical_disk_"
for _, pm := range pms.FindByName(metricLDReadBytesTotal) {
vol := pm.Labels.Get("volume")
Function addTooltips
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
addTooltips: function(pie) {
// group the label groups (label, percentage, value) into a single element for simpler positioning
var tooltips = pie.svg.insert("g")
.attr("class", pie.cssPrefix + "tooltips");
Method Apcupsd.collectStatus
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (a *Apcupsd) collectStatus(mx map[string]int64, resp []byte) error {
st, err := parseStatus(resp)
if err != nil {
return fmt.Errorf("failed to parse status: %v", err)
}
Method Docker.collectContainers
has 70 lines of code (exceeds 50 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 {
Method Ceph.collectHealth
has 70 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c *Ceph) collectHealth(mx map[string]int64) error {
req, err := web.NewHTTPRequestWithPath(c.RequestConfig, urlPathApiHealthMinimal)
if err != nil {
return err
}
Function finalizePage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function finalizePage() {
// resize all charts - without starting the background thread
// this has to be done while NETDATA is paused
// if we omit this, the affix menu will be wrong, since all
// the Dom elements are initially zero-sized
Method Manager.dyncfgConfigEnable
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (m *Manager) dyncfgConfigEnable(fn functions.Function) {
id := fn.Args[0]
mn, jn, ok := extractModuleJobName(id)
if !ok {
m.Warningf("dyncfg: enable: could not extract module and job from id (%s)", id)
Method Postgres.resetMetrics
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *Postgres) resetMetrics() {
p.mx.srvMetrics = srvMetrics{
xactTimeHist: p.mx.xactTimeHist,
queryTimeHist: p.mx.queryTimeHist,
maxConnections: p.mx.maxConnections,
Method Agent.buildDiscoveryConf
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (a *Agent) buildDiscoveryConf(enabled module.Registry) discovery.Config {
a.Info("building discovery config")
reg := confgroup.Registry{}
for name, creator := range enabled {
Function postCloudAccountAgents
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function postCloudAccountAgents(agentsToSync) {
if (!isSignedIn()) {
return [];
}
Method logLine.verify
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
func (l *logLine) verify() error {
if l.empty() {
return fmt.Errorf("verify: %w", errEmptyLine)
}
if l.hasRespCode() && !l.isRespCodeValid() {
- 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 init
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
init: function () {
if (netdataRegistry !== true) {
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 initializeDynamicDashboardWithData
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function initializeDynamicDashboardWithData(data) {
if (data !== null) {
options.hostname = data.hostname;
options.data = data;
options.version = data.version;
- 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 loadSnapshotPreflightFile
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function loadSnapshotPreflightFile(file) {
var filename = NETDATA.xss.string(file.name);
var fr = new FileReader();
fr.onload = function (e) {
document.getElementById('loadSnapshotFilename').innerHTML = filename;
- 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_flow_mapping_key
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def parse_flow_mapping_key(self, first=False):
if not self.check_token(FlowMappingEndToken):
if not first:
if self.check_token(FlowEntryToken):
self.get_token()
- 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_tag
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def scan_tag(self):
# See the specification for details.
start_mark = self.get_mark()
ch = self.peek(1)
if ch == '<':
- 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 __init__
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, body='', headers=None, status=0, version=0, reason=None,