A common problem in code reviews is whether a numeric value should be hardcoded in the code or not. Does anyone know of a good regex that can catch magic numbers in code, for example:
int overDue = 30; Money fee = new Money(5.25D);
without also receiving tons of false positives, for example, for a loop initialization code?
for (int i = 0; i < array.length; i++) { }
java c # regex code-review
Brian Dec 03 '08 at 15:07 2008-12-03 15:07
source share