Showing 83 of 197 total issues
Avoid too many return
statements within this function. Open
return "%.1fMB" % (float(b) / (1024 * 1024))
Avoid too many return
statements within this function. Open
return display_help(options)
Avoid too many return
statements within this function. Open
return super().getPrevUrl(url, data)
Avoid too many return
statements within this function. Open
return self.stripUrl % 'Kickstarter+Stories/54'
Avoid too many return
statements within this function. Open
return self.stripUrl % 'Book+0/81'
Avoid too many return
statements within this function. Open
return director.getComics(options)
Avoid too many return
statements within this function. Open
return "%.2fGB" % (float(b) / (1024 * 1024 * 1024))
Avoid too many return
statements within this function. Open
return super(PeterIsTheWolfGeneral, self).getPrevUrl(url, data)
Avoid too many return
statements within this function. Open
return "%.1fGB" % (float(b) / (1024 * 1024 * 1024))
Avoid too many return
statements within this function. Open
return vote_comics(options)
Function getPrevUrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def getPrevUrl(self, url, data):
# Fix missing navigation links between books
if url == self.stripUrl % 'Book+5/1':
return self.stripUrl % 'Book+4/203'
elif url == self.stripUrl % 'Book+4/1':
- 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 write
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write(self, s, level=0, color=None):
"""Write message with indentation, context and optional timestamp."""
if level > self.level:
return
if self.timestamps:
- 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 find_dups
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_dups(self, name):
"""Check if comic name already exists."""
names = [(tmpl % name).lower() for tmpl in self.dup_templates]
if names:
for scraper in scrapers.all():
- 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 collect_results
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def collect_results(self):
"""Parse the front page."""
data = self.get_url('http://keenspot.com/')
for comiclink in data.xpath('//td[@id]/a'):
- 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_plugin_modules
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_plugin_modules():
"""Find (and import) all valid modules in the "plugins" package.
@return: all loaded valid modules
@rtype: iterator of module
"""
- 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_cbz
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_cbz(directory):
"""Creates or updates a CBZ from files in the given comic directory."""
if not os.path.isdir(directory):
print("ERROR: Directory", directory, "not found.")
return
- 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 namer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def namer(self, imageUrl, pageUrl):
# Fix duplicate filenames
filename = imageUrl.rsplit('/', 1)[-1]
if '2015/12/jamet101' in imageUrl:
filename = filename.replace('101', '10')
- 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 extract_css_bg
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extract_css_bg(self, page) -> str | None:
comicdivs = self.match(page, '//div[@id="comic"]')
if comicdivs:
style = comicdivs[0].attrib.get('style')
if style:
- 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_existing_comics
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_existing_comics(basepath=None, adult=True, listing=False):
for scraperobj in scrapercache.all(include_removed=True):
dirname = scraperobj.get_download_dir(basepath)
if os.path.isdir(dirname):
if shouldRunScraper(scraperobj, adult, listing):
- 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 copy_after_end
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def copy_after_end(self, src, dest):
skip = True
for line in src:
if line.strip().startswith(self.END):
skip = 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"