FlagDuplicates

CA1510
Complete
This commit is contained in:
2024-11-18 14:25:30 -07:00
parent dcaaba3614
commit 8ae8386b30
10 changed files with 51 additions and 83 deletions

View File

@ -8,21 +8,6 @@ namespace Adaptation.FileHandlers.pcl;
#nullable enable
internal class Point
// internal record Point([property: JsonPropertyName("Site")] string Site,
// [property: JsonPropertyName("X")] string X,
// [property: JsonPropertyName("Y")] string Y,
// [property: JsonPropertyName("Navg")] string NAvg,
// [property: JsonPropertyName("Rhoavg")] string RhoAvg,
// [property: JsonPropertyName("Nsl")] string Nsl,
// [property: JsonPropertyName("Rhosl")] string Rhosl,
// [property: JsonPropertyName("Vd")] string Vd,
// [property: JsonPropertyName("Phase")] string Phase,
// [property: JsonPropertyName("Flat Z")] string FlatZ,
// [property: JsonPropertyName("Grade")] string Grade,
// [property: JsonPropertyName("X Left")] string XLeft,
// [property: JsonPropertyName("X Right")] string XRight,
// [property: JsonPropertyName("Bottom Y")] string BottomY,
// [property: JsonPropertyName("Top Y")] string TopY)
{
public Point(string site, string x, string y, string nAvg, string rhoAvg, string nsl, string rhosl, string vd, string phase, string flatZ, string grade, string xLeft, string xRight, string bottomY, string topY)
@ -77,7 +62,7 @@ internal class Point
string.Empty,
string.Empty);
public static ReadOnlyCollection<Point> GetCollection(ReadOnlyCollection<string> lines, int take, string site, string multiple, string summaryLine, string lastUnitsB)
public static ReadOnlyCollection<Point> GetCollection(Constant constant, ReadOnlyCollection<string> lines)
{
List<Point> results = new();
string s;
@ -92,22 +77,22 @@ internal class Point
for (int i = 0; i < lines.Count; i++)
{
line = lines[i];
segmentsC = line.Split(new string[] { site }, StringSplitOptions.RemoveEmptyEntries);
segmentsC = line.Split(new string[] { constant.Site }, StringSplitOptions.RemoveEmptyEntries);
if (segmentsC.Length > 1)
{
foreach (string segment in segmentsC)
sites.Add(segment.Trim());
}
if (line == summaryLine)
if (line == constant.SummaryLine)
{
sites.RemoveAt(0);
found = true;
}
if (!found)
continue;
if (!foundB && line.Contains(multiple))
if (!foundB && line.Contains(constant.Multiple))
foundB = true;
if (line != lastUnitsB)
if (line != constant.LastUnitsB)
continue;
if (foundB)
{
@ -117,7 +102,7 @@ internal class Point
for (int j = 0; j < sites.Count; j++)
{
s = sites[j];
if (i + take > lines.Count)
if (i + constant.Take > lines.Count)
break;
segments = s.Split(new string[] { "(", ",", ")" }, StringSplitOptions.None);
if (segments.Length < 2)
@ -141,7 +126,7 @@ internal class Point
bottomY: lines[i + 11].Trim(),
topY: lines[i + 12].Trim());
results.Add(point);
i += take;
i += constant.Take;
}
sites.Clear();
}