Clang Tidy

Listed below are the warnings and suggestions made by Clang Tidy during compilation.

Type Address Library Message
src/include/tclap/Arg.h
471:2 note: Taking false branch
471:7 note: Assuming the condition is false
473:53 note: Call to virtual method 'Arg::toString' during construction bypasses virtual dispatch
475:2 note: Taking false branch
475:35 note: Left side of '&&' is false
475:7 note: Left side of '&&' is true
476:38 note: Left side of '||' is true
482:8 note: Call to virtual method 'Arg::toString' during construction bypasses virtual dispatch
484:2 note: Taking true branch
484:88 note: Left side of '||' is true
490:8 note: Call to virtual method 'Arg::toString' during construction bypasses virtual dispatch
src/InferenceFramework.cpp
In member function ‘void EERAModel::Inference::InferenceFramework::Run()’:
122:33 -Wsign-compare warning: comparison of integer expressions of different signedness: ‘std::vector::size_type’ {aka ‘long unsigned int’} and ‘int’
135:45 -Wsign-compare warning: comparison of integer expressions of different signedness: ‘std::vector::size_type’ {aka ‘long unsigned int’} and ‘int’
13:40 modernize-pass-by-value warning: pass by value and use std::move
147:55 readability-magic-numbers warning: 10 is a magic number; consider replacing it with a named constant
147:63 readability-braces-around-statements warning: statement should be inside braces
15:32 performance-unnecessary-value-param warning: the parameter 'rng' is copied for each invocation but only used as a const reference; consider making it a const reference
168:26 readability-make-member-function-const warning: method 'ParticlePassesTolerances' can be made const
16:5 modernize-pass-by-value warning: pass by value and use std::move
176:7 performance-unnecessary-value-param warning: the parameter 'seedlist' is copied for each invocation but only used as a const reference; consider making it a const reference
17:5 modernize-pass-by-value warning: pass by value and use std::move
18:14 performance-unnecessary-value-param warning: parameter 'model' is passed by value and only copied once; consider moving it to avoid unnecessary copies
225:67 performance-unnecessary-value-param warning: the const qualified parameter 'kernelWindows' is copied for each invocation; consider making it a reference
22:12 performance-unnecessary-value-param warning: parameter 'log' is passed by value and only copied once; consider moving it to avoid unnecessary copies
235:85 readability-braces-around-statements warning: statement should be inside braces
239:24 readability-braces-around-statements warning: statement should be inside braces
248:26 readability-convert-member-functions-to-static warning: method 'ParticlesAreClose' can be made static
249:37 performance-unnecessary-value-param warning: the const qualified parameter 'kernelWindows' is copied for each invocation; consider making it a reference
256:48 readability-braces-around-statements warning: statement should be inside braces
263:27 note: the definition seen here
296:9 modernize-pass-by-value warning: pass by value and use std::move
299:17 performance-unnecessary-value-param warning: parameter 'rng' is passed by value and only copied once; consider moving it to avoid unnecessary copies
301:63 performance-unnecessary-value-param warning: the parameter 'particles' is copied for each invocation but only used as a const reference; consider making it a const reference
303:42 cppcoreguidelines-narrowing-conversions warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
308:39 performance-unnecessary-value-param warning: the parameter 'parameterGenerator' is copied for each invocation but only used as a const reference; consider making it a const reference
src/include/tclap/CmdLine.h
355:2 note: Calling 'CmdLine::_constructor'
377:2 note: Taking true branch
377:7 note: Field '_helpAndVersion' is true
380:25 note: Calling constructor for 'SwitchArg'
383:3 note: Call to virtual method 'CmdLine::add' during construction bypasses virtual dispatch
391:3 note: Call to virtual method 'CmdLine::add' during construction bypasses virtual dispatch
401:2 note: Call to virtual method 'CmdLine::add' during construction bypasses virtual dispatch
src/Random.cpp
19:55 modernize-avoid-c-arrays warning: do not declare C-style arrays, use std::array<> instead
19:67 modernize-avoid-c-arrays warning: do not declare C-style arrays, use std::array<> instead
7:10 google-runtime-int warning: consider replacing 'unsigned long' with 'uint64'
src/InferenceParameters.cpp
10:5 modernize-pass-by-value warning: pass by value and use std::move
11:5 modernize-pass-by-value warning: pass by value and use std::move
12:13 performance-unnecessary-value-param warning: parameter 'rng' is passed by value and only copied once; consider moving it to avoid unnecessary copies
22:31 google-readability-casting warning: redundant cast to the same type
59:12 cppcoreguidelines-init-variables warning: variable 'parameter' is not initialized
9:5 modernize-pass-by-value warning: pass by value and use std::move
src/IO.cpp
In function ‘void EERAModel::IO::WriteOutputsToFiles(int, int, int, int, const std::vector&, const string&, const Sptr&)’:
101:5 hicpp-member-init warning: uninitialized record type: 'commonParameters'
110:99 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
166:60 performance-unnecessary-value-param warning: parameter 'log' is passed by value and only copied once; consider moving it to avoid unnecessary copies
187:116 readability-magic-numbers warning: 8 is a magic number; consider replacing it with a named constant
188:67 readability-magic-numbers warning: 8 is a magic number; consider replacing it with a named constant
189:67 readability-magic-numbers warning: 9 is a magic number; consider replacing it with a named constant
190:67 readability-magic-numbers warning: 10 is a magic number; consider replacing it with a named constant
191:67 readability-magic-numbers warning: 11 is a magic number; consider replacing it with a named constant
192:67 readability-magic-numbers warning: 12 is a magic number; consider replacing it with a named constant
193:67 readability-magic-numbers warning: 13 is a magic number; consider replacing it with a named constant
194:84 readability-magic-numbers warning: 14 is a magic number; consider replacing it with a named constant
195:67 readability-magic-numbers warning: 15 is a magic number; consider replacing it with a named constant
200:114 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
244:107 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
30:5 hicpp-member-init warning: uninitialized record type: 'parameters'
383:21 note: the definition seen here
414:67 -Wunused-parameter warning: unused parameter ‘nPar’
41:86 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
440:62 cppcoreguidelines-narrowing-conversions warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
445:71 cppcoreguidelines-narrowing-conversions warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
468:39 cppcoreguidelines-narrowing-conversions warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
468:45 cppcoreguidelines-narrowing-conversions warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
483:53 cppcoreguidelines-narrowing-conversions warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
483:59 cppcoreguidelines-narrowing-conversions warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
483:64 cppcoreguidelines-narrowing-conversions warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
522:76 performance-unnecessary-value-param warning: the const qualified parameter 'particle' is copied for each invocation; consider making it a reference
559:72 google-runtime-int warning: consider replacing 'unsigned long' with 'uint64'
560:37 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
568:74 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
590:72 readability-magic-numbers warning: 5 is a magic number; consider replacing it with a named constant
591:72 readability-magic-numbers warning: 6 is a magic number; consider replacing it with a named constant
592:72 readability-magic-numbers warning: 7 is a magic number; consider replacing it with a named constant
596:56 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
605:63 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
74:5 hicpp-member-init warning: uninitialized record type: 'paramlist'
94:69 performance-unnecessary-value-param warning: parameter 'log' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/ArgumentParser.cpp
12:24 note: Calling constructor for 'CmdLine'
42:68 readability-braces-around-statements warning: statement should be inside braces
44:74 readability-braces-around-statements warning: statement should be inside braces
46:13 readability-braces-around-statements warning: statement should be inside braces
49:47 readability-braces-around-statements warning: statement should be inside braces
51:13 readability-braces-around-statements warning: statement should be inside braces
66:67 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
71:36 readability-braces-around-statements warning: statement should be inside braces
7:21 note: Assuming 'i' is >= 'argc'
7:35 readability-braces-around-statements warning: statement should be inside braces
7:5 note: Loop condition is false. Execution continues on line 12
8:19 modernize-use-emplace warning: use emplace_back instead of push_back
8:41 cppcoreguidelines-pro-bounds-pointer-arithmetic warning: do not use pointer arithmetic
97:22 readability-make-member-function-const warning: method 'AppendOptions' can be made const
src/TempModel.cpp
121:19 readability-magic-numbers warning: 5 is a magic number; consider replacing it with a named constant
57:38 readability-magic-numbers warning: 7 is a magic number; consider replacing it with a named constant
7:112 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
7:48 modernize-pass-by-value warning: pass by value and use std::move
8:12 performance-unnecessary-value-param warning: parameter 'rng' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/main.cpp
14:1 google-build-using-namespace warning: do not use namespace using-directives; use using-declarations instead
2:10 modernize-deprecated-headers warning: inclusion of deprecated C++ header 'time.h'; consider using 'ctime' instead
35:19 cppcoreguidelines-init-variables warning: variable 'randomiser_seed' is not initialized
35:5 google-runtime-int warning: consider replacing 'unsigned long' with 'uint64'
src/ModelCommon.cpp
28:3 performance-inefficient-vector-operation warning: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop
7:37 performance-unnecessary-value-param warning: the parameter 'rng' is copied for each invocation but only used as a const reference; consider making it a const reference
9:13 cppcoreguidelines-narrowing-conversions warning: narrowing conversion from 'double' to 'int'
src/include/tclap/SwitchArg.h
149:5 note: Calling constructor for 'Arg'
src/IO.h
114:21 note: differing parameters are named here: ('set_selection'), in definition: ('index')
src/InferenceFramework.h
257:27 note: differing parameters are named here: ('particleList'), in definition: ('particles')
src/PredictionFramework.cpp
11:5 modernize-pass-by-value warning: pass by value and use std::move
12:5 modernize-pass-by-value warning: pass by value and use std::move
13:5 modernize-pass-by-value warning: pass by value and use std::move
14:5 modernize-pass-by-value warning: pass by value and use std::move
15:5 modernize-pass-by-value warning: pass by value and use std::move
16:15 performance-unnecessary-value-param warning: parameter 'model' is passed by value and only copied once; consider moving it to avoid unnecessary copies
18:13 performance-unnecessary-value-param warning: parameter 'rng' is passed by value and only copied once; consider moving it to avoid unnecessary copies
20:13 performance-unnecessary-value-param warning: parameter 'log' is passed by value and only copied once; consider moving it to avoid unnecessary copies
33:32 readability-magic-numbers warning: 10 is a magic number; consider replacing it with a named constant
33:40 readability-braces-around-statements warning: statement should be inside braces
src/Utilities.cpp
18:54 hicpp-signed-bitwise warning: use of a signed integer operand with a binary bitwise operator
23:5 hicpp-member-init warning: uninitialized record type: 'buffer'
25:49 hicpp-signed-bitwise warning: use of a signed integer operand with a binary bitwise operator
src/Observations.h
50:9 note: differing parameters are named here: ('regionalCases'), in definition: ('regional_cases')
src/OriginalModel.cpp
121:19 readability-magic-numbers warning: 5 is a magic number; consider replacing it with a named constant
57:38 readability-magic-numbers warning: 6 is a magic number; consider replacing it with a named constant
7:106 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
7:42 modernize-pass-by-value warning: pass by value and use std::move
8:12 performance-unnecessary-value-param warning: parameter 'rng' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/IrishModel.cpp
121:19 readability-magic-numbers warning: 5 is a magic number; consider replacing it with a named constant
57:38 readability-magic-numbers warning: 7 is a magic number; consider replacing it with a named constant
7:112 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
7:48 modernize-pass-by-value warning: pass by value and use std::move
8:12 performance-unnecessary-value-param warning: parameter 'rng' is passed by value and only copied once; consider moving it to avoid unnecessary copies
src/Observations.cpp
In function ‘EERAModel::Observations::ObsSelect EERAModel::Observations::SelectObservations(int&, const std::vector&, const std::vector&, const std::vector&, int, EERAModel::Utilities::logging_stream::Sptr)’:
39:26 -Wunused-parameter warning: unused parameter ‘timeStamps’
43:34 performance-unnecessary-value-param warning: the parameter 'log' is copied for each invocation but only used as a const reference; consider making it a const reference
52:18 -Wsign-compare warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector::size_type’ {aka ‘long unsigned int’}
85:55 readability-magic-numbers warning: 7.0 is a magic number; consider replacing it with a named constant
8:9 note: the definition seen here