• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

llnl / dftracer-utils / 28496595030

01 Jul 2026 05:50AM UTC coverage: 50.727% (-1.6%) from 52.278%
28496595030

Pull #83

github

web-flow
Merge 8f1ff4df5 into 2efed6649
Pull Request #83: refactor and improve code QoL

31872 of 80367 branches covered (39.66%)

Branch coverage included in aggregate %.

770 of 1591 new or added lines in 85 files covered. (48.4%)

5070 existing lines in 182 files now uncovered.

32742 of 47009 relevant lines covered (69.65%)

9887.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.96
/src/dftracer/utils/utilities/common/json/parser.cpp
1
#include <dftracer/utils/utilities/common/json/parser.h>
2

3
namespace dftracer::utils::utilities::common::json {
4

5
JsonParser::JsonParser(std::size_t capacity) : parser_(capacity) {}
343✔
6

7
bool JsonParser::parse(std::string_view json_line) {
5,775✔
8
    padded_json_ = simdjson::padded_string(json_line);
5,775✔
9
    auto result = parser_.iterate(padded_json_);
5,775✔
10
    if (result.error()) {
5,775!
11
        valid_ = false;
×
12
        return false;
×
13
    }
14
    doc_ = std::move(result.value());
5,775✔
15
    active_ = simdjson::ondemand::document_reference(doc_);
5,775✔
16
    valid_ = true;
5,775✔
17
    return true;
5,775✔
18
}
5,775✔
19

20
bool JsonParser::parse_padded(simdjson::padded_string_view json) {
×
21
    auto result = parser_.iterate(json);
×
22
    if (result.error()) {
×
23
        valid_ = false;
×
24
        return false;
×
25
    }
26
    doc_ = std::move(result.value());
×
27
    active_ = simdjson::ondemand::document_reference(doc_);
×
28
    valid_ = true;
×
29
    return true;
×
UNCOV
30
}
×
31

32
void JsonParser::rewind() {
912✔
33
    if (valid_) {
912!
34
        active_.rewind();
912✔
35
    }
912✔
36
}
912✔
37

38
std::optional<std::int64_t> JsonParser::get_int64(std::string_view key) {
×
39
    if (!valid_) return std::nullopt;
×
40
    auto result = active_[key].get_int64();
×
41
    if (result.error()) return std::nullopt;
×
42
    return result.value();
×
UNCOV
43
}
×
44

45
std::optional<std::uint64_t> JsonParser::get_uint64(std::string_view key) {
424✔
46
    if (!valid_) return std::nullopt;
424!
47
    auto result = active_[key].get_uint64();
424✔
48
    if (result.error()) return std::nullopt;
424!
49
    return result.value();
424✔
50
}
424✔
51

52
std::optional<double> JsonParser::get_double(std::string_view key) {
×
53
    if (!valid_) return std::nullopt;
×
54
    auto result = active_[key].get_double();
×
55
    if (result.error()) return std::nullopt;
×
56
    return result.value();
×
UNCOV
57
}
×
58

59
std::optional<bool> JsonParser::get_bool(std::string_view key) {
×
60
    if (!valid_) return std::nullopt;
×
61
    auto result = active_[key].get_bool();
×
62
    if (result.error()) return std::nullopt;
×
63
    return result.value();
×
UNCOV
64
}
×
65

66
std::optional<std::string_view> JsonParser::get_string(std::string_view key) {
922✔
67
    if (!valid_) return std::nullopt;
922!
68
    auto result = active_[key].get_string();
922✔
69
    if (result.error()) return std::nullopt;
922✔
70
    return result.value();
920✔
71
}
922✔
72

73
}  // namespace dftracer::utils::utilities::common::json
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc