Skip to content

Commit

Permalink
Merge pull request #34 from shenril/refactor/fix-codacy-issues
Browse files Browse the repository at this point in the history
Fix codacy issues on linting
  • Loading branch information
shenril authored Aug 20, 2019
2 parents ee05ceb + 80f3478 commit 0e60110
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion lib/modules/attacks/bruteforce/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from urllib.parse import urljoin
from concurrent.futures import ThreadPoolExecutor, as_completed
from lib.config.settings import Risk
from lib.utils.container import Services
from .. import AttackPlugin

Expand Down
1 change: 0 additions & 1 deletion lib/modules/attacks/other/robots.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import re
from urllib.parse import urljoin

from lib.utils.container import Services
Expand Down
9 changes: 6 additions & 3 deletions lib/request/requestfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ class RequestFactory:
def __init__(self):
pass

def make_multiple_requests(self, **kwargs):
@classmethod
def make_multiple_requests(cls, **kwargs):
return MultipleHTTPRequests(**kwargs)

def make_single_request(self, **kwargs):
@classmethod
def make_single_request(cls, **kwargs):
return SingleHTTPRequest(**kwargs)

def make_dns_request(self, **kwargs):
@classmethod
def make_dns_request(cls, **kwargs):
return DNSRequest(**kwargs)
8 changes: 4 additions & 4 deletions lib/utils/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ def __init__(self, level=0):

def finding(self, value):
print(
"{}[+]{} {}{}{}".format(Output.g, Output.e, Output.w, value, Output.e),
"{}[+]{} {}{}{}".format(self.g, self.e, self.w, value, self.e),
flush=True,
)

def error(self, value):
print(
"{}[-]{} {}{}{}".format(Output.r, Output.e, Output.w, value, Output.e),
"{}[-]{} {}{}{}".format(self.r, self.e, self.w, value, self.e),
flush=True,
)

def info(self, value):
print(
"{}[i]{} {}{}{}".format(Output.y, Output.e, Output.w, value, Output.e),
"{}[i]{} {}{}{}".format(self.y, self.e, self.w, value, self.e),
flush=True,
)

def debug(self, value):
if self.level == 1:
print(
"{}[d]{} {}{}{}".format(Output.c, Output.e, Output.w, value, Output.e),
"{}[d]{} {}{}{}".format(self.c, self.e, self.w, value, self.e),
flush=True,
)
2 changes: 1 addition & 1 deletion tests/lib/config/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def test_yaml_config_file():
if settings.plugins[0] != "test-plugin":
raise AssertionError
with pytest.raises(IndexError):
settings.plugins[1]
dir(settings.plugins[1])
1 change: 0 additions & 1 deletion tests/lib/modules/fingerprints/test_fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from lib.modules.fingerprints import FingerprintPlugin, Fingerprints
from lib.utils.container import Services
from lib.utils.output import Output
from lib.utils.datastore import Datastore
from lib.request.request import SingleRequest


Expand Down

0 comments on commit 0e60110

Please sign in to comment.