Patches
Description
Fixing a few things
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
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 | 320:1270 | Ark::VM::safeRun |
3 | 771 | 161 |
| src/arkreactor/Compiler/Macros/Processor.cpp | 244:573 | Ark::internal::MacroProcessor::evaluate |
3 | 308 | 122 |
| src/arkreactor/Compiler/BytecodeReader.cpp | 197:447 | Ark::BytecodeReader::display |
4 | 215 | 76 |
| src/arkscript/JsonCompiler.cpp | 26:248 | JsonCompiler::_compile |
1 | 191 | 35 |
| src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp | 117:146 | Ark::internal::IROptimizer::compactEntities |
3 | 20 | 28 |
| src/arkreactor/Compiler/AST/Parser.cpp | 269:400 | Ark::internal::Parser::import_ |
0 | 106 | 23 |
| src/arkreactor/Compiler/AST/Node.cpp | 201:267 | Ark::internal::Node::debugPrint |
1 | 58 | 23 |
| src/arkreactor/Compiler/Macros/Processor.cpp | 93:165 | Ark::internal::MacroProcessor::processNode |
2 | 53 | 22 |
| include/utf8.hpp | 138:184 | utf8::isValid |
1 | 44 | 21 |
| src/arkreactor/Compiler/Macros/Executors/Function.cpp | 13:87 | Ark::internal::FunctionExecutor::applyMacro |
2 | 60 | 18 |
| src/arkreactor/Compiler/AST/Node.cpp | 135:199 | Ark::internal::Node::repr |
0 | 56 | 17 |
| src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp | 84:115 | Ark::internal::IROptimizer::compactEntities |
2 | 18 | 16 |
| src/arkscript/Formatter.cpp | 168:221 | Formatter::format |
3 | 51 | 15 |
| src/arkreactor/Compiler/Macros/Processor.cpp | 664:702 | Ark::internal::MacroProcessor::isConstEval |
1 | 34 | 15 |
| src/arkreactor/Exceptions.cpp | 86:130 | Ark::Diagnostics::makeContext |
6 | 35 | 15 |
| src/arkreactor/Exceptions.cpp | 133:146 | Ark::Diagnostics::helper |
9 | 12 | 4 |
Report about files you didn't modify in this PR
| Filename | Start line:end line | Function name | Parameters | NLOC | CCN |
|---|---|---|---|---|---|
| src/arkreactor/Compiler/Compiler.cpp | 412:574 | Ark::internal::Compiler::handleCalls |
5 | 131 | 39 |
| src/arkscript/REPL/Repl.cpp | 17:229 | Ark::Repl::Repl |
1 | 180 | 35 |
| include/Ark/Compiler/AST/Parser.hpp | 105:194 | Ark::internal::ARK_APIParser::string |
0 | 87 | 32 |
| src/arkscript/main.cpp | 17:336 | main |
2 | 276 | 30 |
| src/arkreactor/Compiler/Compiler.cpp | 118:209 | Ark::internal::Compiler::compileExpression |
5 | 75 | 25 |
| src/arkreactor/Compiler/NameResolutionPass.cpp | 172:271 | Ark::internal::NameResolutionPass::visitKeyword |
2 | 90 | 25 |
| src/arkreactor/Compiler/NameResolutionPass.cpp | 108:170 | Ark::internal::NameResolutionPass::visit |
1 | 53 | 18 |
| src/arkreactor/VM/Value.cpp | 67:125 | Ark::Value::toString |
1 | 46 | 17 |
| include/Ark/Compiler/AST/Predicates.hpp | 132:156 | Ark::internal::IsSymbol::operator ( ) |
1 | 24 | 16 |
| src/arkreactor/TypeChecker.cpp | 28:85 | Ark::types::displayContract |
2 | 51 | 15 |
| include/Ark/Exceptions.hpp | 92:101 | Ark::CodeError::CodeError |
6 | 10 | 1 |
CppCheck report
| Filename | Line | Type | Description |
|---|---|---|---|
| src/arkreactor/Compiler/AST/Parser.cpp | 392 | error | Uninitialized variable: import_data.with_prefix |
| src/arkreactor/Compiler/BytecodeReader.cpp | 332 | style | struct member 'Arg::arg' is never used. |
| include/Ark/Compiler/Macros/Processor.hpp | 169 | performance | Function parameter 'origin' should be passed by const reference. |
| src/arkreactor/Compiler/IntermediateRepresentation/IROptimizer.cpp | 11 | style | struct member 'EntityWithOffset::offset' is never used. |
| src/arkreactor/Compiler/Macros/Executor.cpp | 12 | performance | Function parameter 'origin' should be passed by const reference. |
| include/Ark/Compiler/Macros/Executor.hpp | 72 | performance | Function parameter 'origin' should be passed by const reference. |
| src/arkreactor/Compiler/Macros/Executors/Function.cpp | 15 | style | The scope of the variable 'first' can be reduced. |
| src/arkreactor/Compiler/Macros/Processor.cpp | 64 | warning | Assert statement calls a function which may have desired side effects: 'list'. |
| src/arkreactor/Compiler/Macros/Processor.cpp | 223 | performance | Function parameter 'origin' should be passed by const reference. |
| src/arkreactor/VM/VM.cpp | 434 | style | Statements following return, break, continue, goto or throw will never be executed. |
| src/arkreactor/VM/VM.cpp | 358 | error | syntax error |
| src/arkscript/JsonCompiler.cpp | 171 | style | Consider using std::accumulate algorithm instead of a raw loop. |
| src/arkscript/JsonCompiler.cpp | 178 | style | Consider using std::transform algorithm instead of a raw loop. |
Report files about files you didn't modify in this PR
| Filename | Line | Type | Description |
|---|---|---|---|
| src/arkreactor/Builtins/IO.cpp | 24 | style | Parameter 'n' can be declared with const |
| src/arkreactor/Builtins/IO.cpp | 43 | style | Parameter 'n' can be declared with const |
| include/Ark/Compiler/AST/Optimizer.hpp | 64 | style | Unused private function: 'Optimizer::throwOptimizerError' |
| include/Ark/Compiler/AST/Optimizer.hpp | 70 | style | Unused private function: 'Optimizer::removeUnused' |
| src/arkreactor/VM/Scope.cpp | 51 | style | Variable 'id' is not assigned a value. |
| src/arkreactor/VM/Scope.cpp | 61 | style | Variable 'id' is not assigned a value. |
| src/arkreactor/VM/Scope.cpp | 71 | style | Variable 'id' is not assigned a value. |
| src/arkscript/REPL/Repl.cpp | 24 | style | Consider using std::copy algorithm instead of a raw loop. |
| src/arkscript/REPL/Repl.cpp | 26 | style | Consider using std::copy algorithm instead of a raw loop. |
| src/arkscript/REPL/Repl.cpp | 28 | style | Consider using std::copy algorithm instead of a raw loop. |
| src/arkscript/REPL/Repl.cpp | 30 | style | Consider using std::copy algorithm instead of a raw loop. |
| src/arkscript/REPL/Repl.cpp | 36 | style | Consider using std::transform algorithm instead of a raw loop. |
| src/arkscript/REPL/Repl.cpp | 38 | style | Consider using std::transform algorithm instead of a raw loop. |
| src/arkscript/REPL/Repl.cpp | 47 | style | Consider using std::transform algorithm instead of a raw loop. |
| src/arkscript/main.cpp | 84 | information | Unmatched suppression: constStatement |
coverage: 76.877% (+0.4%) from 76.499% when pulling 622161d8ae40a138ac01ef3453114df1938a8773 on patches into 7c9f978e1020dd91435ab82a02473cacf8aadfc0 on dev.
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 : 35 thousands
Cumulative speed : 119 execs/sec
Pending items : 107 faves, 1000 total
Coverage reached : 10.10%
Crashes saved : 0
Hangs saved : 0
Cycles without finds : 0 Time without finds : 0
[+] Captured 33335 tuples (map size 184117, highest value 255, total values 336802772) in '/dev/null'. [+] A coverage of 33335 edges were achieved out of 184128 existing (18.10%) with 1011 input files.