Showing 1,088 of 2,665 total issues
Function lateInitialization
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
const lateInitialization = () => {
if (typeof this.host !== 'undefined') {
return;
}
Function renderMachines
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function renderMachines(machinesArray) {
let html = `<div class="info-item">My nodes</div>`;
if (machinesArray === null) {
let ret = loadLocalStorage("registryCallback");
- 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 resizeHandler
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.resizeHandler = function (e) {
e.preventDefault();
if (typeof this.event_resize === 'undefined'
|| this.event_resize.chart_original_w === 'undefined'
Function resizeHandler
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.resizeHandler = function (e) {
e.preventDefault();
if (typeof this.event_resize === 'undefined'
|| this.event_resize.chart_original_w === 'undefined'
Function __init__
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, display_name):
self.display_name = display_name
if self.display_name == "alpine_3_18":
self.docker_tag = "alpine:3.18"
- 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 flatten_mapping
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def flatten_mapping(self, node):
merge = []
index = 0
while index < len(node.value):
key_node, value_node = node.value[index]
- 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 increment
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def increment(self, method=None, url=None, response=None, error=None,
_pool=None, _stacktrace=None):
""" Return a new Retry object with incremented retry counters.
:param response: A response object, or None, if the server did not
- 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 _read_callback
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def _read_callback(connection_id, data_buffer, data_length_pointer):
"""
SecureTransport read callback. This is called by ST to request that data
be returned from the socket.
"""
- 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 parseHash
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseHash: function () {
var variables = document.location.hash.split(';');
var len = variables.length;
while (len--) {
if (len !== 0) {
Function extend
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
var extend = function() {
var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false,
SquidLog
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
func (s *SquidLog) logPanicStackIfAny() {
err := recover()
if err == nil {
return
}
Function notify
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
notify: function (entry) {
// console.log('alarm ' + entry.unique_id);
if (entry.updated) {
// console.log('alarm ' + entry.unique_id + ' has been updated by another alarm');
Function notify
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
notify: function (entry) {
// console.log('alarm ' + entry.unique_id);
if (entry.updated) {
// console.log('alarm ' + entry.unique_id + ' has been updated by another alarm');
Method KubeState.collectPodsState
has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring. Open
func (ks *KubeState) collectPodsState(mx map[string]int64) {
now := time.Now()
for _, ps := range ks.state.pods {
// Skip cronjobs (each of them is a unique container because name contains hash)
// to avoid overwhelming Netdata with high cardinality metrics.
- 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 Smartctl.collectSmartDevice
has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring. Open
func (s *Smartctl) collectSmartDevice(mx map[string]int64, dev *smartDevice) {
px := fmt.Sprintf("device_%s_type_%s_", dev.deviceName(), dev.deviceType())
if v, ok := dev.powerOnTime(); ok {
mx[px+"power_on_time"] = v
- 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.collectLogicalDisk
has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring. Open
func (w *Windows) collectLogicalDisk(mx map[string]int64, pms prometheus.Series) {
seen := make(map[string]bool)
px := "logical_disk_"
for _, pm := range pms.FindByName(metricLDReadBytesTotal) {
vol := pm.Labels.Get("volume")
- 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 choose_scalar_style
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def choose_scalar_style(self):
if self.analysis is None:
self.analysis = self.analyze_scalar(self.event.value)
if self.event.style == '"' or self.canonical:
return '"'
- 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 main
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def main():
if len(sys.argv) != 2:
print(':error:This script takes exactly one argument.')
return 2
- 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.collectPodsState
has 105 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (ks *KubeState) collectPodsState(mx map[string]int64) {
now := time.Now()
for _, ps := range ks.state.pods {
// Skip cronjobs (each of them is a unique container because name contains hash)
// to avoid overwhelming Netdata with high cardinality metrics.
Function dygraphChartUpdate
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
NETDATA.dygraphChartUpdate = function (state, data) {
let dygraph = state.tmp.dygraph_instance;
if (typeof dygraph === 'undefined') {
return NETDATA.dygraphChartCreate(state, data);