Showing 1,088 of 2,665 total issues
Function saveSnapshotModalInit
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function saveSnapshotModalInit() {
$('#saveSnapshotModalProgressSection').hide();
$('#saveSnapshotResolutionRadio').show();
saveSnapshotModalLog('info', 'Select resolution and click <b>Save</b>');
$('#saveSnapshotExport').removeClass('disabled');
Method Vnodes.readConfDir
has a Cognitive Complexity of 33 (exceeds 20 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
- 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 WebLog.collectCustomFields
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
func (w *WebLog) collectCustomFields() {
if !w.line.hasCustomFields() {
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 getFixed
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
getFixed: function (min, max) {
let key = max;
if (min === max) {
if (typeof this.formattersFixed[key] === 'undefined') {
this.formattersFixed[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 notifyAll
has a Cognitive Complexity of 18 (exceeds 5 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');
- 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 get_all_packages
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def get_all_packages(self):
page = 1
all_pkg_list = []
while True:
url = f"{self.base_url}/packages.json?page={page}"
- 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 represent_data
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def represent_data(self, data):
if self.ignore_aliases(data):
self.alias_key = None
else:
self.alias_key = id(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 process_directives
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def process_directives(self):
self.yaml_version = None
self.tag_handles = {}
while self.check_token(DirectiveToken):
token = self.get_token()
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
def select(self, timeout=None):
if timeout is not None:
if timeout <= 0:
timeout = 0.0
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 select
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def select(self, timeout=None):
if timeout is not None:
timeout = max(timeout, 0)
max_events = len(self._fd_to_key) * 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 Varnish.collectStatistics
has 85 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (v *Varnish) collectStatistics(mx map[string]int64, bs []byte) error {
seenBackends, seenStorages := make(map[string]bool), make(map[string]bool)
sc := bufio.NewScanner(bytes.NewReader(bs))
Method Windows.collectNetFrameworkCLRMemory
has 85 lines of code (exceeds 50 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 != "" {
Function updateChartPanOrZoom
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.updateChartPanOrZoom = function (after, before, callback) {
let logme = 'updateChartPanOrZoom(' + after + ', ' + before + '): ';
let ret = true;
NETDATA.globalPanAndZoom.delay();
Function updateChartPanOrZoom
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.updateChartPanOrZoom = function (after, before, callback) {
let logme = 'updateChartPanOrZoom(' + after + ', ' + before + '): ';
let ret = true;
NETDATA.globalPanAndZoom.delay();
Function __init__
has 19 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host, port=None,
Function update_options_modal
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
var update_options_modal = function () {
// console.log('update_options_modal');
var sync_option = function (option) {
var self = $('#' + option);
Postgres
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
func (p *Postgres) addWALFilesCharts() {
charts := walFilesCharts.Copy()
if err := p.Charts().Add(*charts...); err != nil {
p.Warning(err)
Job
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
type Job struct {
pluginName string
name string
moduleName string
fullName string
File logline.go
has 512 lines of code (exceeds 500 allowed). Consider refactoring. Open
// SPDX-License-Identifier: GPL-3.0-or-later
package weblog
import (
Method WebLog.createCharts
has 82 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (w *WebLog) createCharts(line *logLine) error {
if line.empty() {
return errors.New("empty line")
}
w.charts = nil