Showing 1,088 of 2,665 total issues
Function urlopen
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def urlopen(self, method, url, body=None, headers=None, retries=None,
redirect=True, assert_same_host=True, timeout=_Default,
pool_timeout=None, release_conn=None, chunked=False,
body_pos=None, **response_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
Method KubeState.updatePodState
has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring. Open
func (ks *KubeState) updatePodState(r resource) {
if r.value() == nil {
if ps, ok := ks.state.pods[r.source()]; ok {
ps.deleted = true
}
- 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 updateChartWithData
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.updateChartWithData = function (data) {
if (this.debug) {
this.log('updateChartWithData() called.');
}
Function updateChartWithData
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.updateChartWithData = function (data) {
if (this.debug) {
this.log('updateChartWithData() called.');
}
Function sparklineChartCreate
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.sparklineChartCreate = function (state, data) {
let type = NETDATA.dataAttribute(state.element, 'sparkline-type', 'line');
let lineColor = NETDATA.dataAttribute(state.element, 'sparkline-linecolor', state.chartCustomColors()[0]);
let fillColor = NETDATA.dataAttribute(state.element, 'sparkline-fillcolor', ((state.chart.chart_type === 'line') ? NETDATA.themes.current.background : NETDATA.colorLuminance(lineColor, NETDATA.chartDefaults.fill_luminance)));
let chartRangeMin = NETDATA.dataAttribute(state.element, 'sparkline-chartrangemin', undefined);
Function sparklineChartCreate
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.sparklineChartCreate = function (state, data) {
let type = NETDATA.dataAttribute(state.element, 'sparkline-type', 'line');
let lineColor = NETDATA.dataAttribute(state.element, 'sparkline-linecolor', state.chartCustomColors()[0]);
let fillColor = NETDATA.dataAttribute(state.element, 'sparkline-fillcolor', ((state.chart.chart_type === 'line') ? NETDATA.themes.current.background : NETDATA.colorLuminance(lineColor, NETDATA.chartDefaults.fill_luminance)));
let chartRangeMin = NETDATA.dataAttribute(state.element, 'sparkline-chartrangemin', undefined);
File pyopenssl.py
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
# SPDX-License-Identifier: MIT
"""
SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
Function shorten
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.shorten = function (settings) {
"use strict";
var config = {
showChars: 750,
Method SNMP.collectNetworkInterfaces
has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring. Open
func (s *SNMP) collectNetworkInterfaces(mx map[string]int64) error {
if s.checkMaxReps {
ok, err := s.adjustMaxRepetitions()
if err != nil {
return 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
Method Sensors.updateCharts
has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring. Open
func (s *Sensors) updateCharts(chips []*lmsensors.Chip) {
seen := make(map[string]bool)
for _, chip := range chips {
for _, sn := range chip.Sensors.Voltage {
- 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 check
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def check(self):
def get_connection_properties(conf, extra_conf):
properties = dict()
if conf.get('user'):
properties['user'] = conf['user']
- 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 urlopen
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def urlopen(self, method, url, body=None, headers=None,
retries=None, redirect=True, timeout=Timeout.DEFAULT_TIMEOUT,
**response_kw):
retries = self._get_retries(retries, redirect)
- 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
logLine
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
logLine struct {
clientAddr string
serverAddr string
respTime int
Function renderMachines
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderMachines(machinesArray) {
let html = `<div class="info-item">My nodes</div>`;
if (machinesArray === null) {
let ret = loadLocalStorage("registryCallback");
Method KubeState.updatePodState
has 128 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (ks *KubeState) updatePodState(r resource) {
if r.value() == nil {
if ps, ok := ks.state.pods[r.source()]; ok {
ps.deleted = true
}
Function scan_flow_scalar_non_spaces
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def scan_flow_scalar_non_spaces(self, double, start_mark):
# See the specification for details.
chunks = []
while True:
length = 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 construct_object
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def construct_object(self, node, deep=False):
if node in self.constructed_objects:
return self.constructed_objects[node]
if deep:
old_deep = self.deep_construct
- 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 enrichChartData
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
function enrichChartData(chart) {
var parts = chart.type.split('_');
var tmp = parts[0];
switch (tmp) {
File nd.py
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
from typing import List
import enum
import os
import pathlib
Method Windows.collectNetFrameworkCLRMemory
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
func (w *Windows) collectNetFrameworkCLRMemory(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
for _, pm := range pms.FindByName(metricNetFrameworkCLRMemoryAllocatedBytesTotal) {
if name := cleanProcessName(pm.Labels.Get("process")); 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"