-
Notifications
You must be signed in to change notification settings - Fork 168
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
Fixed shareus.io/shrs.link #34
Conversation
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.
Hey @Diffusion123 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Docstrings: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
"initial": "true", | ||
"referrer": "https://shareus.io/", | ||
} | ||
DOMAIN = f"https://api.shrslink.xyz" |
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.
suggestion (code_refinement): Consider using a constant for the DOMAIN value.
Hardcoding URLs can lead to issues if the URL changes. It's better to define such URLs in a configuration file or as a constant at the top of the module.
DOMAIN = f"https://api.shrslink.xyz" | |
# At the top of the module | |
API_DOMAIN = "https://api.shrslink.xyz" | |
# In the relevant function or method | |
DOMAIN = API_DOMAIN |
if res: | ||
return res.json()['link_info']['destination'] | ||
else: | ||
raise DDLException("Link Extraction Failed") |
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.
suggestion (code_clarification): Consider adding specific error messages for different failure cases.
Using the same error message for different types of failures can make debugging more difficult. Providing more specific messages can help identify issues more quickly.
raise DDLException("Link Extraction Failed") | |
raise DDLException("Link Extraction Failed: No response or invalid format received") |
"initial": "true", | ||
"referrer": "https://shareus.io/", | ||
} | ||
DOMAIN = f"https://api.shrslink.xyz" |
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.
issue (code-quality): We've found these issues:
- Use named expression to simplify assignment and conditional [×2] (
use-named-expression
) - Replace f-string with no interpolated values with string (
remove-redundant-fstring
)
Fixed Shareus.io / shrs.link