< 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{
 17    private static string[] FileNames = new[]
 18    {
 19        @"Resources/4.csv",
 110        @"Resources/5.csv"
 111    };
 12
 13    public static Tuple<int, int, Point3[]> Load(int index = 1)
 414    {
 415        var lines = File.ReadAllLines(FileNames[index]);
 416        var maxRow = 0;
 417        var maxCol = 0;
 18
 419        var points = new Point3[lines.Length - 1];
 20
 838862421        for (var l = 0; l < lines.Length; l++)
 419430822        {
 419430823            if (l == 0)
 424                continue;
 419430425            var line = lines[l];
 419430426            var columns = line.Split(',');
 27
 419430428            var x = float.Parse(columns[0]);
 419430429            var y = float.Parse(columns[1]);
 419430430            var z = float.Parse(columns[2]);
 31
 419430432            var column = int.Parse(columns[3]);
 419430433            var row = int.Parse(columns[4]);
 419430434            var isValid = Equals(columns[5], "True");
 419430435            var isFiltered = Equals(columns[5], "False");
 36
 419430437            if (column > maxCol)
 409238                maxCol = column;
 39
 419430440            if (row > maxRow)
 409241                maxRow = row;
 42
 419430443            var p = new Point3(x, y, z);
 419430444            p.IsValid = isValid;
 419430445            p.IsFiltered = isFiltered;
 46
 419430447            points[l - 1] = p;
 419430448        }
 49
 450        return new Tuple<int, int, Point3[]>(maxCol + 1, maxRow +1, points);
 451    }
 52}

Methods/Properties

.cctor()
Load(System.Int32)