A magic number is a direct usage of a number in the code.
The term magic number also refers to the bad programming practice of using numbers directly in source code without explanation. In most cases, this makes programs harder to read, understand, and maintain. Although most guides make an exception for the numbers zero and one, it is a good idea to define all other numbers in code as named constants.
Why should it be avoided?
Imagine the case where you set the size of the password field in the GUI. If you use a magic number, whenever the max size changes, you have to change in two code locations. If I forget one, this will lead to inconsistencies.
This should be refactored to: