CA1837
CA1825
CA1829
CA1847
cSpell
This commit is contained in:
Mike Phares 2022-02-14 15:24:57 -07:00
parent 1b77400643
commit 817934a255
10 changed files with 41 additions and 19 deletions

22
Adaptation/.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,22 @@
{
"cSpell.words": [
"datauniqueid",
"Epuipment",
"EQPT",
"headerid",
"Idrv",
"ipdsf",
"Irng",
"ISMTP",
"JOBID",
"pdsf",
"pdsfc",
"PPID",
"Rcpe",
"RESIMAPCDE",
"Rsens",
"Smpl",
"Villach",
"Vrng"
]
}

View File

@ -94,7 +94,7 @@ public class FileRead : Shared.FileRead, IFileRead
DateTime dateTime = DateTime.Now;
results = GetExtractResult(reportFullPath, dateTime);
if (results.Item3 is null)
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, new Test[] { }, JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
if (results.Item3.Length > 0 && _IsEAFHosted)
WritePDSF(this, results.Item3);
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);

View File

@ -140,7 +140,7 @@ public class FileRead : Shared.FileRead, IFileRead
DateTime dateTime = DateTime.Now;
results = GetExtractResult(reportFullPath, dateTime);
if (results.Item3 is null)
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, new Test[] { }, JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
if (results.Item3.Length > 0 && _IsEAFHosted)
WritePDSF(this, results.Item3);
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);
@ -427,7 +427,7 @@ public class FileRead : Shared.FileRead, IFileRead
foreach (KeyValuePair<string, string> keyValuePair in _CellNames)
{
monARessource = keyValuePair.Key;
if (!keyValuePair.Value.Contains(@"\"))
if (!keyValuePair.Value.Contains('\\'))
continue;
foreach (string sourceFileFilter in _FileConnectorConfiguration.SourceFileFilter.Split('|'))
{

View File

@ -77,7 +77,7 @@ public class FileRead : Shared.FileRead, IFileRead
DateTime dateTime = DateTime.Now;
results = GetExtractResult(reportFullPath, dateTime);
if (results.Item3 is null)
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, new Test[] { }, JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
if (results.Item3.Length > 0 && _IsEAFHosted)
WritePDSF(this, results.Item3);
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);

View File

@ -185,7 +185,7 @@ public class ProcessData : IProcessData
DataReject = segments[6];
}
private Detail GetRData(string[] segments)
private static Detail GetRData(string[] segments)
{
Detail result = new();
if (segments.Length > 0 && float.TryParse(segments[0], out float r))

View File

@ -77,7 +77,7 @@ public class FileRead : Shared.FileRead, IFileRead
DateTime dateTime = DateTime.Now;
results = GetExtractResult(reportFullPath, dateTime);
if (results.Item3 is null)
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, new Test[] { }, JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(results.Item1, Array.Empty<Test>(), JsonSerializer.Deserialize<JsonElement[]>("[]"), results.Item4);
if (results.Item3.Length > 0 && _IsEAFHosted)
WritePDSF(this, results.Item3);
UpdateLastTicksDuration(DateTime.Now.Ticks - dateTime.Ticks);

View File

@ -175,7 +175,7 @@ public class ProcessData : IProcessData
return IsNullOrWhiteSpace((num > -1 ? _Data.Substring(_I, num - _I) : _Data.Substring(_I)));
}
private bool IsNullOrWhiteSpace(string text)
private static bool IsNullOrWhiteSpace(string text)
{
bool flag;
int num = 0;
@ -319,7 +319,7 @@ public class ProcessData : IProcessData
detail = new Detail() { Pt = GetToken() };
if (detail.Pt.Contains("Avg"))
break;
else if (!detail.Pt.Contains(":"))
else if (!detail.Pt.Contains(':'))
{
detail.R = GetToken();
detail.T = GetToken();
@ -359,7 +359,7 @@ public class ProcessData : IProcessData
_ = GetBefore(": ");
for (string i = GetToken(); !string.IsNullOrEmpty(i); i = GetToken())
{
if (!i.Contains(":"))
if (!i.Contains(':'))
{
detail = new Detail();
int num1 = num + 1;

View File

@ -16,7 +16,7 @@ public partial class WS
try
{
string json = JsonSerializer.Serialize(payload, payload.GetType());
if (string.IsNullOrEmpty(url) || !url.Contains(":") || !url.Contains("."))
if (string.IsNullOrEmpty(url) || !url.Contains(':') || !url.Contains('.'))
throw new Exception("Invalid URL");
using (HttpClient httpClient = new())
{

View File

@ -45,7 +45,7 @@ public class ProcessDataStandardFormat
foreach (JsonProperty jsonProperty in jsonElements[0].EnumerateObject())
{
columns += 1;
_ = stringBuilder.Append("\"").Append(jsonProperty.Name).Append("\"").Append('\t');
_ = stringBuilder.Append('"').Append(jsonProperty.Name).Append('"').Append('\t');
}
break;
}
@ -55,8 +55,8 @@ public class ProcessDataStandardFormat
{
_ = stringBuilder.Clear();
_ = stringBuilder.Append("0.1").Append('\t');
_ = stringBuilder.Append("1").Append('\t');
_ = stringBuilder.Append("2").Append('\t');
_ = stringBuilder.Append('1').Append('\t');
_ = stringBuilder.Append('2').Append('\t');
foreach (JsonProperty jsonProperty in jsonElements[i].EnumerateObject())
_ = stringBuilder.Append(jsonProperty.Value).Append('\t');
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
@ -97,7 +97,7 @@ public class ProcessDataStandardFormat
lines = File.ReadAllLines(reportFullPath);
string[] segments;
if (lines.Length < 7)
segments = new string[] { };
segments = Array.Empty<string>();
else
segments = lines[6].Trim().Split('\t');
List<string> columns = new();
@ -120,7 +120,7 @@ public class ProcessDataStandardFormat
}
}
bool lookForLogistics = false;
for (int r = 7; r < lines.Count(); r++)
for (int r = 7; r < lines.Length; r++)
{
if (lines[r].StartsWith("NUM_DATA_ROWS"))
lookForLogistics = true;
@ -131,7 +131,7 @@ public class ProcessDataStandardFormat
}
if (lines[r].StartsWith("LOGISTICS_1"))
{
for (int i = r; i < lines.Count(); i++)
for (int i = r; i < lines.Length; i++)
{
if (lines[r].StartsWith("END_HEADER"))
break;
@ -176,7 +176,7 @@ public class ProcessDataStandardFormat
if (string.IsNullOrEmpty(value))
_ = stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append("null,");
else if (value.All(char.IsDigit))
_ = stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append(",");
_ = stringBuilder.Append('"').Append(columns[c]).Append("\":").Append(value).Append(',');
else
_ = stringBuilder.Append('"').Append(columns[c]).Append("\":\"").Append(value).Append("\",");
}
@ -298,7 +298,7 @@ public class ProcessDataStandardFormat
for (int r = 0; r < count; r++)
{
_ = line.Clear();
_ = line.Append("!");
_ = line.Append('!');
foreach (KeyValuePair<string, List<string>> keyValuePair in keyValuePairs)
{
if (!names.Contains(keyValuePair.Key))

View File

@ -80,7 +80,7 @@ public class UnitTesting
AppendLine(" \"name\": \".NET Core Attach\",").
AppendLine(" \"type\": \"coreclr\",").
AppendLine(" \"request\": \"attach\",").
AppendLine($" \"processId\": {System.Diagnostics.Process.GetCurrentProcess().Id}").
AppendLine($" \"processId\": {Process.GetCurrentProcess().Id}").
AppendLine(" }").
AppendLine(" ]").
AppendLine("}");