Skip to content

Conversation

SuperFola
Copy link
Member

@SuperFola SuperFola commented Jul 7, 2024

Description

Enable more warnings. Also enable warnings as errors.

Closes #460

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

@SuperFola SuperFola changed the title Feat/warnings More compiler warnings and warnings as errors Jul 7, 2024
Copy link

github-actions bot commented Jul 7, 2024

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 266:1085 Ark::VM::safeRun 2 659 168
src/arkreactor/Compiler/BytecodeReader.cpp 199:488 Ark::BytecodeReader::display 4 258 120
src/arkreactor/Compiler/Macros/Processor.cpp 246:498 Ark::internal::MacroProcessor::evaluate 2 212 76
src/arkreactor/Compiler/Compiler.cpp 567:696 Ark::Compiler::handleCalls 5 101 35
include/Ark/Compiler/AST/Parser.hpp 84:173 Ark::internal::ARK_APIParser::string 0 87 32
src/arkscript/main.cpp 17:302 main 2 248 28
src/arkreactor/Compiler/Compiler.cpp 277:368 Ark::Compiler::compileExpression 5 75 25
src/arkreactor/Compiler/AST/Node.cpp 209:279 Ark::internal::Node::debugPrint 1 61 23
include/utf8.hpp 138:184 utf8::isValid 1 44 21
src/arkreactor/Compiler/Macros/Processor.cpp 126:196 Ark::internal::MacroProcessor::processNode 2 54 21
src/arkreactor/Compiler/AST/Node.cpp 143:207 Ark::internal::Node::repr 0 56 17
include/Ark/Compiler/AST/Predicates.hpp 162:186 Ark::internal::IsSymbol::operator ( ) 1 24 16
src/arkreactor/Compiler/Macros/Processor.cpp 55:100 Ark::internal::MacroProcessor::registerMacro 1 41 16
src/arkreactor/Exceptions.cpp 79:125 Ark::Diagnostics::makeContext 5 34 16
src/arkscript/Formatter.cpp 153:206 Formatter::format 3 51 15
src/arkreactor/TypeChecker.cpp 27:78 Ark::types::displayContract 2 45 15
src/arkreactor/Exceptions.cpp 128:137 Ark::Diagnostics::helper 8 9 3
include/Ark/Exceptions.hpp 92:101 Ark::CodeError::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/arkscript/JsonCompiler.cpp 23:188 JsonCompiler::_compile 1 139 23
src/arkreactor/Compiler/AST/Parser.cpp 269:396 Ark::internal::Parser::import_ 0 103 21
src/arkreactor/Compiler/Macros/Executors/Function.cpp 12:86 Ark::internal::FunctionExecutor::applyMacro 1 60 18
src/arkreactor/VM/Value.cpp 77:135 Ark::Value::toString 1 46 17

CppCheck report

Filename Line Type Description
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::remove_unused'
src/arkreactor/Compiler/Macros/Processor.cpp 239 performance Function parameter 'origin' should be passed by const reference.
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
src/arkreactor/Builtins/IO.cpp 192 style Consider using std::transform algorithm instead of a raw loop.
src/arkreactor/Compiler/AST/Parser.cpp 388 error Uninitialized variable: import_data.with_prefix
include/Ark/Compiler/Macros/Executor.hpp 64 performance Function parameter 'origin' should be passed by const reference.
include/Ark/Compiler/Macros/Processor.hpp 162 performance Function parameter 'origin' should be passed by const reference.
src/arkreactor/Compiler/Macros/Executor.cpp 12 performance Function parameter 'origin' should be passed by const reference.
src/arkreactor/Compiler/Macros/Executors/Function.cpp 14 style The scope of the variable 'first' can be reduced.
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.

Copy link

github-actions bot commented Jul 7, 2024

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 : 44 thousands
 Cumulative speed : 147 execs/sec
    Pending items : 114 faves, 949 total
 Coverage reached : 10.38%
    Crashes saved : 0
      Hangs saved : 0

Cycles without finds : 0
Time without finds : 0

[+] Captured 28723 tuples (map size 165424, highest value 255, total values 240379089) in '/dev/null'.
[+] A coverage of 28723 edges were achieved out of 165440 existing (17.36%) with 963 input files.

@SuperFola SuperFola force-pushed the feat/warnings branch 4 times, most recently from c882062 to 95b0395 Compare July 12, 2024 15:47
@SuperFola SuperFola force-pushed the feat/warnings branch 4 times, most recently from 483bcb4 to 1d9fc7b Compare July 12, 2024 16:18
@SuperFola SuperFola force-pushed the feat/warnings branch 2 times, most recently from c751e97 to 6f5a785 Compare July 12, 2024 17:17
@SuperFola SuperFola merged commit e53c837 into dev Jul 12, 2024
20 checks passed
@SuperFola SuperFola deleted the feat/warnings branch July 12, 2024 17:29
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.

Enable -Wall -Wextra -Wshadow -Wconversion -Wpedantic
1 participant