summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-11-06 23:49:51 +0100
committerToni Uhlig <matzeton@googlemail.com>2023-11-07 00:02:36 +0100
commit5d56288a113aa3aa2e68dbf54f0acde0650bafcb (patch)
treebc4e9904feac2a8c9e5f5287774416b1aa3822f9 /examples
parent84b12cd02c1f11d134f00b0a066414a677a53719 (diff)
Fixed more SonarCloud complaints.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/c-captured/c-captured.c7
-rw-r--r--examples/c-notifyd/c-notifyd.c2
-rwxr-xr-xexamples/py-machine-learning/keras-autoencoder.py3
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/c-captured/c-captured.c b/examples/c-captured/c-captured.c
index e810f3e70..14457a175 100644
--- a/examples/c-captured/c-captured.c
+++ b/examples/c-captured/c-captured.c
@@ -666,7 +666,8 @@ static void syslog_event(struct nDPIsrvd_socket * const sock,
}
if (src_port != NULL && dst_port != NULL)
{
- size_t src_port_len = 0, dst_port_len = 0;
+ size_t src_port_len = 0;
+ size_t dst_port_len = 0;
char const * const tmp_src_port_str = TOKEN_GET_VALUE(sock, src_port, &src_port_len);
char const * const tmp_dst_port_str = TOKEN_GET_VALUE(sock, dst_port, &dst_port_len);
if (tmp_src_port_str != NULL && tmp_dst_port_str != NULL)
@@ -938,8 +939,8 @@ static enum nDPIsrvd_callback_return captured_json_callback(struct nDPIsrvd_sock
syslog_event(sock, flow, "midstream");
}
- if ((flow_user->packets == NULL || flow_user->flow_max_packets == 0 ||
- utarray_len(flow_user->packets) == 0))
+ if (flow_user->packets == NULL || flow_user->flow_max_packets == 0 ||
+ utarray_len(flow_user->packets) == 0)
{
if (logging_mode != 0)
{
diff --git a/examples/c-notifyd/c-notifyd.c b/examples/c-notifyd/c-notifyd.c
index 837f59ff6..0c9b52f3e 100644
--- a/examples/c-notifyd/c-notifyd.c
+++ b/examples/c-notifyd/c-notifyd.c
@@ -21,7 +21,7 @@ enum dbus_level
static char const * const flow_severities[] = {"Low", "Medium", "High", "Severe", "Critical", "Emergency"};
static char const * const flow_breeds[] = {
- "Safe", "Acceptable", "Fun", "Unsafe", "Potentially Dangerous", "Tracker/Ads", "Dangerous", "Unrated", "???"};
+ "Safe", "Acceptable", "Fun", "Unsafe", "Potentially Dangerous", "Tracker\\/Ads", "Dangerous", "Unrated", "???"};
static char const * const flow_categories[] = {"Unspecified",
"Media",
"VPN",
diff --git a/examples/py-machine-learning/keras-autoencoder.py b/examples/py-machine-learning/keras-autoencoder.py
index 086cf505c..fc3115012 100755
--- a/examples/py-machine-learning/keras-autoencoder.py
+++ b/examples/py-machine-learning/keras-autoencoder.py
@@ -273,8 +273,7 @@ def plot_worker(shared_shutdown_event, shared_plot_queue):
ys2 = []
ys3 = []
ys4 = []
- x = 0
- a = ani.FuncAnimation(fig, plot_animate, fargs=(shared_plot_queue, (ax1, ax2, ax3, ax4), xs, (ys1, ys2, ys3, ys4)), interval=1000, cache_frame_data=False)
+ ani.FuncAnimation(fig, plot_animate, fargs=(shared_plot_queue, (ax1, ax2, ax3, ax4), xs, (ys1, ys2, ys3, ys4)), interval=1000, cache_frame_data=False)
plt.subplots_adjust(left=0.05, right=0.95, top=0.95, bottom=0.05)
plt.margins(x=0, y=0)
plt.show()