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

Small warning in the continuous integration (Use of uninitialized value & Redundant argument) #3123

Open
Tracked by #5512
teolemon opened this issue Mar 27, 2020 · 3 comments
Labels
CI Continuous integration 👩‍💻 DevOps Outreachy Good tasks for Outreachy applicants. See #productopener on our Slack https://slack.openfoodfacts.org ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.

Comments

@teolemon
Copy link
Member

teolemon commented Mar 27, 2020

Small warning in the continuous integration

[Thu Mar 26 19:10:42 2020] Food.pm: Use of uninitialized value in sprintf at lib/ProductOpener/Food.pm line 5046.
[Thu Mar 26 19:10:42 2020] Food.pm: Redundant argument in sprintf at lib/ProductOpener/Food.pm line 5046.

Part of

@teolemon teolemon added 🐛 bug This is a bug, not a feature request. CI Continuous integration labels Mar 27, 2020
@stephanegigandet stephanegigandet added the Outreachy Good tasks for Outreachy applicants. See #productopener on our Slack https://slack.openfoodfacts.org label Mar 27, 2020
@github-actions
Copy link
Contributor

Stale issue message

Copy link
Contributor

github-actions bot commented Mar 4, 2024

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Mar 4, 2024
@teolemon teolemon moved this to To discuss and validate in 🍊 Open Food Facts Server issues Apr 23, 2024
@teolemon teolemon removed the 🐛 bug This is a bug, not a feature request. label Oct 18, 2024
@benbenben2
Copy link
Collaborator

This is old. This was in this version of the code
https://github.com/openfoodfacts/openfoodfacts-server/blob/eba527826074a6a0bcf105cfee138fb488378c47/lib/ProductOpener/Food.pm

foreach my $nutrient_level_ref (@nutrient_levels) {
	my ($nid, $low, $high) = @$nutrient_level_ref;
	foreach my $level ('low', 'moderate', 'high') {
		$nutrient_levels_taxonomy .= "\n" . 'en:' . sprintf($Lang{nutrient_in_quantity}{en}, $Nutriments{$nid}{en}, $Lang{$level . "_quantity"}{en}) . "\n";
		foreach my $l (sort keys %Langs) {
			next if $l eq 'en';
			my $nutrient_l;
			if (defined $Nutriments{$nid}{$l}) {
				$nutrient_l = $Nutriments{$nid}{$l};
			}
			else {
				$nutrient_l = $Nutriments{$nid}{"en"};
			}
			$nutrient_levels_taxonomy .= $l . ':' . sprintf($Lang{nutrient_in_quantity}{$l}, $nutrient_l, $Lang{$level . "_quantity"}{$l}) . "\n";
		}
	}
}

Today it looks like this
line 2523

	foreach my $nutrient_level_ref (@nutrient_levels) {
		my ($nid, $low, $high) = @{$nutrient_level_ref};
		foreach my $level ('low', 'moderate', 'high') {
			$nutrient_levels_taxonomy
				.= "\n"
				. 'en:'
				. sprintf(
				$Lang{nutrient_in_quantity}{en},
				display_taxonomy_tag("en", "nutrients", "zz:$nid"),
				$Lang{$level . "_quantity"}{en}
				) . "\n";
			foreach my $l (sort keys %Langs) {
				next if $l eq 'en';
				$nutrient_levels_taxonomy
					.= $l . ':'
					. sprintf(
					$Lang{nutrient_in_quantity}{$l},
					display_taxonomy_tag($l, "nutrients", "zz:$nid"),
					$Lang{$level . "_quantity"}{$l}
					) . "\n";
			}
		}
	}

It is called by scripts/taxonomies/generators/gen_nutrient_levels_taxonomy.pl
Not sure when this is file called. Can you check @teolemon if this warning still appears?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration 👩‍💻 DevOps Outreachy Good tasks for Outreachy applicants. See #productopener on our Slack https://slack.openfoodfacts.org ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.
Projects
Status: To discuss and validate
Development

No branches or pull requests

3 participants