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

Fix "similar-code" issue in piaplib/lint/clients_check_status.py #55

Closed
reactive-firewall opened this issue Mar 21, 2018 · 3 comments
Closed
Labels
Linter Linter related issues Style Anything to do with style rather than function

Comments

@reactive-firewall
Copy link
Owner

Similar blocks of code found in 3 locations. Consider refactoring.

https://codeclimate.com/github/reactive-firewall/PiAP-python-tools/piaplib/lint/clients_check_status.py#issue_5ab1cda9abcb0b0001000116

@reactive-firewall reactive-firewall added the Linter Linter related issues label Mar 21, 2018
@reactive-firewall
Copy link
Owner Author

❌ there is a bug in link after a new commit is made, issue can not be found, histories is missing, feature may not be of much use and only pose a security risk.

@reactive-firewall
Copy link
Owner Author

@reactive-firewall
Copy link
Owner Author

if ip_list_txt is not None and len(ip_list_txt) > 0:
theResult = html_generator.gen_html_td(
html_generator.gen_html_ul(ip_list_txt),
str(u'client_status_ips_{}')
).format(client)

if mac_list_txt is not None and len(mac_list_txt) > 0:
theResult = html_generator.gen_html_td(
str(mac_list_txt[0]),
str(u'client_status_macs_{}')
).format(client)
else:
theResult = html_generator.gen_html_td(
html_generator.gen_html_label(u'No IP', html_generator.HTML_LABEL_ROLES[3]),
str(u'client_status_macs_{}').format(client)

if ip_list_txt is not None and len(ip_list_txt) > 0:
theResult = html_generator.gen_html_td(
html_generator.gen_html_ul(ip_list_txt),
str(u'iface_status_ips_{}').format(iface)
)
else:
theResult = html_generator.gen_html_td(
html_generator.gen_html_label(u'No IP', html_generator.HTML_LABEL_ROLES[3]),
str(u'iface_status_ips_{}').format(iface)

@reactive-firewall reactive-firewall added the Style Anything to do with style rather than function label Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linter Linter related issues Style Anything to do with style rather than function
Projects
None yet
Development

No branches or pull requests

1 participant