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

Document the ProductOpener::GeoIP.pm module #5091

Merged
merged 3 commits into from
Apr 2, 2021

Conversation

roshnaeem
Copy link
Contributor

Description: Updated the GeoIP.pm file to add its documentation in perlpod format.

Fixes: #5089

Related Issue: #2203

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!


=head2 get_country_code_for_ip()

C<get_country_code_for_ip()> takes the IP address as input paramter and returns the country iso code where IP address is located.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
C<get_country_code_for_ip()> takes the IP address as input paramter and returns the country iso code where IP address is located.
C<get_country_code_for_ip()> takes the IP address as input parameter and returns the country iso code where IP address is located.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for pointing this out!!
I have incorporated changes, Please check!!


=head3 Return values

If the function executes successfully it returns the iso code for the country where the IP address is located.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If the function executes successfully it returns the iso code for the country where the IP address is located.
If the function executes successfully it returns the two-character ISO 3166-1 (http://en.wikipedia.org/wiki/ISO_3166-1) alpha code for the country where the IP address is located (eg. "AF" for Afghanistan). ```

@sonarcloud
Copy link

sonarcloud bot commented Apr 2, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information


=head3 Return values

If the function executes successfully it returns the country name. On the other hand, if it throws an exception, it simply returns undefined.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to specify what is the reference for the "country name". I think it's the english version of Geonames.org names but not the ISO 3166-1 -- https://en.wikipedia.org/wiki/ISO_3166-1. The "United Kingdom" for example, seems to be named "United Kingdom of Great Britain and Northern Ireland" in ISO 3166-1. @stephanegigandet could you tell us?

@stephanegigandet stephanegigandet merged commit 382c79c into openfoodfacts:master Apr 2, 2021
@roshnaeem roshnaeem deleted the pod2 branch April 2, 2021 16:28
@teolemon teolemon added the 📚 Documentation Documentation issues improve the project for everyone. label Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 Documentation Documentation issues improve the project for everyone.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document the ProductOpener::GeoIP.pm module in perlpod format
4 participants