Showing 1,088 of 2,665 total issues
Method Rethinkdb.collectStats
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (r *Rethinkdb) collectStats(mx map[string]int64) error {
resp, err := r.rdb.stats()
if err != nil {
return err
}
Function gaugeSetSelection
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.gaugeSetSelection = function (state, t) {
if (state.timeIsVisible(t) !== true) {
return NETDATA.gaugeClearSelection(state, true);
}
Function c3Initialize
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.c3Initialize = function(callback) {
if (typeof netdataNoC3 === 'undefined' || !netdataNoC3) {
// C3 requires D3
if (!NETDATA.chartLibraries.d3.initialized) {
Function object
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
object: function (name, obj, ignore_regex) {
if (typeof ignore_regex !== 'undefined' && ignore_regex.test(name)) {
// console.log('XSS: ignoring "' + name + '"');
return obj;
}
Function morrisInitialize
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.morrisInitialize = function(callback) {
if (typeof netdataNoMorris === 'undefined' || !netdataNoMorris) {
// morris requires raphael
if (!NETDATA.chartLibraries.raphael.initialized) {
Function unhideChart
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.unhideChart = function () {
if (!isHidden()) {
return;
}
Function gaugeSetSelection
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.gaugeSetSelection = function (state, t) {
if (state.timeIsVisible(t) !== true) {
return NETDATA.gaugeClearSelection(state, true);
}
Function unhideChart
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.unhideChart = function () {
if (!isHidden()) {
return;
}
Function object
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
object: function (name, obj, ignore_regex) {
if (typeof ignore_regex !== 'undefined' && ignore_regex.test(name)) {
// console.log('XSS: ignoring "' + name + '"');
return obj;
}
Function downloadAll
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
downloadAll: function (host, callback) {
host = fixHost(host);
let self = this;
Function object
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
object: function (name, obj, ignore_regex) {
if (typeof ignore_regex !== 'undefined' && ignore_regex.test(name)) {
// console.log('XSS: ignoring "' + name + '"');
return obj;
}
Function parseSsacliControllersInfo
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func parseSsacliControllersInfo(data []byte) (map[string]*hpssaController, error) {
var (
cntrl *hpssaController
arr *hpssaArray
ld *hpssaLogicalDrive
- 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 Windows.collectAD
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (w *Windows) collectAD(mx map[string]int64, pms prometheus.Series) {
if !w.cache.collection[collectorAD] {
w.cache.collection[collectorAD] = true
w.addADCharts()
}
- 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 MySQL.collect
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (m *MySQL) collect() (map[string]int64, error) {
if m.db == nil {
if err := m.openConnection(); err != nil {
return nil, err
}
- 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 parsePersonUrls
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
parsePersonUrls: function (person_urls) {
NETDATA.registry.person_urls = person_urls;
if (person_urls) {
NETDATA.registry.machines = {};
- 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 dataAttribute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.dataAttribute = function (element, attribute, def) {
let key = 'data-' + attribute.toString();
if (element.hasAttribute(key)) {
let data = element.getAttribute(key);
- 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 serialize_node
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def serialize_node(self, node, parent, index):
alias = self.anchors[node]
if node in self.serialized_nodes:
self.emit(AliasEvent(alias))
else:
- 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 _new_conn
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _new_conn(self):
"""
Establish a new connection via the SOCKS proxy.
"""
extra_kw = {}
- 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 recv_into
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def recv_into(self, *args, **kwargs):
try:
return self.connection.recv_into(*args, **kwargs)
except OpenSSL.SSL.SysCallError as e:
if self.suppress_ragged_eofs and e.args == (-1, 'Unexpected EOF'):
- 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 ssl_wrap_socket
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,
ca_certs=None, server_hostname=None,
ssl_version=None, ciphers=None, ssl_context=None,
ca_cert_dir=None):
"""
- 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"