Skip to content

Commit

Permalink
Flake8: Resolve various I Q0 SIM B9 A D violations (smicallef#1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoles authored Sep 2, 2021
1 parent 7d1c8ac commit 18f7101
Show file tree
Hide file tree
Showing 32 changed files with 121 additions and 126 deletions.
3 changes: 2 additions & 1 deletion modules/sfp_alienvault.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
import urllib.error
import urllib.parse
import urllib.request

from datetime import datetime

from netaddr import IPNetwork

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


Expand Down
1 change: 1 addition & 0 deletions modules/sfp_alienvaultiprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# -------------------------------------------------------------------------------

from netaddr import IPAddress, IPNetwork

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


Expand Down
3 changes: 2 additions & 1 deletion modules/sfp_c99.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# -------------------------------------------------------------------------------

import json
from spiderfoot import SpiderFootPlugin, SpiderFootEvent

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


class sfp_c99(SpiderFootPlugin):
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_citadel.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# -------------------------------------------------------------------------------

import json
import time
import urllib.error
import urllib.parse
import urllib.request
import time

from spiderfoot import SpiderFootEvent, SpiderFootPlugin

Expand Down
1 change: 1 addition & 0 deletions modules/sfp_debounce.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# -------------------------------------------------------------------------------

import json

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


Expand Down
3 changes: 2 additions & 1 deletion modules/sfp_dehashed.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
# Licence: GPL
# -------------------------------------------------------------------------------

import base64
import json
import time
import base64

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_dnsdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

import json
import re
import time

from spiderfoot import SpiderFootEvent, SpiderFootPlugin
import time


class sfp_dnsdb(SpiderFootPlugin):
Expand Down
1 change: 1 addition & 0 deletions modules/sfp_dnsdumpster.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# -------------------------------------------------------------------------------

import re

from bs4 import BeautifulSoup

from spiderfoot import SpiderFootEvent, SpiderFootPlugin
Expand Down
1 change: 1 addition & 0 deletions modules/sfp_emailformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# -------------------------------------------------------------------------------

import re

from bs4 import BeautifulSoup

from spiderfoot import SpiderFootEvent, SpiderFootPlugin
Expand Down
5 changes: 4 additions & 1 deletion modules/sfp_filemeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@
import io
import mimetypes

import PyPDF2

import docx

import exifread

import pptx
import PyPDF2

from spiderfoot import SpiderFootEvent, SpiderFootPlugin

Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_gleif.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
# Licence: GPL
# -------------------------------------------------------------------------------

import urllib
import json
import urllib

from spiderfoot import SpiderFootEvent, SpiderFootPlugin, SpiderFootHelpers
from spiderfoot import SpiderFootEvent, SpiderFootHelpers, SpiderFootPlugin


class sfp_gleif(SpiderFootPlugin):
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_googlemaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# Licence: GPL
# -------------------------------------------------------------------------------

import urllib
import json
import urllib

from spiderfoot import SpiderFootEvent, SpiderFootPlugin

Expand Down
1 change: 1 addition & 0 deletions modules/sfp_grayhatwarfare.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import json
import time
import urllib

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


Expand Down
4 changes: 2 additions & 2 deletions modules/sfp_haveibeenpwned.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# -------------------------------------------------------------------------------

import json
import time
import re
import time

from spiderfoot import SpiderFootEvent, SpiderFootPlugin

Expand Down Expand Up @@ -216,7 +216,7 @@ def handleEvent(self, event):
try:
source = n.get("Source")
site = source
if source in sites.keys():
if source in sites:
site = f"{sites[n.get('Source')]}{n.get('Id')}"
links.add(site)

Expand Down
1 change: 1 addition & 0 deletions modules/sfp_multiproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# -------------------------------------------------------------------------------

from netaddr import IPAddress, IPNetwork

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


Expand Down
1 change: 1 addition & 0 deletions modules/sfp_nameapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# -------------------------------------------------------------------------------

import json

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_opencorporates.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# Licence: GPL
# -------------------------------------------------------------------------------

import urllib
import json
import urllib

from spiderfoot import SpiderFootEvent, SpiderFootPlugin

Expand Down
1 change: 1 addition & 0 deletions modules/sfp_portscan_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import time

from netaddr import IPNetwork

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import json
import time

from spiderfoot import SpiderFootEvent, SpiderFootPlugin, SpiderFootHelpers
from spiderfoot import SpiderFootEvent, SpiderFootHelpers, SpiderFootPlugin


class sfp_spider(SpiderFootPlugin):
Expand Down
1 change: 1 addition & 0 deletions modules/sfp_torexits.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# -------------------------------------------------------------------------------

import re

from netaddr import IPAddress, IPNetwork

from spiderfoot import SpiderFootEvent, SpiderFootPlugin
Expand Down
2 changes: 1 addition & 1 deletion modules/sfp_trashpanda.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# Licence: GPL
# -------------------------------------------------------------------------------

import json
import base64
import json
import re

from spiderfoot import SpiderFootEvent, SpiderFootPlugin
Expand Down
1 change: 1 addition & 0 deletions modules/sfp_trumail.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# -------------------------------------------------------------------------------

import json

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


Expand Down
1 change: 1 addition & 0 deletions modules/sfp_voipbl.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# -------------------------------------------------------------------------------

from netaddr import IPAddress, IPNetwork

from spiderfoot import SpiderFootEvent, SpiderFootPlugin


Expand Down
4 changes: 3 additions & 1 deletion modules/sfp_whois.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
# -------------------------------------------------------------------------------

import ipwhois
import whois

from netaddr import IPAddress

from spiderfoot import SpiderFootEvent, SpiderFootPlugin

import whois


class sfp_whois(SpiderFootPlugin):

Expand Down
31 changes: 17 additions & 14 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
[flake8]
flake8-max-line-length = 120
max-line-length = 120
max-complexity = 80
max-complexity = 60
select = C,E,F,W,I,B,DUO,D,R,A,S,Q0,SIM,SFS
# Note: B9 and SIM tests should be reviewed and fixed instead of ignored
ignore = E501 W503 B006 E800 B9 SFS301 SF01 Q000 SIM102 SIM110 SIM111 SIM113 SIM115 SIM118
# Note: D and SIM tests should be reviewed and fixed instead of ignored
ignore = E501 W503 B006 E800 SFS301 SF01 Q000 SIM102 SIM113 SIM115 D100 D104
# Note: most of these should be fixed instead of ignored
per-file-ignores =
spiderfoot/event.py:A,D
spiderfoot/plugin.py:I,D
spiderfoot/db.py:A,D,SFS101,SIM106
sf.py:I,D,SFS101,SFS201
sflib.py:I,D,SFS101
sfwebui.py:A,I,D,SFS101,Q003
sfscan.py:I,D,SIM105,SIM109
modules/*:I,D
spiderfoot/plugin.py:D,B902
spiderfoot/db.py:D,SFS101,B902
spiderfoot/helpers.py:D
spiderfoot/target.py:D
spiderfoot/logger.py:D
sf.py:I,D,SFS201,B902
sflib.py:I,D,SFS101,SIM110,SIM111,B902
sfwebui.py:A,B902
sfscan.py:I,D,SIM105,B902
modules/*:D,B902
modules/sfp_binaryedge.py:D,B902,C901
modules/sfp__stor_stdout.py:D,SFS201
modules/sfp_bitcoin.py:D,SFS101
modules/sfp_reversewhois.py:D,R504
modules/sfp_zetalytics.py:D,R504
spiderfoot/*:I,D
modules/sfp_ripe.py:D,SIM110,B902
modules/sfp_zetalytics.py:D,R504,B902
spiderfoot/__init__.py:I,D,F401
sfcli.py:D
sfcli.py:D,B902
test/*:I,D,SIM117
docs/conf.py:A,D

Expand Down
2 changes: 1 addition & 1 deletion sfscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def __init__(self, scanName, scanId, targetValue, targetType, moduleList, global
proxy_port = int(self.__config.get('_socks3port') or 0)

if not proxy_port:
if proxy_type == '4' or proxy_type == '5':
if proxy_type in ['4', '5']:
proxy_port = 1080
elif proxy_type.upper() == 'HTTP':
proxy_port = 8080
Expand Down
Loading

0 comments on commit 18f7101

Please sign in to comment.