Showing 6 of 6 total issues
Function get
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get( # noqa: PLR0913
self,
url: str,
save_path: str | Path = ".",
*,
- 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
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def get( # noqa: PLR0913
Function get_bulk
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_bulk(args: argparse.Namespace) -> None:
g = GetJump()
next_uri = args.url
if not args.quiet:
print("get:", next_uri)
- 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 __save_images
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __save_images(
Function login
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def login(
Function __get_image
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def __get_image(self, image_src: str, div: int = 4, mul: int = 8) -> Image.Image:
img = Image.open(BytesIO(requests.get(image_src, timeout=10).content))
img_width, img_height = img.size
fixed_width = int(float(img_width) / (div * mul)) * mul
fixed_height = int(float(img_height) / (div * mul)) * mul
- 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"