superhedgy / AttackSurfaceMapper

AttackSurfaceMapper is a tool that aims to automate the reconnaissance process.
https://AttackSurfaceMapper.com
GNU General Public License v3.0
1.3k stars 192 forks source link

Lint code with flake8 to find undefined names #17

Closed cclauss closed 4 years ago

cclauss commented 5 years ago

flake8 testing of https://github.com/testing of https://github.com/superhedgy/AttackSurfaceMapper on Python 3.7.1

$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

./ASM.py:863:3: F821 undefined name 'driver'
        driver.close()
  ^
./ASM.py:864:3: F821 undefined name 'driver'
        driver.quit()
  ^
./modules/buckethunter.py:14:2: F821 undefined name 'colorama'
    colorama.init()
 ^
./modules/buckethunter.py:16:13: F821 undefined name 'Fore'
        "action": Fore.YELLOW,
            ^
./modules/buckethunter.py:17:15: F821 undefined name 'Fore'
        "positive": Fore.GREEN + Style.BRIGHT,
              ^
./modules/buckethunter.py:17:28: F821 undefined name 'Style'
        "positive": Fore.GREEN + Style.BRIGHT,
                           ^
./modules/buckethunter.py:18:11: F821 undefined name 'Fore'
        "info": Fore.YELLOW,
          ^
./modules/buckethunter.py:19:12: F821 undefined name 'Style'
        "reset": Style.RESET_ALL,
           ^
./modules/buckethunter.py:20:10: F821 undefined name 'Fore'
        "red": Fore.RED,
         ^
./modules/buckethunter.py:21:13: F821 undefined name 'Fore'
        "white" : Fore.WHITE,
            ^
./modules/buckethunter.py:22:13: F821 undefined name 'Fore'
        "green" : Fore.GREEN,
            ^
./modules/buckethunter.py:23:14: F821 undefined name 'Fore'
        "yellow" : Fore.YELLOW
             ^
./modules/buckethunter.py:28:38: F821 undefined name 'Fore'
        print("{0}\n[*] Error: {1}".format(Fore.RED+Style.BRIGHT,Style.RESET_ALL+Fore.WHITE+msg))
                                     ^
./modules/buckethunter.py:28:47: F821 undefined name 'Style'
        print("{0}\n[*] Error: {1}".format(Fore.RED+Style.BRIGHT,Style.RESET_ALL+Fore.WHITE+msg))
                                              ^
./modules/buckethunter.py:28:60: F821 undefined name 'Style'
        print("{0}\n[*] Error: {1}".format(Fore.RED+Style.BRIGHT,Style.RESET_ALL+Fore.WHITE+msg))
                                                           ^
./modules/buckethunter.py:28:76: F821 undefined name 'Fore'
        print("{0}\n[*] Error: {1}".format(Fore.RED+Style.BRIGHT,Style.RESET_ALL+Fore.WHITE+msg))
                                                                           ^
./modules/buckethunter.py:32:9: F821 undefined name 'Style'
        print(Style.RESET_ALL)
        ^
./modules/webscraper.py:23:13: F821 undefined name 'session'
        r = session.get(url)
            ^
./modules/weleakinfo.py:38:30: F821 undefined name 'result'
                    result = result + "," + item
                             ^
19    F821 undefined name 'driver'
19

E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.

superhedgy commented 5 years ago

Thanks running flake8 on ASM. I will have a look as soon as I get some free time.