git-afsantos / haros

H(igh) A(ssurance) ROS - Static analysis of ROS application code.
MIT License
190 stars 37 forks source link

ERROR:haros.analysis_manager:Plugin haros_plugin_cccc ran into an error. #114

Closed melnarte closed 2 months ago

melnarte commented 3 years ago

Haros is installed with pip install haros no other actions were taken.

After yaml file was created to scan only one custom package

%YAML 1.1
---
packages:
    - qr_filtering

Launching was not successful:

pi@robot:~/catkin_ws/src/core $ haros full -p delete.yaml
[HAROS] Running setup operations...
[HAROS] Loading common definitions...
[HAROS] Loading plugins...
  > Loaded haros_plugin_cccc
  > Loaded haros_plugin_ccd
  > Loaded haros_plugin_cppcheck
  > Loaded haros_plugin_cpplint
  > Loaded haros_plugin_lizard
  > Loaded haros_plugin_mi_calculator
  > Loaded haros_plugin_pylint
  > Loaded haros_plugin_radon
[HAROS] Reading project and indexing source code...
WARNING:haros.extractor:C++ AST parser not found.
[HAROS] Running analysis...
WARNING:haros.analysis_manager:Could not import pyflwor. Skipping query execution.
ERROR:haros.analysis_manager:Plugin haros_plugin_cccc ran into an error.
ERROR:haros.analysis_manager:Plugin haros_plugin_cppcheck ran into an error.
[HAROS] Saving analysis results...
[HAROS] Serving visualisation at localhost:8080
[HAROS] Press enter to shutdown the viz server:

Any ideas what should I install also?

git-afsantos commented 3 years ago

Output seems normal, with a few key points (1).

It should have opened a web browser with the visualizer, after displaying the last couple lines of output. If it did not open the browser, I will have to look into it and ask that you share some details about your environment.


(1) About the error messages.

WARNING:haros.extractor:C++ AST parser not found.

Expected. Only needed if you want to extract models from source code. Requires libclang in your system and clang in Python, both with equal versions. More details:

WARNING:haros.analysis_manager:Could not import pyflwor. Skipping query execution.

Expected. Only needed if you want to write/run queries over extracted models. More details:

ERROR:haros.analysis_manager:Plugin haros_plugin_cccc ran into an error. ERROR:haros.analysis_manager:Plugin haros_plugin_cppcheck ran into an error.

Probably missing the corresponding tools. The HAROS plugins for these are just wrappers that call the tools cccc and cppcheck respectively.

[sudo] apt-get install cppcheck
[sudo] apt-get install cccc

CCCC is used for metrics, such as complexity and coupling, in C++ code.

CppCheck detects bugs, undefined behaviour and dangerous coding constructs in C++ code.