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

ArkScript-lang / Ark / 20377988123

19 Dec 2025 05:45PM UTC coverage: 92.242% (+1.6%) from 90.661%
20377988123

push

github

SuperFola
chore: addressing cppcheck recommandations

1 of 1 new or added line in 1 file covered. (100.0%)

137 existing lines in 6 files now uncovered.

8430 of 9139 relevant lines covered (92.24%)

245122.08 hits per line

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

98.31
/src/arkreactor/Compiler/IntermediateRepresentation/Entity.cpp
1
#include <Ark/Compiler/IntermediateRepresentation/Entity.hpp>
2

3
namespace Ark::internal::IR
4
{
5
    Entity::Entity(const Kind kind) :
30,680✔
6
        m_kind(kind),
30,680✔
7
        m_inst(NOP)
30,680✔
8
    {}
61,360✔
9

10
    Entity::Entity(const Instruction inst, const uint16_t arg) :
104,487✔
11
        m_kind(Kind::Opcode),
104,487✔
12
        m_inst(inst), m_primary_arg(arg)
104,487✔
13
    {}
208,974✔
14

15
    Entity::Entity(const Instruction inst, const uint16_t primary_arg, const uint16_t secondary_arg) :
21,382✔
16
        m_kind(Kind::Opcode2Args),
21,382✔
17
        m_inst(inst), m_primary_arg(primary_arg), m_secondary_arg(secondary_arg)
21,382✔
18
    {}
42,764✔
19

20
    Entity::Entity(const Instruction inst, const uint8_t inst2, const uint8_t inst3, const uint8_t inst4) :
366✔
21
        m_kind(Kind::Opcode3Args),
366✔
22
        m_inst(inst), m_primary_arg(inst2), m_secondary_arg(inst3), m_tertiary_arg(inst4)
366✔
23
    {}
732✔
24

25
    Entity Entity::Label(const label_t value)
14,678✔
26
    {
14,678✔
27
        auto entity = Entity(Kind::Label);
14,678✔
28
        entity.m_label = value;
14,678✔
29

30
        return entity;
14,678✔
31
    }
14,678✔
32

33
    Entity Entity::Goto(const Entity& label, const Instruction inst)
14,678✔
34
    {
14,678✔
35
        auto jump = Entity(Kind::Goto);
14,678✔
36
        jump.m_label = label.m_label;
14,678✔
37
        jump.m_inst = inst;
14,678✔
38

39
        return jump;
14,678✔
40
    }
14,678✔
41

42
    Entity Entity::GotoWithArg(const Entity& label, const Instruction inst, const uint16_t primary_arg)
1,324✔
43
    {
1,324✔
44
        auto jump = Entity(Kind::GotoWithArg);
1,324✔
45
        jump.m_label = label.m_label;
1,324✔
46
        jump.m_inst = inst;
1,324✔
47
        jump.m_primary_arg = primary_arg;
1,324✔
48

49
        return jump;
1,324✔
50
    }
1,324✔
51

52
    Entity Entity::GotoIf(const Entity& label, const bool cond)
3,578✔
53
    {
3,578✔
54
        return Goto(label, cond ? POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE);
3,578✔
55
    }
56

57
    Word Entity::bytecode() const
73,394✔
58
    {
73,394✔
59
        if (m_kind == Kind::Opcode)
73,394✔
60
            return Word(m_inst, m_primary_arg);
51,646✔
61
        if (m_kind == Kind::Opcode2Args)
21,748✔
62
            return Word(m_inst, m_primary_arg, m_secondary_arg);
21,382✔
63
        if (m_kind == Kind::Opcode3Args)
366✔
64
            return Word(
366✔
65
                m_inst,
366✔
66
                static_cast<uint8_t>(m_primary_arg),
366✔
67
                static_cast<uint8_t>(m_secondary_arg),
366✔
68
                static_cast<uint8_t>(m_tertiary_arg));
366✔
UNCOV
69
        return Word(0, 0);
×
70
    }
73,394✔
71

72
    void Entity::setSourceLocation(const std::string& filename, std::size_t line)
105,411✔
73
    {
105,411✔
74
        m_source_file = filename;
105,411✔
75
        m_source_line = line;
105,411✔
76
    }
105,411✔
77
}
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