Account ID Points:
The account ID is obtained from accountDetails['Account_id'].
If the account ID is between 1 and 16,000 (inclusive), 10 points are added to the rank.
If the account ID is between 16,001 and 25,000 (inclusive), 7 points are added to the rank.
If the account ID is between 25,001 and 100,000 (inclusive), 5 points are added to the rank.
If the account ID is between 100,001 and 10,000,000 (inclusive), 1 point is added to the rank.
Username Points:
The username is obtained from accountDetails.Username.
If the username contains at least one alphabetic character (a-zA-Z), 15 points are added to the rank. This indicates an alphabetic username.
If the username consists only of numeric characters, 15 points are added to the rank. This indicates a numeric username.
Additional Points based on Username Length:
Points are added or subtracted based on the length of the username. The formula (6 - usernameLength) * 10 is used, where usernameLength represents the length of the username. For example, if the username is 3 characters long, 30 points will be added to the rank ((6 - 3) * 10 = 30).
The rank text and points are determined as follows:
If the rank is 50 or higher, the rank text is "Legendary" with 50 points.
If the rank is between 40 and 49 (inclusive), the rank text is "Epic" with 40 points.
If the rank is between 30 and 39 (inclusive), the rank text is "Rare" with 30 points.
If the rank is between 25 and 29 (inclusive), the rank text is "Uncommon" with 25 points.
If the rank is between 15 and 24 (inclusive), the rank text is "Common" with 15 points.
If the rank is less than 15, the rank text is "Basic" with 10 points.
The associated rank color is determined as follows:
"Legendary" rank is represented by the color red.
"Epic" rank is represented by the color purple.
"Rare" rank is represented by the color blue.
"Uncommon" rank is represented by the color green.
"Common" rank is represented by the color orange.
"Basic" rank is represented by the color gray.