-
Notifications
You must be signed in to change notification settings - Fork 122
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
Sourcery refactored main branch #1
base: main
Are you sure you want to change the base?
Conversation
Authentication to CNP for DevOps failed. Click here to try again: https://portal.cwp.radwarecloud.com/github-plugin.html?installation_id=26169338&setup_action=install |
Hey! Changelogs info seems to be missing or might be in incorrect format. |
sys.exit(c.RED + "[!] Interrupt handler received, exiting..." + c.END) | ||
sys.exit(f"{c.RED}[!] Interrupt handler received, exiting...{c.END}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function ctrl_c
refactored with the following changes:
- Use f-string instead of string concatenation [×2] (
use-fstring-for-concatenation
)
print(c.YELLOW + ' _____ ') | ||
print(f'{c.YELLOW} _____ ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function banner
refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation
)
print(c.YELLOW + "[*] Found NS: {}".format(server) + c.END) | ||
print(c.YELLOW + f"[*] Found NS: {server}" + c.END) | ||
ip_answer = dns.resolver.resolve(server.target, 'A') | ||
for ip in ip_answer: | ||
print(c.YELLOW + "[*] IP for {} is {}".format(server, ip) + c.END) | ||
print(c.YELLOW + f"[*] IP for {server} is {ip}" + c.END) | ||
try: | ||
zone = dns.zone.from_xfr(dns.query.xfr(str(ip), domain)) | ||
for host in zone: | ||
print(c.YELLOW + "[" + c.END + c.GREEN + "+" + c.END + c.YELLOW + "] Found Host: {}".format(host) + c.END) | ||
print( | ||
f"{c.YELLOW}[{c.END}{c.GREEN}+{c.END}{c.YELLOW}" | ||
+ f"] Found Host: {host}" | ||
+ c.END | ||
) | ||
|
||
except Exception as e: | ||
print(c.YELLOW + "[" + c.END + c.RED + "-" + c.END + c.YELLOW + "] NS {} refused zone transfer!".format(server) + c.END) | ||
print( | ||
f"{c.YELLOW}[{c.END}{c.RED}-{c.END}{c.YELLOW}" | ||
+ f"] NS {server} refused zone transfer!" | ||
+ c.END | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function axfr
refactored with the following changes:
- Replace call to format with f-string [×4] (
use-fstring-for-formatting
) - Use f-string instead of string concatenation [×12] (
use-fstring-for-concatenation
)
r = requests.get("https://crt.sh/?q=" + domain + "&output=json", timeout=20) | ||
r = requests.get(f"https://crt.sh/?q={domain}&output=json", timeout=20) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function SDom
refactored with the following changes:
- Use f-string instead of string concatenation [×7] (
use-fstring-for-concatenation
)
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.11%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Help us improve this quality report! |
Branch
main
refactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
main
branch, then run:Help us improve this pull request!