Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined names: nameserver and files #11

Closed
cclauss opened this issue Nov 12, 2017 · 4 comments
Closed

Undefined names: nameserver and files #11

cclauss opened this issue Nov 12, 2017 · 4 comments

Comments

@cclauss
Copy link

cclauss commented Nov 12, 2017

flake8 testing of https://github.com/UltimateHackers/Striker on Python 2.7.14

$ time flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./plugins/discovery/dnssearch.py:105:31: F821 undefined name 'nameserver'
            self.nameserver = nameserver
                              ^

./plugins/discovery/dnssearch.py:193:31: F821 undefined name 'nameserver'
            self.nameserver = nameserver
                              ^

./plugins/discovery/googleCSE.py:41:71: F821 undefined name 'files'
                     "&start=" + str(self.counter) + "&q=filetype:" + files +"%20site:" + self.word)
                                                                      ^
F821 undefined name 'nameserver'
@ladyleet1337
Copy link

[?] Enter the target: Traceback (most recent call last):
File "striker.py", line 38, in
target = raw_input('\033[1;34m[?]\033[1;m Enter the target: ')
EOFError

getting this error.

@s0md3v s0md3v closed this as completed in ff3d914 Nov 13, 2017
s0md3v added a commit that referenced this issue Nov 13, 2017
@cclauss
Copy link
Author

cclauss commented Jan 4, 2018

The first issue is closed but the second and third still exist.

@s0md3v
Copy link
Owner

s0md3v commented Jan 4, 2018

Why we need to name them if the script does what its designed to do without any problems? ;_;

@cclauss
Copy link
Author

cclauss commented Jan 4, 2018

PEP 20 line 2: Explicit is better than implicit.

The issue is that if this code gets run or modified in a way where these implicit variables are not defined then a NameError is raised at runtime. Making them explicit results in code that is less prone to runtime failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants