Skip to content

Conversation

SuperFola
Copy link
Member

Description

Enhance runtime error messages about arity and types.

Checklist

  • I have read the Contributor guide
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation if needed
  • I have added tests that prove my fix/feature is working
  • New and existing tests pass locally with my changes

Copy link

github-actions bot commented Apr 28, 2025

Static analysis report

Lizard report

Listing only functions with cyclomatic complexity >= 15 or NLOC >= 100 or parameters >= 6.

Filename Start line:end line Function name Parameters NLOC CCN
src/arkreactor/VM/VM.cpp 330:1587 Ark::VM::safeRun 3 1046 212
src/arkreactor/Compiler/Macros/Processor.cpp 235:608 Ark::internal::MacroProcessor::evaluate 3 350 124
src/arkscript/JsonCompiler.cpp 27:260 JsonCompiler::_compile 1 200 36
include/Ark/Compiler/AST/Parser.hpp 104:193 Ark::internal::ARK_APIParser::string 0 87 32
src/arkreactor/Compiler/Macros/Processor.cpp 102:185 Ark::internal::MacroProcessor::processNode 3 61 27
src/arkreactor/Compiler/AST/Node.cpp 233:306 Ark::internal::Node::debugPrint 1 64 24
src/arkreactor/TypeChecker.cpp 110:194 Ark::types::generateError 5 72 24
src/arkreactor/Compiler/AST/Parser.cpp 272:406 Ark::internal::Parser::import_ 0 108 23
src/arkreactor/Compiler/AST/Optimizer.cpp 33:83 Ark::internal::Optimizer::countAndPruneDeadCode 1 42 20
src/arkreactor/VM/VM.cpp 1683:1789 Ark::VM::backtrace 3 91 20
src/arkscript/REPL/Utils.cpp 52:184 Ark::internal::getColorPerKeyword 0 110 19
src/arkreactor/TypeChecker.cpp 28:108 Ark::types::displayContract 4 70 19
src/arkreactor/Compiler/NameResolution/StaticScope.cpp 68:109 Ark::internal::NamespaceScope::get 2 32 18
src/arkreactor/Compiler/AST/Node.cpp 160:231 Ark::internal::Node::repr 0 59 18
src/arkreactor/VM/Value.cpp 67:127 Ark::Value::toString 1 48 18
src/arkscript/Formatter.cpp 168:224 Formatter::format 3 53 16
src/arkreactor/Compiler/Macros/Processor.cpp 690:729 Ark::internal::MacroProcessor::isConstEval 1 35 16
include/Ark/Exceptions.hpp 110:119 Ark::ARK_APICodeError::CodeError 6 10 1
Report about files you didn't modify in this PR
Filename Start line:end line Function name Parameters NLOC CCN
src/arkreactor/Compiler/BytecodeReader.cpp 274:557 Ark::BytecodeReader::display 4 241 95
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 485:663 Ark::internal::ASTLowerer::handleCalls 5 146 44
src/arkreactor/Compiler/NameResolution/NameResolutionPass.cpp 160:267 Ark::internal::NameResolutionPass::visitKeyword 3 89 32
src/arkscript/main.cpp 17:346 main 2 284 31
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 127:231 Ark::internal::ASTLowerer::compileExpression 5 86 27
src/arkreactor/Compiler/NameResolution/NameResolutionPass.cpp 55:158 Ark::internal::NameResolutionPass::visit 2 84 23
src/arkreactor/Compiler/Lowerer/ASTLowerer.cpp 257:315 Ark::internal::ASTLowerer::compileListInstruction 4 48 22
include/utf8.hpp 138:184 utf8::isValid 1 44 21
src/arkreactor/Compiler/Macros/Executors/Function.cpp 16:88 Ark::internal::FunctionExecutor::applyMacro 2 55 17
src/arkreactor/Exceptions.cpp 86:151 Ark::Diagnostics::makeContext 7 49 17
include/Ark/Compiler/AST/Predicates.hpp 132:156 Ark::internal::IsSymbol::operator ( ) 1 24 16
src/arkreactor/Exceptions.cpp 154:167 Ark::Diagnostics::helper 9 12 4

CppCheck report

Filename Line Type Description
src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp 18 performance Variable 'm_ruleset_two' is assigned in constructor body. Consider performing initialization in initialization list.
src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp 12 style struct member 'EntityWithOffset::offset' is never used.
Report files about files you didn't modify in this PR
Filename Line Type Description
src/arkreactor/Compiler/BytecodeReader.cpp 440 style struct member 'Arg::kind' is never used.
src/arkreactor/Compiler/NameResolution/NameResolutionPass.cpp 141 style Consider using std::find_if algorithm instead of a raw loop.

@coveralls
Copy link

Coverage Status

coverage: 86.495% (+0.09%) from 86.409%
when pulling be06d16 on enhance-runtime-errors
into 748c557 on dev.

Copy link

github-actions bot commented Apr 28, 2025

Fuzzing report

/usr/local/bin/afl-whatsup status check tool for afl-fuzz by Michal Zalewski

Summary stats

    Fuzzers alive : 0
   Dead or remote : 1 (included in stats)
   Total run time : 5 minutes, 0 seconds
      Total execs : 39 thousands
 Cumulative speed : 133 execs/sec
    Pending items : 148 faves, 1172 total
 Coverage reached : 12.98%
    Crashes saved : 0
      Hangs saved : 0

Cycles without finds : 0
Time without finds : 0

[+] Captured 43608 tuples (map size 204152, highest value 255, total values 400158612) in '/dev/null'.
[+] A coverage of 43608 edges were achieved out of 204160 existing (21.36%) with 1184 input files.

@SuperFola SuperFola force-pushed the enhance-runtime-errors branch 6 times, most recently from ad84218 to 0d3c866 Compare May 4, 2025 10:07
@SuperFola SuperFola force-pushed the enhance-runtime-errors branch from 0d3c866 to b5af1db Compare May 4, 2025 16:22
@SuperFola SuperFola force-pushed the enhance-runtime-errors branch from b5af1db to 7a58331 Compare May 4, 2025 16:28
SuperFola added 2 commits May 4, 2025 18:53
…rity errors, and display the function name in async arity errors
…g errors from blue to cyan to be easier to read inside dark terminals
@SuperFola SuperFola merged commit 9f3bdf2 into dev May 4, 2025
21 checks passed
@SuperFola SuperFola deleted the enhance-runtime-errors branch May 4, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants