Showing 49 of 49 total issues
Function match
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def match(self, e: Event) -> bool:
if self.select_keys:
values = [e.data.get(key, None) for key in self.select_keys]
else:
values = list(e.data.values())
- 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 setup_logging
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def setup_logging(
name: str,
testing=False,
verbose=False,
log_stderr=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 parse
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse(string: str, namespace: dict) -> QToken:
entries_str = string[1:-1]
d: Dict[str, QToken] = {}
while len(entries_str) > 0:
entries_str = entries_str.strip()
- 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 chunk_events_by_key
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def chunk_events_by_key(
events: List[Event], key: str, pulsetime: float = 5.0
) -> List[Event]:
"""
"Chunks" adjacent events together which have the same value for a key, and stores the
- 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 create_bucket
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_bucket(
Function create_bucket
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_bucket(
Function create_bucket
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_bucket(
Function create_bucket
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_bucket(
Function create_bucket
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_bucket(
Function update_bucket
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_bucket(
Function update_bucket
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_bucket(
Function update_bucket
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_bucket(
Function update_bucket
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_bucket(
Consider simplifying this complex logical expression. Open
if char == "'" and prev_char != "\\" and not double_quote:
single_quote = not single_quote
elif char == '"' and prev_char != "\\" and not single_quote:
double_quote = not double_quote
elif double_quote or single_quote:
Consider simplifying this complex logical expression. Open
if char == "'" and prev_char != "\\" and not double_quote:
single_quote = not single_quote
elif char == '"' and prev_char != "\\" and not single_quote:
double_quote = not double_quote
elif single_quote or double_quote:
Function query
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def query(
Function setup_logging
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def setup_logging(
Function check
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check(string: str):
token = ""
quotes_type = string[0]
if quotes_type != '"' and quotes_type != "'":
return token, string
- 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 check
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check(string: str):
token = ""
for i, char in enumerate(string):
if char.isalpha() or char == "_":
token += char
- 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 heartbeat_merge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def heartbeat_merge(
last_event: Event, heartbeat: Event, pulsetime: float
) -> Optional[Event]:
"""
Merges two events if they have identical data
- 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"