Adds style cop (#109)

This commit is contained in:
Kamron Batman 2020-04-26 00:16:02 -07:00 committed by GitHub
parent 3e715bcb60
commit 556a17aba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1725 changed files with 33831 additions and 38046 deletions

View file

@ -19,10 +19,9 @@ namespace Server.Misc
* If you do not see the above chars, please
* enable showing of unicode control chars
**/
public class LanguageStatistics
{
private static InternationalCode[] InternationalCodes =
private static readonly InternationalCode[] InternationalCodes =
{
new InternationalCode("ARA", "Arabic", "Saudi Arabia", "العربية", "السعودية"),
new InternationalCode("ARI", "Arabic", "Iraq", "العربية", "العراق"),
@ -161,9 +160,9 @@ namespace Server.Misc
new InternationalCode("KOK", "Konkani", "India", "कोंकणी", "भारत")
};
private static bool DefaultLocalNames = false;
private static bool ShowAlternatives = true;
private static bool CountAccounts = true; // will consider only first character's valid language
private static readonly bool DefaultLocalNames = false;
private static readonly bool ShowAlternatives = true;
private static readonly bool CountAccounts = true; // will consider only first character's valid language
private static string GetFormattedInfo(string code)
{
@ -244,17 +243,17 @@ namespace Server.Misc
private struct InternationalCode
{
private bool m_HasLocalInfo;
private readonly bool m_HasLocalInfo;
public string Code{ get; }
public string Code { get; }
public string Language{ get; }
public string Language { get; }
public string Country{ get; }
public string Country { get; }
public string Language_LocalName{ get; }
public string Language_LocalName { get; }
public string Country_LocalName{ get; }
public string Country_LocalName { get; }
public InternationalCode(string code, string language, string country) : this(code, language, country, null,
null) =>
@ -301,9 +300,9 @@ namespace Server.Misc
Count = 1;
}
public string Code{ get; }
public string Code { get; }
public int Count{ get; private set; }
public int Count { get; private set; }
public void Increase()
{
@ -325,7 +324,6 @@ namespace Server.Misc
b = y.Code;
cb = y.Count;
if (ca > cb)
return -1;