< Summary - ReFlex - Library

Information
Class: PointCloud.Benchmark.Util.DataLoader
Assembly: ReFlex.PointCloud.Benchmark
File(s): D:\a\reflex\reflex\test\Library\Performance\PointCloud.Benchmark\Util\DataLoader.cs
Line coverage
100%
Covered lines: 34
Uncovered lines: 0
Coverable lines: 34
Total lines: 52
Line coverage: 100%
Branch coverage
100%
Covered branches: 8
Total branches: 8
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%
Load(...)100%88100%

File(s)

D:\a\reflex\reflex\test\Library\Performance\PointCloud.Benchmark\Util\DataLoader.cs

#LineLine coverage
 1using ReFlex.Core.Common.Components;
 2
 3namespace PointCloud.Benchmark.Util;
 4
 5public class DataLoader
 6{
 27    private static string[] FileNames = new[]
 28    {
 29        @"Resources/4.csv",
 210        @"Resources/5.csv"
 211    };
 12
 13    public static Tuple<int, int, Point3[]> Load(int index = 1)
 814    {
 815        var lines = File.ReadAllLines(FileNames[index]);
 816        var maxRow = 0;
 817        var maxCol = 0;
 18
 819        var points = new Point3[lines.Length - 1];
 20
 1677724821        for (var l = 0; l < lines.Length; l++)
 838861622        {
 838861623            if (l == 0)
 824                continue;
 838860825            var line = lines[l];
 838860826            var columns = line.Split(',');
 27
 838860828            var x = float.Parse(columns[0]);
 838860829            var y = float.Parse(columns[1]);
 838860830            var z = float.Parse(columns[2]);
 31
 838860832            var column = int.Parse(columns[3]);
 838860833            var row = int.Parse(columns[4]);
 838860834            var isValid = Equals(columns[5], "True");
 838860835            var isFiltered = Equals(columns[5], "False");
 36
 838860837            if (column > maxCol)
 818438                maxCol = column;
 39
 838860840            if (row > maxRow)
 818441                maxRow = row;
 42
 838860843            var p = new Point3(x, y, z);
 838860844            p.IsValid = isValid;
 838860845            p.IsFiltered = isFiltered;
 46
 838860847            points[l - 1] = p;
 838860848        }
 49
 850        return new Tuple<int, int, Point3[]>(maxCol + 1, maxRow +1, points);
 851    }
 52}

Methods/Properties

.cctor()
Load(System.Int32)