Showing 873 of 873 total issues
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, font="/$$rp/data/font/Roboto-Bold.ttf", pixel_size=16, align="left",
Function _init_showbase
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _init_showbase(self, base):
""" Inits the the given showbase object. This is part of an alternative
method of initializing the showbase. In case base is None, a new
ShowBase instance will be created and initialized. Otherwise base() is
expected to either be an uninitialized ShowBase instance, or an
- 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 _load_and_parse_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _load_and_parse_file(self, pth):
""" Loads a .IES file from a given filename, returns an IESDataset
which is used by the load function later on. """
self.debug("Loading ies profile from", pth)
- 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.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)
Function construct_yaml_float
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def construct_yaml_float(self, node):
value = 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 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 = '.nan'
elif data == self.inf_value:
value = '.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, name, index, line, column, buffer, pointer):
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, token_number, required, index, line, column, mark):
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 self.encoding:
data = data.encode(self.encoding)
self.stream.write(data)
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 br == '\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 br == '\n':
self.write_line_break()
else:
self.write_line_break(br)
self.write_indent()
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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None,
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 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)