Showing 1,252 of 2,993 total issues
File scanner.py
has 882 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
# Scanner produces tokens of the following types:
# STREAM-START
# STREAM-END
Method Windows.collectMSSQL
has a Cognitive Complexity of 120 (exceeds 20 allowed). Consider refactoring. Open
func (w *Windows) collectMSSQL(mx map[string]int64, pms prometheus.Series) {
instances := make(map[string]bool)
dbs := make(map[string]bool)
px := "mssql_instance_"
for _, pm := range pms.FindByName(metricMSSQLAccessMethodPageSplits) {
- 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 legendUpdateDOM
has 387 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.legendUpdateDOM = function () {
let needed = false, dim, keys, len;
// check that the legend DOM is up to date for the downloaded dimensions
if (typeof this.element_legend_childs.series !== 'object' || this.element_legend_childs.series === null) {
Function legendUpdateDOM
has 387 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.legendUpdateDOM = function () {
let needed = false, dim, keys, len;
// check that the legend DOM is up to date for the downloaded dimensions
if (typeof this.element_legend_childs.series !== 'object' || this.element_legend_childs.series === null) {
File dygraph.js
has 762 lines of code (exceeds 250 allowed). Consider refactoring. Open
// dygraph
// Codacy declarations
/* global smoothPlotter */
/* global Dygraph */
File charts.go
has 994 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package mongo
import (
File oracledb.chart.py
has 720 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Description: oracledb netdata python.d module
# Author: ilyam8 (Ilya Mashchenko)
# SPDX-License-Identifier: GPL-3.0-or-later
Function analyze_scalar
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
def analyze_scalar(self, scalar):
# Empty scalar is a special case.
if not scalar:
return ScalarAnalysis(scalar=scalar, empty=True, multiline=False,
- 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 analyze_scalar
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
def analyze_scalar(self, scalar):
# Empty scalar is a special case.
if not scalar:
return ScalarAnalysis(scalar=scalar, empty=True, multiline=False,
- 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 907 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package nginxplus
import (
File six.py
has 654 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# SPDX-License-Identifier: MIT
Function runOnceOnDashboardWithjQuery
has 281 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runOnceOnDashboardWithjQuery() {
if (runOnceOnDashboardLastRun !== 0) {
scrollDashboardTo();
// restore the scrollspy at the proper position
File connectionpool.py
has 622 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
from __future__ import absolute_import
import errno
import logging
import sys
Function get
has a Cognitive Complexity of 67 (exceeds 5 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';
}
- 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
Scanner
has 71 functions (exceeds 20 allowed). Consider refactoring. Open
class Scanner:
def __init__(self):
"""Initialize the scanner."""
# It is assumed that Scanner and Reader will have a common descendant.
Scanner
has 71 functions (exceeds 20 allowed). Consider refactoring. Open
class Scanner(object):
def __init__(self):
"""Initialize the scanner."""
# It is assumed that Scanner and Reader will have a common descendant.
File charts.go
has 852 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package vernemq
import "github.com/netdata/netdata/go/go.d.plugin/agent/module"
Method NginxPlus.updateCharts
has a Cognitive Complexity of 81 (exceeds 20 allowed). Consider refactoring. Open
func (n *NginxPlus) updateCharts() {
const notSeenLimit = 3
for key, v := range n.cache.httpCaches {
if v.updated && !v.hasCharts {
- 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 smartd_log.chart.py
has 582 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: utf-8 -*-
# Description: smart netdata python.d module
# Author: ilyam8, vorph1
# SPDX-License-Identifier: GPL-3.0-or-later
Method Postgres.collectMetrics
has 274 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *Postgres) collectMetrics(mx map[string]int64) {
mx["server_connections_used"] = p.mx.connUsed
if p.mx.maxConnections > 0 {
mx["server_connections_available"] = p.mx.maxConnections - p.mx.connUsed
mx["server_connections_utilization"] = calcPercentage(p.mx.connUsed, p.mx.maxConnections)