arxiv_sanity_bot/arxiv/extract_graph.py
Consider simplifying this complex logical expression. Wontfix
Wontfix
if color is not None and is_grayish_or_blackish(color):
good_or_bad = _good_aspect_ratio_gray(ratio) and _good_width_and_height(r) and area > 1000
# print(f"{ratio} {area} {r.width} {r.height} -> {good_or_bad}")
return good_or_bad
Function _is_not_noise
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def _is_not_noise(r, color):
ratio = r.width / (r.height + 1e-3)
area = r.width * r.height
# Black lines
- 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"