Showing 1,088 of 2,665 total issues
Function handshake
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def handshake(self,
server_hostname,
verify,
trust_bundle,
min_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 create_connection
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
source_address=None, socket_options=None):
"""Connect to *address* and return the socket object.
Convenience function. Connect to *address* (a 2-tuple ``(host,
- 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 update
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def update(self, data, interval):
updated_dimensions, updated_variables = str(), str()
for dim in self.dimensions:
value = dim.get_value(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 __init__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None):
super(MovedAttribute, self).__init__(name)
if PY3:
if new_mod is None:
new_mod = 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
Method Pika.addDbToKeyspaceCharts
has 60 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *Pika) addDbToKeyspaceCharts(db string) {
p.addDimToChart(chartDbStringsKeys.ID, &module.Dim{
ID: db + "_strings_keys",
Name: db,
})
Method OracleDB.collectTablespace
has 60 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (o *OracleDB) collectTablespace(mx map[string]int64) error {
q := queryTablespace
o.Debugf("executing query: %s", q)
var ts struct {
Function parseStatus
has 60 lines of code (exceeds 50 allowed). Consider refactoring. Open
func parseStatus(resp []byte) (*apcupsdStatus, error) {
var st apcupsdStatus
sc := bufio.NewScanner(bytes.NewBuffer(resp))
for sc.Scan() {
Method Windows.collectMetrics
has 60 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (w *Windows) collectMetrics(mx map[string]int64, pms prometheus.Series) {
w.collectCollector(mx, pms)
for _, pm := range pms.FindByName(metricCollectorSuccess) {
if pm.Value == 0 {
continue
Function getFixed
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
getFixed: function (min, max) {
let key = max;
if (min === max) {
if (typeof this.formattersFixed[key] === 'undefined') {
this.formattersFixed[key] = {
Function gaugeSet
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.gaugeSet = function (state, value, min, max) {
if (typeof value !== 'number') {
value = 0;
}
if (typeof min !== 'number') {
Function mouseup
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
mouseup: function (event, dygraph, context) {
state.tmp.dygraph_mouse_down = false;
if (NETDATA.options.debug.dygraph || state.debug) {
state.log('interactionModel.mouseup()');
Function downloadAll
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
downloadAll: function (host, callback) {
host = NETDATA.fixHost(host);
let self = this;
Function gaugeSet
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.gaugeSet = function (state, value, min, max) {
if (typeof value !== 'number') {
value = 0;
}
if (typeof min !== 'number') {
Function legendFormatValue
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.legendFormatValue = function (value) {
if (typeof value !== 'number') {
return '-';
}
Function downloadAll
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
downloadAll: function (host, callback) {
host = NETDATA.fixHost(host);
let self = this;
Function mouseup
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
mouseup: function (event, dygraph, context) {
state.tmp.dygraph_mouse_down = false;
if (NETDATA.options.debug.dygraph || state.debug) {
state.log('interactionModel.mouseup()');
Function legendFormatValue
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.legendFormatValue = function (value) {
if (typeof value !== 'number') {
return '-';
}
Function getFixed
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
getFixed: function (min, max) {
let key = max;
if (min === max) {
if (typeof this.formattersFixed[key] === 'undefined') {
this.formattersFixed[key] = {
Function onload
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
fr.onload = function (e) {
document.getElementById('loadSnapshotFilename').innerHTML = filename;
var result = null;
try {
result = NETDATA.xss.checkAlways('snapshot', JSON.parse(e.target.result), /^(snapshot\.info|snapshot\.data)$/);
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host, port=None, strict=False,