Showing 1,088 of 2,665 total issues
Method Typesense.collectStats
has 5 return statements (exceeds 4 allowed). Open
func (ts *Typesense) collectStats(mx map[string]int64) error {
if !ts.doStats || ts.APIKey == "" {
return nil
}
Method DNSQuery.verifyConfig
has 5 return statements (exceeds 4 allowed). Open
func (d *DNSQuery) verifyConfig() error {
if len(d.Domains) == 0 {
return errors.New("no domains specified")
}
Function getUser
has 5 return statements (exceeds 4 allowed). Open
func getUser() (user string) {
if user = os.Getenv("LOGNAME"); user != "" {
return user
}
if user = os.Getenv("USER"); user != "" {
Function dygraphGetSeriesStyle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.dygraphGetSeriesStyle = function(dygraphOptions) {
const seriesStyleStr = dygraphOptions.perSeriesStyle;
let formattedStyles = {};
if (seriesStyleStr === '') {
- 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 getLocaleString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getLocaleString: 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 getIntlNumberFormat
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
getIntlNumberFormat: function (min, max) {
let key = max;
if (min === max) {
if (typeof this.formattersFixed[key] === 'undefined') {
this.formattersFixed[key] = new Intl.NumberFormat(undefined, {
- 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 Reader.open
has 5 return statements (exceeds 4 allowed). Open
func (r *Reader) open() error {
path := r.findFile()
if path == "" {
r.log.Debugf("couldn't find log file, used path: '%s', exclude_path: '%s'", r.path, r.excludePath)
return ErrNoMatchedFile
Function easypiechartSetSelection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.easypiechartSetSelection = function (state, t) {
if (state.timeIsVisible(t) !== true) {
return NETDATA.easypiechartClearSelection(state, 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 selected2BooleanArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
dimensionsVisibility.prototype.selected2BooleanArray = function (array) {
let ret = [];
this.selected_count = 0;
this.unselected_count = 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
Method globMatcher.globMatch
has 5 return statements (exceeds 4 allowed). Open
func (m globMatcher) globMatch(name string) (matched bool, err error) {
pattern := string(m)
Pattern:
for len(pattern) > 0 {
var star bool
Function loadRequiredJs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.loadRequiredJs = function (index, callback) {
if (index >= NETDATA.requiredJs.length) {
if (typeof callback === 'function') {
return callback();
}
- 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 setMaster
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
setMaster: function (state) {
if (!this.enabled()) {
this.stop();
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 prepare
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
prepare: function (state) {
let has_custom_colors = false;
if (typeof state.tmp.__commonColors === 'undefined') {
let defname = state.chart.context;
- 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 Duration.UnmarshalYAML
has 5 return statements (exceeds 4 allowed). Open
func (d *Duration) UnmarshalYAML(unmarshal func(any) error) error {
var s string
if err := unmarshal(&s); err != nil {
return err
Function Open
has 5 return statements (exceeds 4 allowed). Open
func Open(path string, excludePath string, log *logger.Logger) (*Reader, error) {
var err error
if path, err = filepath.Abs(path); err != nil {
return nil, err
}
Function d3pieChartCreate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
NETDATA.d3pieChartCreate = function (state, data) {
state.element_chart.id = 'd3pie-' + state.uuid;
// console.log('id = ' + state.element_chart.id);
- 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 alarmsCallback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function alarmsCallback(data) {
var count = 0, x;
for (x in data.alarms) {
if (!data.alarms.hasOwnProperty(x)) {
continue;
- 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 scan_block_scalar_indentation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def scan_block_scalar_indentation(self):
# See the specification for details.
chunks = []
max_indent = 0
end_mark = self.get_mark()
- 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 scan_flow_scalar_spaces
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def scan_flow_scalar_spaces(self, double, start_mark):
# See the specification for details.
chunks = []
length = 0
while self.peek(length) in ' \t':
- 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 determine_block_hints
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def determine_block_hints(self, text):
hints = ''
if text:
if text[0] in ' \n\x85\u2028\u2029':
hints += str(self.best_indent)
- 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"