Showing 1,088 of 2,665 total issues
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None,
Function __eq__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __eq__(self, other):
if isinstance(other, OrderedDict):
if len(self) != len(other):
return False
for p, q in zip(self.items(), other.items()):
- 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 sparkline
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
sparkline: function (prefix, chart, dimension, units, suffix) {
if (options.data === null || typeof options.data.charts === 'undefined') {
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 genHash
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
genHash: function (forReload) {
var hash = urlOptions.hash;
if (urlOptions.pan_and_zoom === true) {
hash += ';after=' + urlOptions.after.toString() +
- 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
Avoid deeply nested control flow statements. Open
if (tagName[0] === '/') {
if (tagName !== ('/' + openTags[0])) {
config.errMsg = 'ERROR en HTML: the top of the stack should be the tag that closes';
} else {
Avoid deeply nested control flow statements. Open
if (countChars <= config.showChars) {
bag += content.charAt(i); // Fix to ie 7 not allowing you to reference string characters using the []
countChars++;
} else {
// Now I have the characters needed
Function generateHeadCharts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function generateHeadCharts(type, chart, duration) {
if (urlOptions.mode === 'print') {
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
Avoid deeply nested control flow statements. Open
if (copyIsArray) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
clone = src && jQuery.isPlainObject(src) ? src : {};
Avoid deeply nested control flow statements. Open
} else if (copy !== undefined) {
target[name] = copy;
}
Function expect_first_flow_mapping_key
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def expect_first_flow_mapping_key(self):
if isinstance(self.event, MappingEndEvent):
self.indent = self.indents.pop()
self.flow_level -= 1
self.write_indicator('}', False)
- 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
Avoid deeply nested control flow statements. Open
if self.encoding:
data = data.encode(self.encoding)
self.stream.write(data)
Avoid deeply nested control flow statements. Open
if br == '\n':
self.write_line_break()
else:
self.write_line_break(br)
if ch is not None:
Avoid deeply nested control flow statements. Open
if br == '\n':
self.write_line_break()
else:
self.write_line_break(br)
if ch is not None:
Function get_snippet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_snippet(self, indent=4, max_length=75):
if self.buffer is None:
return None
head = ''
start = self.pointer
- 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
Avoid deeply nested control flow statements. Open
if br == '\n':
self.write_line_break()
else:
self.write_line_break(br)
self.write_indent()
Avoid deeply nested control flow statements. Open
if not isinstance(subnode, MappingNode):
raise ConstructorError("while constructing a mapping",
node.start_mark,
"expected a mapping for merging, but found %s"
% subnode.id, subnode.start_mark)
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, name, index, line, column, buffer, pointer):
Avoid deeply nested control flow statements. Open
if self.encoding:
data = data.encode(self.encoding)
self.stream.write(data)
Avoid deeply nested control flow statements. Open
if self.encoding:
data = data.encode(self.encoding)
self.stream.write(data)
Avoid deeply nested control flow statements. Open
if self.peek(k) not in '0123456789ABCDEFabcdef':
raise ScannerError("while scanning a double-quoted scalar", start_mark,
"expected escape sequence of %d hexdecimal numbers, but found %r" %
(length, self.peek(k)), self.get_mark())
code = int(self.prefix(length), 16)