Showing 1,088 of 2,665 total issues
Function positionLabelElements
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
positionLabelElements: function(pie, section, sectionDisplayType) {
labels["dimensions-" + section] = [];
// get the latest widths, heights
var labelGroups = pie.__labels[section];
Function selected_server_timezone
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
var selected_server_timezone = function (timezone, status) {
//console.log('called with timezone: ' + timezone + ", status: " + ((typeof status === 'undefined')?'undefined':status).toString());
// clear the error
document.getElementById('timezone_error_message').innerHTML = '';
Method Pipeline.processGroup
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *Pipeline) processGroup(tgg model.TargetGroup) *confgroup.Group {
if len(tgg.Targets()) == 0 {
if _, ok := p.configs[tgg.Source()]; !ok {
return nil
}
Method Gearman.collectStatus
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (g *Gearman) collectStatus(mx map[string]int64, statusData []byte) error {
/*
Same output as the "gearadmin --status" command:
FUNCTION\tTOTAL\tRUNNING\tAVAILABLE_WORKERS
Function get
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
get: function (state) {
if (typeof state.tmp.__commonMax === 'undefined') {
// get the commonMax setting
state.tmp.__commonMax = NETDATA.dataAttribute(state.element, 'common-max', null);
}
Function get
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
get: function (state) {
if (typeof state.tmp.__commonMin === 'undefined') {
// get the commonMin setting
state.tmp.__commonMin = NETDATA.dataAttribute(state.element, 'common-min', null);
}
Function get
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
get: function (state) {
if (typeof state.tmp.__commonMin === 'undefined') {
// get the commonMin setting
state.tmp.__commonMin = NETDATA.dataAttribute(state.element, 'common-min', null);
}
Function get
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
get: function (state) {
if (typeof state.tmp.__commonMax === 'undefined') {
// get the commonMax setting
state.tmp.__commonMax = NETDATA.dataAttribute(state.element, 'common-max', null);
}
Function _new_conn
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _new_conn(self):
# Performs the NTLM handshake that secures the connection. The socket
# must be kept open while requests are performed.
self.num_connections += 1
log.debug('Starting NTLM HTTPS connection no. %d: https://%s%s',
Method Job.processMetrics
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
func (j *Job) processMetrics(metrics map[string]int64, startTime time.Time, sinceLastRun int) bool {
if !j.vnodeCreated {
if j.vnodeGUID == "" {
if v := j.module.VirtualNode(); v != nil && v.GUID != "" && v.Hostname != "" {
j.vnodeGUID = v.GUID
- 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 Scanner.detectDevicePaths
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
func (sc *Scanner) detectDevicePaths() ([]string, error) {
const lookPath = "/sys/class/hwmon"
var paths []string
- 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 Scanner.detectDevicePaths
has 13 return statements (exceeds 4 allowed). Open
func (sc *Scanner) detectDevicePaths() ([]string, error) {
const lookPath = "/sys/class/hwmon"
var paths []string
Method Postgres.doQueryGlobalMetrics
has 13 return statements (exceeds 4 allowed). Open
func (p *Postgres) doQueryGlobalMetrics() error {
if err := p.doQueryConnectionsUsed(); err != nil {
return fmt.Errorf("querying server connections used error: %v", err)
}
if err := p.doQueryConnectionsState(); err != nil {
Method StorCli.collectMegaraidControllersInfo
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
func (s *StorCli) collectMegaraidControllersInfo(mx map[string]int64, resp *controllersInfoResponse) error {
for _, v := range resp.Controllers {
cntrl := v.ResponseData
cntrlNum := strconv.Itoa(cntrl.Basics.Controller)
- 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 Apcupsd.collectStatus
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
func (a *Apcupsd) collectStatus(mx map[string]int64, resp []byte) error {
st, err := parseStatus(resp)
if err != nil {
return fmt.Errorf("failed to parse status: %v", 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 onscrollUpdater
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.onscrollUpdater = function () {
NETDATA.globalSelectionSync.stop();
if (NETDATA.options.abort_ajax_on_scroll) {
NETDATA.abortAllRefreshes();
- 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 renderMyNetdataMenu
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function renderMyNetdataMenu(machinesArray) {
const el = document.getElementById('my-netdata-dropdown-content');
el.classList.add(`theme-${netdataTheme}`);
if (machinesArray == registryAgents) {
- 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 netdataHighlightCallback
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
netdataHighlightCallback: function (status, after, before) {
//console.log(2);
//console.log(new Error().stack);
if (status === true && (after === null || before === null || after <= 0 || before <= 0 || after >= before)) {
- 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 naturalSortCompare
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function naturalSortCompare(a, b) {
var aa = naturalSortChunkify(a.toLowerCase());
var bb = naturalSortChunkify(b.toLowerCase());
for (var x = 0; aa[x] && bb[x]; x++) {
- 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 expect_flow_mapping_key
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def expect_flow_mapping_key(self):
if isinstance(self.event, MappingEndEvent):
self.indent = self.indents.pop()
self.flow_level -= 1
if self.canonical:
- 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"