qdrvm / kagome

Kagome - C++20 implementation of Polkadot Host
https://kagome.readthedocs.io
Apache License 2.0
159 stars 34 forks source link

Static checking #1225

Closed kamilsa closed 2 years ago

kamilsa commented 2 years ago

Make these checks

ortyomka commented 2 years ago

PVS Report

Note: Line in cpp files should be decreased by 2

pvs-studio.com/en/docs/warnings/ 1 err Help: The documentation for all analyzer warnings is available here: https://pvs-studio.com/en/docs/warnings/.

ortyomka commented 2 years ago

cpp-check report:

Note: Find unused functions works incorrect (link). It was excluded from the report.

void f(int x)
{
    int i = 0;
    if (x) {
        // it's safe to move 'int i = 0;' here
        for (int n = 0; n < 10; ++n) {
            // it is possible but not safe to move 'int i = 0;' here
            do_something(&i);
        }
    }
}

When you see this message it is always safe to reduce the variable scope 1 level.