Essentially lint checkers like
nag can only check what they know, they are not a full specification of the language.
In this case it doesn't know that, by design, any declaration form can be used as an environment, so while just using
\footnotesize is probably better and certainly more common, the environment form is also correct.
For font size commands it is usually best just to use the command without any grouping and rely on an outer environment
here the close environment takes care of ending the paragraph in the scope of the size change.
If you go
Then the size change ends before the paragraph so it is small text in a normal baseline, OK for a word but looks bad if there are any line breaks. You can use
But it is easy to forget and the environment form
makes it perhaps even more likely to forget the blank line.
However it is still correct and if you know the paragraph ending isn't an issue, it can be useful,
.... thousand pages
Can make the source code easier to read than just having a trailing
} after the table, thousands of lines of source file later than the matching