MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / ComputeFileCoverage

Function ComputeFileCoverage

CppCoverage/CoverageRateComputer.cpp:30–44  ·  view source on GitHub ↗

---------------------------------------------------------------------

Source from the content-addressed store, hash-verified

28 {
29 //---------------------------------------------------------------------
30 CoverageRate ComputeFileCoverage(const Plugin::FileCoverage& file)
31 {
32 int executedLines = 0;
33 int unexecutedLines = 0;
34
35 for (const auto& lineCoverage : file.GetLines())
36 {
37 if (lineCoverage.HasBeenExecuted())
38 ++executedLines;
39 else
40 ++unexecutedLines;
41 }
42
43 return CoverageRate{executedLines, unexecutedLines};
44 }
45
46 //---------------------------------------------------------------------
47 template<typename Object>

Callers 1

Calls 2

HasBeenExecutedMethod · 0.80
GetLinesMethod · 0.45

Tested by

no test coverage detected