If integer division is performed before multiplication, the intermediate result will be truncated causing a loss of precision.
In this case, if
total=2, then the problematic code results in
percent=0, while the correct code gives
If you want and expect truncation you can ignore this message.
ShellCheck doesn't warn when
c are identical expressions, e.g.
a/10*10, under the assumption that the intent is to rounded to the nearest 10 rather than the no-op of multiply by
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.