|
1 | | -102264 warnings generated. |
2 | | -src/utils_aux.cc: clang-tidy-18 -p=build -line-filter=[{\"name\":\"src/cart_cell.cc\",\"lines\":[[1,321]]},{\"name\":\"src/cart_cell.h\",\"lines\":[[1,250]]},{\"name\":\"src/cart_tumor.cc\",\"lines\":[[1,133]]},{\"name\":\"src/cart_tumor.h\",\"lines\":[[1,36]]},{\"name\":\"src/diffusion_thomas_algorithm.cc\",\"lines\":[[1,319]]},{\"name\":\"src/diffusion_thomas_algorithm.h\",\"lines\":[[1,194]]},{\"name\":\"src/forces_tumor_cart.cc\",\"lines\":[[1,163]]},{\"name\":\"src/forces_tumor_cart.h\",\"lines\":[[1,60]]},{\"name\":\"src/hyperparams.h\",\"lines\":[[1,216]]},{\"name\":\"src/tumor_cell.cc\",\"lines\":[[1,673]]},{\"name\":\"src/tumor_cell.h\",\"lines\":[[1,301]]},{\"name\":\"src/utils_aux.cc\",\"lines\":[[1,176]]},{\"name\":\"src/utils_aux.h\",\"lines\":[[1,96]]}] --enable-check-profile -store-check-profile=clang-tidy-review-profile --config-file=.clang-tidy --export-fixes=/tmp/tmpb2o1s_sd/tmp_xr510k8.yaml src/utils_aux.cc |
3 | | -Suppressed 102378 warnings (102216 in non-user code, 162 NOLINT). |
4 | | -Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. |
5 | | -/github/workspace/src/utils_aux.cc:23:1: warning: #includes are not sorted properly [llvm-include-order] |
6 | | - 23 | #include <cmath> |
7 | | - | ^ ~~~~~~~ |
8 | | - | "hyperparams.h" |
9 | | - 24 | #include <fstream> |
10 | | - | ~~~~~~~~~ |
11 | | - | "tumor_cell.h" |
12 | | - 25 | #include <tuple> |
13 | | - | ~~~~~~~ |
14 | | - | <cmath> |
15 | | - 26 | #include <vector> |
16 | | - | ~~~~~~~~ |
17 | | - | <fstream> |
18 | | - 27 | #include "hyperparams.h" |
19 | | - | ~~~~~~~~~~~~~~~ |
20 | | - | <tuple> |
21 | | - 28 | #include "tumor_cell.h" |
22 | | - | ~~~~~~~~~~~~~~ |
23 | | - | <vector> |
24 | | -/github/workspace/src/utils_aux.cc:34:1: warning: no header providing "bdm::real_t" is directly included [misc-include-cleaner] |
25 | | - 27 | #include "hyperparams.h" |
26 | | - 28 | #include "tumor_cell.h" |
27 | | - 29 | |
28 | | - 30 | namespace bdm { |
29 | | - 31 | |
30 | | - 32 | // Samples a Gaussian value with given mean and standard deviation but all |
31 | | - 33 | // negative values are mapped to zero |
32 | | - 34 | real_t SamplePositiveGaussian(float mean, float sigma) { |
33 | | - | ^ |
34 | | -/github/workspace/src/utils_aux.cc:43:13: warning: no header providing "bdm::Real3" is directly included [misc-include-cleaner] |
35 | | - 27 | std::vector<Real3> CreateSphereOfTumorCells(real_t sphere_radius) { |
36 | | - | ^ |
37 | | -/github/workspace/src/utils_aux.cc:45:3: warning: variable 'cell_radius' of type 'real_t' (aka 'double') can be declared 'const' [misc-const-correctness] |
38 | | - 45 | real_t cell_radius = |
39 | | - | ^ |
40 | | - | const |
41 | | -/github/workspace/src/utils_aux.cc:46:46: warning: 6 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] |
42 | | - 46 | std::cbrt(kDefaultVolumeNewTumorCell * 6 / Math::kPi) / 2; |
43 | | - | ^ |
44 | | -/github/workspace/src/utils_aux.cc:46:50: warning: no header providing "bdm::Math" is directly included [misc-include-cleaner] |
45 | | - 27 | std::cbrt(kDefaultVolumeNewTumorCell * 6 / Math::kPi) / 2; |
46 | | - | ^ |
47 | | -/github/workspace/src/utils_aux.cc:51:3: warning: variable 'spacing_x' of type 'real_t' (aka 'double') can be declared 'const' [misc-const-correctness] |
48 | | - 51 | real_t spacing_x = cell_radius * std::sqrt(3.0); |
49 | | - | ^ |
50 | | - | const |
51 | | -/github/workspace/src/utils_aux.cc:51:46: warning: 3.0 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] |
52 | | - 51 | real_t spacing_x = cell_radius * std::sqrt(3.0); |
53 | | - | ^ |
54 | | -/github/workspace/src/utils_aux.cc:52:3: warning: variable 'spacing_y' of type 'real_t' (aka 'double') can be declared 'const' [misc-const-correctness] |
55 | | - 52 | real_t spacing_y = cell_radius * 2.0; |
56 | | - | ^ |
57 | | - | const |
58 | | -/github/workspace/src/utils_aux.cc:52:36: warning: 2.0 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] |
59 | | - 52 | real_t spacing_y = cell_radius * 2.0; |
60 | | - | ^ |
61 | | -/github/workspace/src/utils_aux.cc:53:3: warning: variable 'spacing_z' of type 'real_t' (aka 'double') can be declared 'const' [misc-const-correctness] |
62 | | - 53 | real_t spacing_z = cell_radius * std::sqrt(3.0); |
63 | | - | ^ |
64 | | - | const |
65 | | -/github/workspace/src/utils_aux.cc:53:46: warning: 3.0 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] |
66 | | - 53 | real_t spacing_z = cell_radius * std::sqrt(3.0); |
67 | | - | ^ |
68 | | -/github/workspace/src/utils_aux.cc:56:3: warning: Variable 'z' with floating point type 'real_t' should not be used as a loop counter [clang-analyzer-security.FloatLoopCounter] |
69 | | - 56 | for (real_t z = -sphere_radius; z < sphere_radius; z += spacing_z, ++zc) { |
70 | | - | ^ ~ ~ |
71 | | -/github/workspace/src/utils_aux.cc:56:3: note: Variable 'z' with floating point type 'real_t' should not be used as a loop counter |
72 | | - 56 | for (real_t z = -sphere_radius; z < sphere_radius; z += spacing_z, ++zc) { |
73 | | - | ^ ~ ~ |
74 | | -/github/workspace/src/utils_aux.cc:58:5: warning: Variable 'x' with floating point type 'real_t' should not be used as a loop counter [clang-analyzer-security.FloatLoopCounter] |
75 | | - 58 | for (real_t x = -sphere_radius; x < sphere_radius; x += spacing_x, ++xc) { |
76 | | - | ^ ~ ~ |
77 | | -/github/workspace/src/utils_aux.cc:58:5: note: Variable 'x' with floating point type 'real_t' should not be used as a loop counter |
78 | | - 58 | for (real_t x = -sphere_radius; x < sphere_radius; x += spacing_x, ++xc) { |
79 | | - | ^ ~ ~ |
80 | | -/github/workspace/src/utils_aux.cc:60:7: warning: Variable 'y' with floating point type 'real_t' should not be used as a loop counter [clang-analyzer-security.FloatLoopCounter] |
81 | | - 60 | for (real_t y = -sphere_radius; y < sphere_radius; y += spacing_y, ++yc) { |
82 | | - | ^ ~ ~ |
83 | | -/github/workspace/src/utils_aux.cc:60:7: note: Variable 'y' with floating point type 'real_t' should not be used as a loop counter |
84 | | - 60 | for (real_t y = -sphere_radius; y < sphere_radius; y += spacing_y, ++yc) { |
85 | | - | ^ ~ ~ |
86 | | -/github/workspace/src/utils_aux.cc:62:9: warning: variable 'px' of type 'real_t' (aka 'double') can be declared 'const' [misc-const-correctness] |
87 | | - 62 | real_t px = x + (zc % 2) * 0.5 * cell_radius; |
88 | | - | ^ |
89 | | - | const |
90 | | -/github/workspace/src/utils_aux.cc:62:36: warning: 0.5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] |
91 | | - 62 | real_t px = x + (zc % 2) * 0.5 * cell_radius; |
92 | | - | ^ |
93 | | -/github/workspace/src/utils_aux.cc:63:9: warning: variable 'py' of type 'real_t' (aka 'double') can be declared 'const' [misc-const-correctness] |
94 | | - 63 | real_t py = y + (xc % 2) * cell_radius; |
95 | | - | ^ |
96 | | - | const |
97 | | -/github/workspace/src/utils_aux.cc:64:9: warning: variable 'pz' of type 'real_t' (aka 'double') can be declared 'const' [misc-const-correctness] |
98 | | - 64 | real_t pz = z; |
99 | | - | ^ |
100 | | - | const |
101 | | -/github/workspace/src/utils_aux.cc:66:9: warning: variable 'dist' of type 'real_t' (aka 'double') can be declared 'const' [misc-const-correctness] |
102 | | - 66 | real_t dist = std::sqrt(px * px + py * py + pz * pz); |
103 | | - | ^ |
104 | | - | const |
105 | | -/github/workspace/src/utils_aux.cc:80:12: warning: no header providing "size_t" is directly included [misc-include-cleaner] |
106 | | - 24 | std::tuple<size_t, size_t, size_t, size_t, size_t, size_t, real_t> |
107 | | - | ^ |
108 | | -/github/workspace/src/utils_aux.cc:92:30: warning: no header providing "bdm::Agent" is directly included [misc-include-cleaner] |
109 | | - 27 | rm->ForEachAgent([&](const Agent* agent) { |
110 | | - | ^ |
111 | | -/github/workspace/src/utils_aux.cc:93:9: warning: 'auto *tumor_cell' can be declared as 'const auto *tumor_cell' [readability-qualified-auto] |
112 | | - 93 | if (auto* tumor_cell = dynamic_cast<const TumorCell*>(agent)) { |
113 | | - | ^ |
114 | | - | const |
115 | | -/github/workspace/src/utils_aux.cc:96:7: warning: variable 'dist_sq' of type 'real_t' (aka 'double') can be declared 'const' [misc-const-correctness] |
116 | | - 96 | real_t dist_sq = pos[0] * pos[0] + pos[1] * pos[1] + pos[2] * pos[2]; |
117 | | - | ^ |
118 | | - | const |
119 | | -/github/workspace/src/utils_aux.cc:115:14: warning: 5 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] |
120 | | - 115 | case 5: |
121 | | - | ^ |
122 | | -/github/workspace/src/utils_aux.cc:135:54: warning: no header providing "std::ios" is directly included [misc-include-cleaner] |
123 | | - 25 | std::ofstream file("output/final_data.csv", std::ios::app); |
124 | | - | ^ |
125 | | -/github/workspace/src/utils_aux.cc:148:7: warning: variable 'total_minutes' of type 'double' can be declared 'const' [misc-const-correctness] |
126 | | - 148 | double total_minutes = |
127 | | - | ^ |
128 | | - | const |
129 | | -/github/workspace/src/utils_aux.cc:150:7: warning: variable 'total_hours' of type 'double' can be declared 'const' [misc-const-correctness] |
130 | | - 150 | double total_hours = total_minutes / 60.0; |
131 | | - | ^ |
132 | | - | const |
133 | | -/github/workspace/src/utils_aux.cc:150:44: warning: 60.0 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] |
134 | | - 150 | double total_hours = total_minutes / 60.0; |
135 | | - | ^ |
136 | | -/github/workspace/src/utils_aux.cc:151:7: warning: variable 'total_days' of type 'double' can be declared 'const' [misc-const-correctness] |
137 | | - 151 | double total_days = total_hours / 24.0; |
138 | | - | ^ |
139 | | - | const |
140 | | -/github/workspace/src/utils_aux.cc:151:41: warning: 24.0 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers] |
141 | | - 151 | double total_days = total_hours / 24.0; |
142 | | - | ^ |
143 | | -/github/workspace/src/utils_aux.cc:154:14: warning: variable 'total_num_tumor_cells' is not initialized [cppcoreguidelines-init-variables] |
144 | | - 154 | size_t total_num_tumor_cells; |
145 | | - | ^ |
146 | | - | = 0 |
147 | | -/github/workspace/src/utils_aux.cc:155:7: warning: multiple declarations in a single statement reduces readability [readability-isolate-declaration] |
148 | | - 155 | size_t num_tumor_cells_type1, num_tumor_cells_type2, |
149 | | - | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
150 | | - 156 | num_tumor_cells_type3, num_tumor_cells_type4, |
151 | | - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
152 | | - 157 | num_tumor_cells_type5_dead; |
153 | | - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
154 | | -/github/workspace/src/utils_aux.cc:155:14: warning: variable 'num_tumor_cells_type1' is not initialized [cppcoreguidelines-init-variables] |
155 | | - 155 | size_t num_tumor_cells_type1, num_tumor_cells_type2, |
156 | | - | ^ |
157 | | -note: this fix will not be applied because it overlaps with another fix |
158 | | -/github/workspace/src/utils_aux.cc:155:37: warning: variable 'num_tumor_cells_type2' is not initialized [cppcoreguidelines-init-variables] |
159 | | - 155 | size_t num_tumor_cells_type1, num_tumor_cells_type2, |
160 | | - | ^ |
161 | | -note: this fix will not be applied because it overlaps with another fix |
162 | | -/github/workspace/src/utils_aux.cc:156:11: warning: variable 'num_tumor_cells_type3' is not initialized [cppcoreguidelines-init-variables] |
163 | | - 156 | num_tumor_cells_type3, num_tumor_cells_type4, |
164 | | - | ^ |
165 | | -note: this fix will not be applied because it overlaps with another fix |
166 | | -/github/workspace/src/utils_aux.cc:156:34: warning: variable 'num_tumor_cells_type4' is not initialized [cppcoreguidelines-init-variables] |
167 | | - 156 | num_tumor_cells_type3, num_tumor_cells_type4, |
168 | | - | ^ |
169 | | -note: this fix will not be applied because it overlaps with another fix |
170 | | -/github/workspace/src/utils_aux.cc:157:11: warning: variable 'num_tumor_cells_type5_dead' is not initialized [cppcoreguidelines-init-variables] |
171 | | - 157 | num_tumor_cells_type5_dead; |
172 | | - | ^ |
173 | | -note: this fix will not be applied because it overlaps with another fix |
174 | | -/github/workspace/src/utils_aux.cc:158:14: warning: variable 'tumor_radius' is not initialized [cppcoreguidelines-init-variables] |
175 | | - 23 | real_t tumor_radius; |
176 | | - | ^ |
177 | | - | = NAN |
0 commit comments