Showing 1,247 of 3,008 total issues
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return sign*int(value)
Avoid too many return
statements within this function. Open
return ExecutableService.check(self)
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return 2
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return False
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return True
Avoid too many return
statements within this function. Open
return False
Method Job.processMetrics
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (j *Job) processMetrics(metrics map[string]int64, startTime time.Time, sinceLastRun int) bool {
if !vnodes.Disabled {
if !j.vnodeCreated && j.vnodeGUID != "" {
_ = j.api.HOSTINFO(j.vnodeGUID, j.vnodeHostname, j.vnodeLabels)
j.vnodeCreated = 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 localStorageTest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.localStorageTest = function () {
if (NETDATA.localStorageTested !== -1) {
return NETDATA.localStorageTested;
}
- 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.collectCPU
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (w *Windows) collectCPU(mx map[string]int64, pms prometheus.Series) {
if !w.cache.collection[collectorCPU] {
w.cache.collection[collectorCPU] = true
w.addCPUCharts()
}
- 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 loadCookieJar
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func loadCookieJar(path string) (http.CookieJar, error) {
file, err := os.Open(path)
if err != nil {
return nil, 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 Traefik.collectEntrypointRequestDuration
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (t *Traefik) collectEntrypointRequestDuration(mx map[string]int64, pms prometheus.Series) {
if pms = pms.FindByNames(
metricEntrypointRequestDurationSecondsCount,
metricEntrypointRequestDurationSecondsSum,
); pms.Len() == 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"