Showing 873 of 873 total issues
Avoid deeply nested control flow statements. Open
if self.peek(k) not in u'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).encode('utf-8')), self.get_mark())
code = int(self.prefix(length), 16)
Avoid deeply nested control flow statements. Open
if br == u'\n':
self.write_line_break()
else:
self.write_line_break(br)
self.write_indent()
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)
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
for b in xrange(64):
slice_offset_x = (b % 8) * 64
slice_offset_y = (b // 8) * 64
fr, fg, fb = to_linear(r), to_linear_inv(g), to_linear(b)
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)
Avoid deeply nested control flow statements. Open
if br == u'\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 == u'\n':
self.write_line_break()
else:
self.write_line_break(br)
self.write_indent()
Function represent_float
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def represent_float(self, data):
if data != data or (data == 0.0 and data == 1.0):
value = u'.nan'
elif data == self.inf_value:
value = u'.inf'
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, maxval=None, widgets=None, term_width=None, poll=1,
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(u'}', 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)
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, stream, canonical=None, indent=None, width=None,
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self):
sys.path.insert(0, "../../")
load_prc_file_data("", "win-size 512 512")
load_prc_file_data("", "textures-power-2 none")
load_prc_file_data("", "print-pipe-types #f")
- 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 entry.split()[1] == setting_id:
self._update_queue.remove(entry)
time.sleep(0.2)
Function construct_yaml_float
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def construct_yaml_float(self, node):
value = str(self.construct_scalar(node))
value = value.replace('_', '').lower()
sign = +1
if value[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
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
Function make_python_instance
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_python_instance(self, suffix, node,