File gid.py
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Wontfix
import os
import urllib.request
from concurrent.futures import ThreadPoolExecutor, wait
from selenium import webdriver
from selenium.webdriver.common.by import By
Function __scroll
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def __scroll(self, limit):
if not self.quiet:
print("Scrolling...")
bottom_tag = self.driver.find_element(By.CSS_SELECTOR, "div[jsname='wEwttd']")
- 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 download_item
has 8 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
def download_item(index, query, query_destination, image_url, preview_src, resize, file_format, pbar=None):
Function __get_image_values
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __get_image_values(self, index, image_item):
self.driver.execute_script("arguments[0].scrollIntoView(true);", image_item)
side_menu_tag = None
- 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 __download_items
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __download_items(self, query, destination, image_items, resize, limit, file_format, pbar=None):
query_destination = os.path.join(destination, query)
running_downloads = 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 __download_items
has 7 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
def __download_items(self, query, destination, image_items, resize, limit, file_format, pbar=None):
Function save_image
has 6 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
def save_image(index, image, query, query_destination, resize, file_format):
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, browser=DEFAULT_BROWSER, show=DEFAULT_SHOW, debug=DEFAULT_DEBUG, quiet=DEFAULT_QUIET,
disable_safeui=DEFAULT_DISABLE_SAFEUI):
logger.debug(f"browser : {browser}")
logger.debug(f"show : {show}")
logger.debug(f"debug : {debug}")
- 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 download
has 5 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
def download(self, query, destination=DEFAULT_DESTINATION, limit=DEFAULT_LIMIT,
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Wontfix
def __init__(self, browser=DEFAULT_BROWSER, show=DEFAULT_SHOW, debug=DEFAULT_DEBUG, quiet=DEFAULT_QUIET,
Function download
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def download(self, query, destination=DEFAULT_DESTINATION, limit=DEFAULT_LIMIT,
resize=DEFAULT_RESIZE, file_format=DEFAULT_FORMAT):
query_destination_folder = os.path.join(destination, query)
os.makedirs(query_destination_folder, exist_ok=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"