diff --git a/dbus_capture.cpp b/dbus_capture.cpp
index 715fd41..50ed37f 100644
--- a/dbus_capture.cpp
+++ b/dbus_capture.cpp
@@ -14,8 +14,8 @@
 
 #include "analyzer.hpp"
 #include "histogram.hpp"
-#include "sensorhelper.hpp"
 #include "main.hpp"
+#include "sensorhelper.hpp"
 
 #include <ncurses.h>
 #include <stdlib.h>
@@ -30,11 +30,11 @@
 
 namespace dbus_top_analyzer
 {
-    extern DBusTopStatistics g_dbus_statistics;
-    extern Histogram<float> g_mc_time_histogram;
+extern DBusTopStatistics g_dbus_statistics;
+extern Histogram<float> g_mc_time_histogram;
 } // namespace dbus_top_analyzer
 
-static void TrackMessage(sd_bus_message* m)
+static void TrackMessage([[maybe_unused]] sd_bus_message* m)
 {}
 // Obtain a Monitoring DBus connection
 int AcquireBus(sd_bus** ret)
@@ -188,7 +188,7 @@
             }
             // This is for the bottom-right window
             dbus_top_analyzer::g_dbus_statistics.OnNewDBusMessage(
-            sender_uniq.c_str(), dest_uniq.c_str(), interface, path, member,
+                sender_uniq.c_str(), dest_uniq.c_str(), interface, path, member,
                 type, m);
             sd_bus_message_unref(m);
         }
diff --git a/main.cpp b/main.cpp
index 5293f9b..a61b493 100644
--- a/main.cpp
+++ b/main.cpp
@@ -51,34 +51,34 @@
 
 void ActivateWindowA()
 {
-    g_views[0]->visible_=true;
-    g_views[0]->maximize_=true;
-    g_views[1]->visible_=false;
-    g_views[2]->visible_=false;
+    g_views[0]->visible_ = true;
+    g_views[0]->maximize_ = true;
+    g_views[1]->visible_ = false;
+    g_views[2]->visible_ = false;
 }
 
 void ActivateWindowB()
 {
-    g_views[1]->visible_=true;
-    g_views[1]->maximize_=true;
-    g_views[0]->visible_=false;
-    g_views[2]->visible_=false;
+    g_views[1]->visible_ = true;
+    g_views[1]->maximize_ = true;
+    g_views[0]->visible_ = false;
+    g_views[2]->visible_ = false;
 }
 void ActivateWindowC()
 {
-    g_views[2]->visible_=true;
-    g_views[2]->maximize_=true;
-    g_views[0]->visible_=false;
-    g_views[1]->visible_=false;
+    g_views[2]->visible_ = true;
+    g_views[2]->maximize_ = true;
+    g_views[0]->visible_ = false;
+    g_views[1]->visible_ = false;
 }
 void ActivateAllWindows()
 {
     g_views[0]->maximize_ = false;
-    g_views[1]->maximize_=false;
-    g_views[2]->maximize_=false;
-    g_views[0]->visible_=true;
-    g_views[1]->visible_=true;
-    g_views[2]->visible_= true;
+    g_views[1]->maximize_ = false;
+    g_views[2]->maximize_ = false;
+    g_views[0]->visible_ = true;
+    g_views[1]->visible_ = true;
+    g_views[2]->visible_ = true;
 }
 
 void InitColorPairs()
@@ -89,7 +89,8 @@
 
 // Returns number of lines drawn
 int DrawTextWithWidthLimit(WINDOW* win, std::string txt, int y, int x,
-                           int width, const std::string& delimiters)
+                           int width,
+                           [[maybe_unused]] const std::string& delimiters)
 {
     int ret = 0;
     std::string curr_word, curr_line;
@@ -128,8 +129,9 @@
     for (DBusTopWindow* v : g_views)
     {
         v->OnResize(maxx, maxy);
-        if(v->maximize_){
-            v->rect={0,0,maxx,maxy-MARGIN_BOTTOM};
+        if (v->maximize_)
+        {
+            v->rect = {0, 0, maxx, maxy - MARGIN_BOTTOM};
             v->UpdateWindowSizeAndPosition();
         }
     }
@@ -224,7 +226,7 @@
         {
             switch (c)
             {
-                case '\e': // 27 in dec, 0x1B in hex, escape key
+                case 0x1B: // 27 in dec, 0x1B in hex, escape key
                 {
                     getch();
                     c = getch();
@@ -242,7 +244,7 @@
                         case 'D':
                             curr_view->OnKeyDown("left");
                             break;
-                        case '\e':
+                        case 0x1B:
                             curr_view->OnKeyDown("escape");
                             break;
                     }
@@ -350,7 +352,7 @@
     }
 }
 
-int main(int argc, char** argv)
+int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
 {
     int r = AcquireBus(&g_bus);
     if (r <= 0)
diff --git a/menu.cpp b/menu.cpp
index 47d1f57..dcff459 100644
--- a/menu.cpp
+++ b/menu.cpp
@@ -17,8 +17,8 @@
 #include "views.hpp"
 
 ArrowKeyNavigationMenu::ArrowKeyNavigationMenu(DBusTopWindow* view) :
-    win_(view->win), parent_(view), idx0_(INVALID), idx1_(INVALID),
-    h_padding_(2), col_width_(15), h_spacing_(2), choice_(INVALID)
+    win_(view->win), h_padding_(2), col_width_(15), h_spacing_(2),
+    idx0_(INVALID), idx1_(INVALID), choice_(INVALID), parent_(view)
 {}
 
 void ArrowKeyNavigationMenu::do_Render(bool is_column_major)
@@ -71,7 +71,7 @@
                 wattrset(win_, A_REVERSE);
             }
             std::string s = items_[idx];
-            while (s.size() < col_width_)
+            while (s.size() < static_cast<size_t>(col_width_))
             {
                 s.push_back(' ');
             }
@@ -283,11 +283,14 @@
         choice_ = INVALID;
         return;
     }
-    if (c < 0)
-        c = 0;
-    if (c >= static_cast<int>(items_.size()))
+    if (static_cast<size_t>(c) >= items_.size())
     {
-        c = static_cast<int>(items_.size() - 1);
+        c = items_.size() - 1;
+    }
+    if (c < 0)
+    {
+        choice_ = 0;
+        return;
     }
     choice_ = c;
 }
@@ -299,7 +302,7 @@
 
 bool ArrowKeyNavigationMenu::RemoveHighlightedItem(std::string* ret)
 {
-    if (choice_ < 0 || choice_ >= items_.size())
+    if (choice_ < 0 || static_cast<size_t>(choice_) >= items_.size())
         return false;
     std::string r = items_[choice_];
     items_.erase(items_.begin() + choice_);
@@ -309,7 +312,7 @@
     }
     else
     {
-        if (choice_ >= items_.size())
+        if (choice_ > 0 && static_cast<size_t>(choice_) >= items_.size())
         {
             choice_ = items_.size() - 1;
         }
diff --git a/sensorhelper.cpp b/sensorhelper.cpp
index 3f8bba6..ed482e7 100644
--- a/sensorhelper.cpp
+++ b/sensorhelper.cpp
@@ -13,6 +13,7 @@
 // limitations under the License.
 
 #include "sensorhelper.hpp"
+
 #include "main.hpp"
 
 #include <unistd.h>
@@ -62,8 +63,8 @@
 }
 
 // Example: /xyz/openbmc_project/sensors/temperature/powerseq_temp/chassis
-bool IsSensorObjectPathWithAssociation(const std::string& s,
-                                       std::string* sensor_obj_path)
+bool IsSensorObjectPathWithAssociation(
+    const std::string& s, [[maybe_unused]] std::string* sensor_obj_path)
 {
     std::vector<std::string> sections = MySplit(s);
     if (sections.size() == 6)
@@ -100,8 +101,9 @@
 }
 
 std::vector<std::string> FindAllObjectPathsForService(
-    const std::string& service,
-    std::function<void(const std::string&, const std::vector<std::string>&)>
+    [[maybe_unused]] const std::string& service,
+    [[maybe_unused]] std::function<void(const std::string&,
+                                        const std::vector<std::string>&)>
         on_interface_cb)
 {
     // Not available for PCAP replay, only valid with actual DBus capture
diff --git a/views.cpp b/views.cpp
index fdbf85d..5acf160 100644
--- a/views.cpp
+++ b/views.cpp
@@ -454,14 +454,14 @@
         const int col0 = idx0 / nrows + 1, col1 = idx1 / nrows;
         mvwprintw(win, 1, 2, "Columns %d-%d of %d", col0, col1,
                   total_num_columns);
-        mvwprintw(win, 1, rect.w - 15, "%d sensors", sensor_ids_.size());
+        mvwprintw(win, 1, rect.w - 15, "%zu sensors", sensor_ids_.size());
     }
     else if (state == SensorDetail)
     {
         // sensor_ids_ is the cached list of sensors, it should be the same size
         // as the actual number of sensors in the snapshot
         mvwprintw(win, 1, 2, "Details of sensor %s", curr_sensor_id_.c_str());
-        mvwprintw(win, 1, rect.w - 15, "Sensor %d/%u", choice_ + 1,
+        mvwprintw(win, 1, rect.w - 15, "Sensor %d/%zu", choice_ + 1,
                   sensor_ids_.size()); // 1-based
         std::vector<Sensor*> sensors =
             g_sensor_snapshot->FindSensorsBySensorID(curr_sensor_id_);
diff --git a/views.hpp b/views.hpp
index d4f3779..203795d 100644
--- a/views.hpp
+++ b/views.hpp
@@ -21,6 +21,7 @@
 #include "sensorhelper.hpp"
 
 #include <ncurses.h>
+
 #include <string>
 #include <vector>
 constexpr int MARGIN_BOTTOM = 1;
@@ -84,7 +85,7 @@
     SummaryView() : DBusTopWindow()
     {}
     void Render() override;
-    void OnResize(int win_w, int win_h) override
+    void OnResize(int win_w, [[maybe_unused]] int win_h) override
     {
         rect.h = 8;
         rect.w = win_w;
@@ -94,7 +95,7 @@
     }
 
     void UpdateDBusTopStatistics(DBusTopStatistics* stat);
-    void OnKeyDown(const std::string& key) override
+    void OnKeyDown([[maybe_unused]] const std::string& key) override
     {}
     std::string GetStatusString() override
     {
@@ -430,8 +431,8 @@
     };
     SortOrder sort_order_;
 
-    int disp_row_idx_; // From which row to start displaying? (essentially a
-                       // vertical scroll bar)
+    int disp_row_idx_;    // From which row to start displaying? (essentially a
+                          // vertical scroll bar)
     int last_choices_[2]; // Last choice index on either side
     enum MenuState
     {
@@ -451,7 +452,7 @@
         menu2_->win_ = win;
         UpdateWindowSizeAndPosition();
     }
-    
+
   private:
     void SetMenuState(MenuState s)
     {
@@ -519,7 +520,7 @@
         selectable_ = false; // Cannot be selected by the tab key
     }
 
-    void OnKeyDown(const std::string& key) override
+    void OnKeyDown([[maybe_unused]] const std::string& key) override
     {}
     void OnResize(int win_w, int win_h) override
     {
@@ -535,5 +536,4 @@
     {
         return "";
     }
-
 };
