Showing 1,088 of 2,665 total issues
Function check_event
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def check_event(self, *choices):
# Check the type of the next event.
if self.current_event is None:
if self.state:
self.current_event = self.state()
- 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 _error_catcher
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _error_catcher(self):
"""
Catch low-level python exceptions, instead re-raising urllib3
variants, so that low-level exceptions are not leaked in the
high-level api.
- 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 _merge_pool_kwargs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _merge_pool_kwargs(self, override):
"""
Merge a dictionary of override values for self.connection_pool_kw.
This does not modify self.connection_pool_kw and returns a new dict.
- 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 select
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def select(self, timeout=None):
ready = []
fd_events = _syscall_wrapper(self._wrap_poll, True, timeout=timeout)
for fd, event_mask in fd_events:
events = 0
- 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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def ssl_wrap_socket(sock, keyfile=None, certfile=None, cert_reqs=None,
Function _build_manager
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _build_manager(self, **header_kw):
header, proxy_header = self.__make_headers(**header_kw)
if header is None or proxy_header is None:
return None
proxy_url = header_kw.get('proxy_url') or self.proxy_url
- 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 parseBBUInfo
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
func parseBBUInfo(bs []byte) (map[string]*megaBBU, error) {
bbus := make(map[string]*megaBBU)
var section string
var bbu *megaBBU
Method Vnodes.readConfDir
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (vn *Vnodes) readConfDir() {
_ = filepath.WalkDir(vn.confDir, func(path string, d fs.DirEntry, err error) error {
if err != nil {
vn.Warning(err)
return nil
Method Postgres.doDBQueryStatUserTables
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *Postgres) doDBQueryStatUserTables(db *sql.DB) error {
q := queryStatUserTables()
var dbname, schema, name string
return p.doDBQuery(db, q, func(column, value string, _ bool) {
Function init
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function () {
if (netdataRegistry !== true) {
return;
}
Function setHandler
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
dimensionStatus.prototype.setHandler = function () {
if (!this.enabled) {
return;
}
Function init
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function () {
if (netdataRegistry !== true) {
return;
}
Function legendShowLatestValues
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.legendShowLatestValues = function () {
if (this.chart === null) {
return;
}
if (this.selected) {
Function setHandler
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
dimensionStatus.prototype.setHandler = function () {
if (!this.enabled) {
return;
}
Function legendShowLatestValues
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.legendShowLatestValues = function () {
if (this.chart === null) {
return;
}
if (this.selected) {
Function getControlPoints
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getControlPoints(p0, p1, p2, opt_alpha, opt_allowFalseExtrema) {
var alpha = (opt_alpha !== undefined) ? opt_alpha : 1/3; // 0=no smoothing, 1=crazy smoothing
var allowFalseExtrema = opt_allowFalseExtrema || false;
if (!p2) {
Method Scanner.Scan
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (sc *Scanner) Scan() ([]*Chip, error) {
paths, err := sc.detectDevicePaths()
if err != nil {
return nil, err
}
Method KubeProxy.collectSyncProxyRulesLatency
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (kp *KubeProxy) collectSyncProxyRulesLatency(raw prometheus.Series, mx *metrics) {
metricName := "kubeproxy_sync_proxy_rules_latency_microseconds_bucket"
latency := &mx.SyncProxyRules.Latency
for _, metric := range raw.FindByName(metricName) {
Function loadCookieJar
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
func loadCookieJar(path string) (http.CookieJar, error) {
file, err := os.Open(path)
if err != nil {
return nil, err
}
Function notifyAll
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
notifyAll: function () {
// console.log('FETCHING ALARM LOG');
NETDATA.alarms.get_log(NETDATA.alarms.last_notification_id, function (data) {
// console.log('ALARM LOG FETCHED');