Showing 203 of 446 total issues
Avoid deeply nested control flow statements. Open
if cmd.success == False:
summary+=" %s\n" % (str(cmd))
elif cmd.name in important_commands and cmd.success:
#check = ['+ ERROR','+ FAILED']
#errors = any([ s in c for s in check ])
Avoid deeply nested control flow statements. Open
if mq.check_connection(vm):
logging.debug("got connection from %s" % vm)
return True, "Login VM"
sleep(10)
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, apk_id, apk_file, package_name, apk_conf_files, apk_conf_gzip, apk_launch_activity):
Avoid deeply nested control flow statements. Open
if status == "INSTALL":
logging.debug("waiting for the install to finish: %s/%s" % (i, max_install))
sleep(60)
else:
break
Function revertLastSnapshot
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def revertLastSnapshot(self, vmx):
snap = self.listSnapshots(vmx)
if len(snap) > 0:
for s in range(len(snap) - 1, -1, -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 push
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def push(flargs):
vm_name, args = flargs
kind = args.kind
vm = VMachine(vm_conf_file, vm_name)
- 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
Avoid deeply nested control flow statements. Open
if a:
print "sample SAVED on db"
#os.system('sudo rm -fr %s') % build_zip_dst
else:
print "sample NOT SAVED on db"
Function add_result
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_result(test_id, result, comment="", elapsed=0, defects="", version=0 ):
Function send_files
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def send_files(self, src_dir, dst_dir, filestocopy):
with vSphere(self.path, self.sdkhost, self.sdkuser, self.sdkdomain, self.sdkpasswd) as vm:
self._run_vm(vm, "login_in_guest", self.user, self.passwd)
- 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 revertLastSnapshot
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def revertLastSnapshot(self,vmx):
snap = self.listSnapshots(vmx)
if len(snap) > 0:
for s in range(len(snap)-1,-1,-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 result_view
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def result_view(t_id, name, kind):
""" Test Result page
Show results of scheduled test on spcific virtual machine
"""
test = Test.query.filter_by(id=t_id).first_or_404()
- 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
Avoid deeply nested control flow statements. Open
if cmd:
report.sent(p.vm, cmd)
else:
logging.info("- RECEIVE ERROR, ENDING: %s" %c)
self.end(c)
Function _factory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _factory(name, success, args, result, vm, timestamp = None):
Function percentSame
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def percentSame(image1, image2):
'''
Returns the percent of pixels that are equal
@author: catshoes
- 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 execute_pull
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def execute_pull(self):
""" build and execute the """
print "- Host: %s %s\n" % (self.hostname, time.ctime())
operation = 'AVMonitor'
- 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
Avoid deeply nested control flow statements. Open
if "python.exe" in out or script_name in out or "cmd.exe" in out:
found = True
print "DBG process found for %s!" % vm_name
if found == True:
Avoid deeply nested control flow statements. Open
if current_proc not in failed_kind:
failed_kind[current_proc] = []
failed_kind[current_proc].append(vm)
Function check_evidences
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_evidences(backend, type_ev, key=None, value=None):
connection.host = backend
logging.debug("type_ev: %s, filter: %s=%s" % (type_ev, key, value))
number = 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
Avoid deeply nested control flow statements. Open
for i in range(10):
self._click_mouse(100 + i, 0)
Avoid deeply nested control flow statements. Open
if upgraded:
break
if not upgraded: