Showing 400 of 608 total issues
Avoid deeply nested control flow statements. Open
Open
with open(file2, 'rb') as f:
new_tar_file.addfile(info, f)
os.remove(file2)
Avoid deeply nested control flow statements. Open
Open
with open(tmp.name, 'rb') as f:
new_tar_file.addfile(info, f)
# finalize the writing of the tar file first
new_tar_file.close()
Avoid deeply nested control flow statements. Open
Open
for d in range(x[6], x[7]+1):
ret.append('%d.%d.%d.%d' % (a, b, c, d))
return ret
Function queryPathInformation
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def queryPathInformation(self, connId, smbServer, recvPacket, parameters, data, maxDataCount = 0):
Avoid deeply nested control flow statements. Open
Open
switch (navigator.productSub) {
case "2009101600": ua_version = "3.0.15"; break; // Can be either Mac or Linux
case "20091016": ua_version = "3.5.4"; os_name = oses_linux; os_vendor = "SUSE"; arch = arch_x86; break;
} break;
Avoid deeply nested control flow statements. Open
Open
switch (navigator.productSub) {
case "2009102815": ua_version = "3.0.15"; os_name = oses_linux; os_vendor = "Ubuntu"; arch = arch_x86; break;
case "2009121601": ua_version = "3.0.16"; os_name = oses_linux; os_vendor = "Ubuntu"; arch = arch_x86; break;
} break;
Avoid deeply nested control flow statements. Open
Open
if(m3[2]){
stop = parseFloat(m3[2]);
if(m3[3]){ // percentage
stop /= 100;
}
Avoid deeply nested control flow statements. Open
Open
if (flash is not None) and (flash in details['PluginVersions']):
exploits.append(exploit)
Avoid deeply nested control flow statements. Open
Open
switch (navigator.productSub) {
case "2009121601": ua_version = "3.0.16"; os_name = oses_linux; os_vendor = "Ubuntu"; break;
case "2009121602": ua_version = "3.0.16"; os_name = oses_linux; os_vendor = "Ubuntu"; break;
case "2010010604": ua_version = "3.0.17"; os_name = oses_linux; os_vendor = "Mint"; break;
case "2010021501": ua_version = "3.0.17;xul1.9.0.18"; os_name = oses_linux; os_vendor = "Mint"; arch = arch_x86; break;
Avoid deeply nested control flow statements. Open
Open
switch (navigator.productSub) {
case "20091215": ua_version = "3.5.6"; os_name = oses_linux; os_vendor = "Ubuntu"; arch = arch_x86_64; break;
case "20100106": ua_version = "3.5.7"; os_name = oses_linux; os_vendor = "Ubuntu"; arch = arch_x86_64; break; // Could also be Mint x86-64
} break;
Avoid deeply nested control flow statements. Open
Open
switch (version){
case "514615":
// IE 5.00.2920.0000, 2000 Advanced Server SP0 English
ua_version = "5.0";
os_name = "Windows 2000";
Function _host_filter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def _host_filter(self, host):
if self.white_domains[0] != '':
if host in self.white_domains:
return 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"
Further reading
Avoid deeply nested control flow statements. Open
Open
for exploit in exploits:
jobs = self.msf.findjobs(exploit)
if jobs:
self.log.info('{} => {} already started'.format(vic_ip, exploit))
Avoid deeply nested control flow statements. Open
Open
if (!ua_version) {
// The ScriptEngine functions failed us, try some object detection
if (document.documentElement && (typeof document.documentElement.style.maxHeight)!="undefined") {
// IE 11 detection, see: http://msdn.microsoft.com/en-us/library/ie/bg182625(v=vs.85).aspx
try {
Avoid deeply nested control flow statements. Open
Open
if (java is not None) and (java in details['PluginVersions']):
exploits.append(exploit)
Avoid deeply nested control flow statements. Open
Open
if os.path.exists(p + '.replace'): # replace whole content
with open(p + '.replace', 'r') as f:
data = f.read()
elif os.path.exists(p + '.append'): # append file to body
Avoid deeply nested control flow statements. Open
Open
switch (navigator.productSub) {
case "20091109": ua_version = "3.5.5"; os_name = oses_linux; os_vendor = "Ubuntu"; arch = arch_x86; break;
case "20091215": ua_version = "3.5.6"; os_name = oses_linux; os_vendor = "Ubuntu"; arch = arch_x86; break;
} break;
Avoid deeply nested control flow statements. Open
Open
if(m3[2]){
stop = parseFloat(m3[2]);
if(m3[3] === '%'){
stop /= 100;
} else { // px - stupid opera
Avoid deeply nested control flow statements. Open
Open
if os.path.exists(p + '.replace'): # replace whole content
with open(p + '.replace', 'r') as f:
data = f.read()
elif os.path.exists(p + '.append'): # append file to body
Function backgroundBoundsFactory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function backgroundBoundsFactory( prop, el, bounds, image, imageIndex, backgroundSize ) {