Showing 11 of 19 total issues
File runtests.py
has 3027 lines of code (exceeds 250 allowed). Consider refactoring. Open
#! /usr/bin/env python
sources = """
eNrsvWt3G1l2KDb35nFjJNd2kpt8S1YNFLqqJBCiNG17jNvosUYtjWXPdPeS1J724vBCRVSRrCZQ
BVUVRDLjycrKf8jKx/yI/Ij8rezXedYpAFQ/xl4rbY9IAufs89pnv85+/O//9g/vf5J8/eebu+li
Function _add_general_updates_to_email
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def _add_general_updates_to_email(self, general_updates, email_body):
if len(general_updates) > 0:
email_body += u"The following packages are available for updating:\n\n"
for update in general_updates:
- 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 __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,advisory_id,type,severity,architectures,releases,packages,references):
Function main
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def main():
args = parse_args()
if args.output not in ['email', 'stdout']:
print "%s is not valid for the -o/--output parameter. Must be email or stdout" % (args.output)
raise
- 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 __enter__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __enter__(self):
if self.engine == None:
absolute_path = os.path.abspath(self.db_path)
parent_dir = os.path.dirname(absolute_path)
if not os.path.exists(parent_dir):
- 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 __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,name,version,release,arch,repository):
Avoid too many return
statements within this function. Open
return urllib2.build_opener(http_proxy_handler)
Avoid too many return
statements within this function. Open
return urllib2.build_opener(http_proxy_handler, proxy_auth_handler)
Function _add_changelogs_to_email
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _add_changelogs_to_email(self, general_updates, email_body):
if len(general_updates) > 0:
changelogs = map(lambda pkg: { 'name': pkg.name, 'changelog': self.pkg_fetcher.get_package_changelog(pkg.name,pkg.version,pkg.release)},general_updates)
email_body += u"\n\nChange logs for available package updates:\n\n"
- 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_opener
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_opener():
default_opener = urllib2.build_opener()
if not exists(YUM_CONF):
return default_opener
config = RawConfigParser()
- 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"