Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

Boolean Variable Check Simplification

Gormogon4207b3181744
diff --git a/ext/pythonwhois/net.py b/ext/pythonwhois/net.py
index 53f87baf..efa72d63 100644
--- a/ext/pythonwhois/net.py
+++ b/ext/pythonwhois/net.py
@@ -29,7 +29,7 @@ def get_whois_raw(domain, server="", previous=None, rfc3490=True, never_cut=Fals
is_exception = True
target_server = exc_serv
break
- if is_exception == False:
+ if not is_exception:
target_server = get_root_server(domain)
else:
target_server = server
@@ -57,7 +57,7 @@ def get_whois_raw(domain, server="", previous=None, rfc3490=True, never_cut=Fals
if re.search("Domain Name: %s\n" % domain.upper(), record):
response = record
break
- if never_cut == False:
+ if not never_cut:
new_list = [response] + previous
server_list.append(target_server)
for line in [x.strip() for x in response.splitlines()]:
diff --git a/ext/pythonwhois/parse.py b/ext/pythonwhois/parse.py
index 66217d60..e1fc3d83 100644
--- a/ext/pythonwhois/parse.py
+++ b/ext/pythonwhois/parse.py
@@ -438,7 +438,7 @@ def parse_raw_whois(raw_data, normalized=None, never_query_handles=True, handle_
for segment in raw_data:
for rule_key, rule_regexes in grammar['_data'].items():
- if (rule_key in data) == False:
+ if not (rule_key in data):
for line in segment.splitlines():
for regex in rule_regexes:
result = re.search(regex, line)
@@ -890,11 +890,11 @@ def parse_registrants(data, never_query_handles=True, handle_server=""):
if contact["handle"] == data_reference["handle"]:
found = True
data_reference.update(contact)
- if found == False:
+ if not found:
# The contact definition was not found in the supplied raw WHOIS data. If the
# method has been called with never_query_handles=False, we can use the supplied
# WHOIS server for looking up the handle information separately.
- if never_query_handles == False:
+ if not never_query_handles:
try:
contact = fetch_nic_contact(data_reference["handle"], handle_server)
data_reference.update(contact)
diff --git a/modules/sfp_names.py b/modules/sfp_names.py
index 5cd242eb..a3088318 100644
--- a/modules/sfp_names.py
+++ b/modules/sfp_names.py
@@ -120,7 +120,7 @@ class sfp_names(SpiderFootPlugin):
# If the first word is in the dictionary but the second isn't,
# subtract 40 points.
- if notindict == False:
+ if not notindict:
if first in self.d and second not in self.d:
p -= 20
diff --git a/sflib.py b/sflib.py
index f0f2e164..43fb57a8 100644
--- a/sflib.py
+++ b/sflib.py
@@ -147,7 +147,7 @@ class SpiderFoot:
return
def debug(self, message):
- if self.opts['_debug'] == False:
+ if not self.opts['_debug']:
return
frm = inspect.stack()[1]
mod = inspect.getmodule(frm[0])