Skip to content

Commit 6213388

Browse files
committed
Enable SA1400: always use access modifiers.
1 parent 249c63f commit 6213388

File tree

62 files changed

+285
-288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+285
-288
lines changed

.editorconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ dotnet_diagnostic.SA1303.severity = none # Const fields should begin with upper-
8383
dotnet_diagnostic.SA1308.severity = none # Variable names should not be prefixed.
8484
dotnet_diagnostic.SA1310.severity = none # Field name should not contain an underscore.
8585
dotnet_diagnostic.SA1311.severity = none # Static readonly fields should begin with upper-case letter.
86-
dotnet_diagnostic.SA1400.severity = silent # Access modifier should be declared.
8786
dotnet_diagnostic.SA1407.severity = none # Arithmetic expressions must declare precedence.
8887
dotnet_diagnostic.SA1408.severity = none # Conditional expressions should declare precedence.
8988
dotnet_diagnostic.SA1500.severity = none # Braces for multi-line statements should not share line.

src/MySqlConnector.Authentication.Ed25519/Chaos.NaCl/Internal/Ed25519Ref10/ge_scalarmult_base.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Chaos.NaCl.Internal.Ed25519Ref10;
44

55
internal static partial class GroupOperations
66
{
7-
static byte equal(byte b, byte c)
7+
private static byte equal(byte b, byte c)
88
{
99

1010
byte ub = b;
@@ -16,21 +16,21 @@ static byte equal(byte b, byte c)
1616
return (byte)y;
1717
}
1818

19-
static byte negative(sbyte b)
19+
private static byte negative(sbyte b)
2020
{
2121
ulong x = unchecked((ulong)(long)b); /* 18446744073709551361..18446744073709551615: yes; 0..255: no */
2222
x >>= 63; /* 1: yes; 0: no */
2323
return (byte)x;
2424
}
2525

26-
static void cmov(ref GroupElementPreComp t, ref GroupElementPreComp u, byte b)
26+
private static void cmov(ref GroupElementPreComp t, ref GroupElementPreComp u, byte b)
2727
{
2828
FieldOperations.fe_cmov(ref t.yplusx, ref u.yplusx, b);
2929
FieldOperations.fe_cmov(ref t.yminusx, ref u.yminusx, b);
3030
FieldOperations.fe_cmov(ref t.xy2d, ref u.xy2d, b);
3131
}
3232

33-
static void select(out GroupElementPreComp t, int pos, sbyte b)
33+
private static void select(out GroupElementPreComp t, int pos, sbyte b)
3434
{
3535
GroupElementPreComp minust;
3636
byte bnegative = negative(b);

src/MySqlConnector.Authentication.Ed25519/Chaos.NaCl/Internal/Ed25519Ref10/sc_mul_add.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Chaos.NaCl.Internal.Ed25519Ref10;
44

55
internal static partial class ScalarOperations
66
{
7-
static Int64 load_3(byte[] input, int offset)
7+
private static Int64 load_3(byte[] input, int offset)
88
{
99
Int64 result;
1010
result = (Int64)input[offset + 0];
@@ -13,7 +13,7 @@ static Int64 load_3(byte[] input, int offset)
1313
return result;
1414
}
1515

16-
static Int64 load_4(byte[] input, int offset)
16+
private static Int64 load_4(byte[] input, int offset)
1717
{
1818
Int64 result;
1919
result = (Int64)input[offset + 0];

src/MySqlConnector.Authentication.Ed25519/Ed25519AuthenticationPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,5 @@ private Ed25519AuthenticationPlugin()
161161
{
162162
}
163163

164-
static bool s_isInstalled;
164+
private static bool s_isInstalled;
165165
}

src/MySqlConnector.Logging.Microsoft.Extensions.Logging/MicrosoftExtensionsLoggingLoggerProvider.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ public void Log(MySqlConnectorLogLevel level, string message, object?[]? args =
6161
_ => throw new ArgumentOutOfRangeException(nameof(level), level, "Invalid value for 'level'."),
6262
};
6363

64-
static readonly Func<string, Exception, string> s_getMessage = static (s, e) => s;
65-
static readonly Func<(string Message, object?[] Args), Exception, string> s_messageFormatter = static (s, e) => string.Format(CultureInfo.InvariantCulture, s.Message, s.Args);
64+
private static readonly Func<string, Exception, string> s_getMessage = static (s, e) => s;
65+
private static readonly Func<(string Message, object?[] Args), Exception, string> s_messageFormatter = static (s, e) => string.Format(CultureInfo.InvariantCulture, s.Message, s.Args);
6666

67-
readonly ILogger m_logger;
67+
private readonly ILogger m_logger;
6868
}
6969

70-
readonly ILoggerFactory m_loggerFactory;
71-
readonly string m_prefix;
70+
private readonly ILoggerFactory m_loggerFactory;
71+
private readonly string m_prefix;
7272
}

src/MySqlConnector.Logging.NLog/NLogLoggerProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public sealed class NLogLoggerProvider : IMySqlConnectorLoggerProvider
88
{
99
public IMySqlConnectorLogger CreateLogger(string name) => new NLogLogger(LogManager.GetLogger("MySqlConnector." + name));
1010

11-
static readonly Type s_loggerType = typeof(NLogLogger);
11+
private static readonly Type s_loggerType = typeof(NLogLogger);
1212

1313
private sealed class NLogLogger : IMySqlConnectorLogger
1414
{
@@ -36,6 +36,6 @@ public void Log(MySqlConnectorLogLevel level, string message, object?[]? args =
3636
_ => throw new ArgumentOutOfRangeException(nameof(level), level, "Invalid value for 'level'."),
3737
};
3838

39-
readonly Logger m_logger;
39+
private readonly Logger m_logger;
4040
}
4141
}

src/MySqlConnector.Logging.Serilog/SerilogLoggerProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public void Log(MySqlConnectorLogLevel level, string message, object?[]? args =
4444
_ => throw new ArgumentOutOfRangeException(nameof(level), level, "Invalid value for 'level'."),
4545
};
4646

47-
static readonly Regex tokenReplacer = new(@"((\w+)?\s?(?:=|:)?\s?'?)\{(?:\d+)(\:\w+)?\}('?)", RegexOptions.Compiled);
47+
private static readonly Regex tokenReplacer = new(@"((\w+)?\s?(?:=|:)?\s?'?)\{(?:\d+)(\:\w+)?\}('?)", RegexOptions.Compiled);
4848

49-
readonly ILogger m_logger;
49+
private readonly ILogger m_logger;
5050
}
5151
}

src/MySqlConnector.Logging.log4net/Log4netLoggerProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public sealed class Log4netLoggerProvider : IMySqlConnectorLoggerProvider
1010
{
1111
public IMySqlConnectorLogger CreateLogger(string name) => new Log4netLogger(LogManager.GetLogger(s_loggerAssembly, "MySqlConnector." + name));
1212

13-
static readonly Assembly s_loggerAssembly = typeof(Log4netLogger).GetTypeInfo().Assembly;
14-
static readonly Type s_loggerType = typeof(Log4netLogger);
13+
private static readonly Assembly s_loggerAssembly = typeof(Log4netLogger).GetTypeInfo().Assembly;
14+
private static readonly Type s_loggerType = typeof(Log4netLogger);
1515

1616
private sealed class Log4netLogger : IMySqlConnectorLogger
1717
{
@@ -38,6 +38,6 @@ public void Log(MySqlConnectorLogLevel level, string message, object?[]? args =
3838
_ => throw new ArgumentOutOfRangeException(nameof(level), level, "Invalid value for 'level'."),
3939
};
4040

41-
readonly ILogger m_logger;
41+
private readonly ILogger m_logger;
4242
}
4343
}

src/MySqlConnector/Authentication/AuthenticationPlugins.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ internal static bool TryGetPlugin(string name, [NotNullWhen(true)] out IAuthenti
2828
return s_plugins.TryGetValue(name, out plugin);
2929
}
3030

31-
static readonly object s_lock = new();
32-
static readonly Dictionary<string, IAuthenticationPlugin> s_plugins = new();
31+
private static readonly object s_lock = new();
32+
private static readonly Dictionary<string, IAuthenticationPlugin> s_plugins = new();
3333
}

src/MySqlConnector/Core/CachedProcedure.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ private static CachedParameter CreateCachedParameter(int ordinal, string? direct
230230
}
231231
}
232232

233-
string FullyQualified => $"`{m_schema}`.`{m_component}`";
233+
private string FullyQualified => $"`{m_schema}`.`{m_component}`";
234234

235-
static readonly IMySqlConnectorLogger Log = MySqlConnectorLogManager.CreateLogger(nameof(CachedProcedure));
236-
static readonly IReadOnlyDictionary<string, string> s_typeMapping = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
235+
private static readonly IMySqlConnectorLogger Log = MySqlConnectorLogManager.CreateLogger(nameof(CachedProcedure));
236+
private static readonly IReadOnlyDictionary<string, string> s_typeMapping = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
237237
{
238238
{ "BOOL", "TINYINT" },
239239
{ "BOOLEAN", "TINYINT" },
@@ -251,16 +251,16 @@ private static CachedParameter CreateCachedParameter(int ordinal, string? direct
251251
{ "CHAR BYTE", "BINARY" },
252252
};
253253

254-
static readonly Regex s_cStyleComments = new(@"/\*.*?\*/", RegexOptions.Singleline);
255-
static readonly Regex s_singleLineComments = new(@"(^|\s)--.*?$", RegexOptions.Multiline);
256-
static readonly Regex s_multipleSpaces = new(@"\s+");
257-
static readonly Regex s_numericTypes = new(@"(DECIMAL|DEC|FIXED|NUMERIC|FLOAT|DOUBLE PRECISION|DOUBLE|REAL)\s*\([0-9]+(,\s*[0-9]+)\)", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
258-
static readonly Regex s_enum = new(@"ENUM\s*\([^)]+\)", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
259-
static readonly Regex s_parameterName = new(@"^(?:`((?:[\u0001-\u005F\u0061-\uFFFF]+|``)+)`|([A-Za-z0-9$_\u0080-\uFFFF]+)) (.*)$");
260-
static readonly Regex s_characterSet = new(" (CHARSET|CHARACTER SET) [A-Za-z0-9_]+", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
261-
static readonly Regex s_collate = new(" (COLLATE) [A-Za-z0-9_]+", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
262-
static readonly Regex s_length = new(@"\s*\(\s*([0-9]+)\s*(?:,\s*[0-9]+\s*)?\)");
263-
264-
readonly string m_schema;
265-
readonly string m_component;
254+
private static readonly Regex s_cStyleComments = new(@"/\*.*?\*/", RegexOptions.Singleline);
255+
private static readonly Regex s_singleLineComments = new(@"(^|\s)--.*?$", RegexOptions.Multiline);
256+
private static readonly Regex s_multipleSpaces = new(@"\s+");
257+
private static readonly Regex s_numericTypes = new(@"(DECIMAL|DEC|FIXED|NUMERIC|FLOAT|DOUBLE PRECISION|DOUBLE|REAL)\s*\([0-9]+(,\s*[0-9]+)\)", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
258+
private static readonly Regex s_enum = new(@"ENUM\s*\([^)]+\)", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
259+
private static readonly Regex s_parameterName = new(@"^(?:`((?:[\u0001-\u005F\u0061-\uFFFF]+|``)+)`|([A-Za-z0-9$_\u0080-\uFFFF]+)) (.*)$");
260+
private static readonly Regex s_characterSet = new(" (CHARSET|CHARACTER SET) [A-Za-z0-9_]+", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
261+
private static readonly Regex s_collate = new(" (COLLATE) [A-Za-z0-9_]+", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
262+
private static readonly Regex s_length = new(@"\s*\(\s*([0-9]+)\s*(?:,\s*[0-9]+\s*)?\)");
263+
264+
private readonly string m_schema;
265+
private readonly string m_component;
266266
}

0 commit comments

Comments
 (0)